This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Provide sys/xattr.h


Historically, the *xattr functions were first provided by SGI libattr
and prototyped in <attr/xattr.h>.  Later, glibc added them under
<sys/xattr.h>[1], and (on Linux) libattr still provides the symbols for
ABI compatibility but they are now just wrappers.

(FWIW, Darwin also provides these symbols in <sys/xattr.h>[2].)

This can be seen very clearly in GLib's configure[3], where
<sys/xattr.h> and libc are tested in tandem, followed by <attr/xattr.h>
and libattr.  Hence, with only attr/xattr.h present, libattr-devel is
required not only for building GLib, but the -lattr becomes hardcoded in
the libtool .la files, meaning that libglib2.0-devel would require
libattr-devel even though GLib requires no symbols from libattr1.

I see two ways to resolve this:

1) Move include/attr/xattr.h to include/sys/xattr.h, and ship libattr's
attr/xattr.h in libattr-devel, exactly as is done on Linux:

2011-03-29  Yaakov Selkowitz <yselkowitz@...>

	* include/attr/xattr.h: Move from here...
	* include/sys/xattr.h: ...to here.

2) Install a copy of include/attr/xattr.h as <sys/xattr.h>, as in the
attached patch.


Yaakov

[1] http://packages.debian.org/sid/i386/libc6-dev/filelist
[2] http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/getxattr.2.html
[3] http://git.gnome.org/browse/glib/tree/configure.ac#n1710

2011-03-29  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>

	* Makefile.in (install-headers): Ship a copy of <attr/xattr.h>
	as <sys/xattr.h> for compatibility with glibc.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/Makefile.in,v
retrieving revision 1.241
diff -u -r1.241 Makefile.in
--- Makefile.in	28 Sep 2010 14:49:31 -0000	1.241
+++ Makefile.in	29 Mar 2011 07:16:11 -0000
@@ -329,6 +329,7 @@
 	      $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/$$sub/`basename $$i` ; \
 	    done ; \
 	done ; \
+	$(INSTALL_DATA) include/attr/xattr.h $(DESTDIR)$(tooldir)/include/sys/xattr.h
 
 install-man:
 	@$(MKDIRP) $(DESTDIR)$(mandir)/man2 $(DESTDIR)$(mandir)/man3 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]