After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 525228 - _GNU_SOURCE / struct ucred with recent libc
_GNU_SOURCE / struct ucred with recent libc
Status: RESOLVED FIXED
Product: gamin
Classification: Other
Component: general
unspecified
Other Linux
: Normal blocker
: ---
Assigned To: Gamin Maintainer(s)
Gamin Maintainer(s)
: 534942 548603 558909 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-03-31 02:57 UTC by Owen Taylor
Modified: 2010-07-15 07:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Owen Taylor 2008-03-31 02:57:30 UTC
With recent GNU libc, 'struct ucred' isn't defined
unless _GNU_SOURCE is defined, causing fatal compilation errors
in gam_channel.c and gam_api.c.

The workaround would be something like

#ifdef LINUX
#define _GNU_SOURCE
#include <sys/socket.h>
#undef _GNU_SOURCE
#else 
#include <sys/socket.h>
#endif

in both files, or a simpler unconditional #define _GNU_SOURCE at the top, 
but I haven't researched whether there is some other "approved" way you are
supposed to use SCM_CREDENTIALS.

"Recent GNU libc" is on my (Fedora 9 beta) system 2.7.90.
Comment 1 William Jon McCann 2008-04-20 05:10:47 UTC
This will also work:

--- configure.in	(revision 329)
+++ configure.in	(working copy)
@@ -4,6 +4,9 @@
 AM_CONFIG_HEADER(config.h)
 AC_CANONICAL_SYSTEM
 
+# for ucred
+AC_GNU_SOURCE
+
 # get any external flags setting before we start playing with the CFLAGS variable
 ENV_CFLAGS="$CFLAGS"
Comment 2 Owen Taylor 2008-05-04 12:38:03 UTC
I think keeping the GNU_SOURCE definition as close as possible to
where it is used is a good idea... in terms of a) making things not
break if code is moved elsewhere b) keeping stray non-portable things
from creaping in.
Comment 3 Marco Pesenti Gritti 2008-05-19 16:01:45 UTC
Just fyi, here is the patch that was applied to Fedora:

http://cvs.fedoraproject.org/viewcvs/rpms/gamin/F-9/gamin-0.1.9-ucred-headers.patch?rev=1.1&view=markup
Comment 4 Kjartan Maraas 2008-07-05 10:36:41 UTC
Can we get this in please? And make a release with it? This is breaking the build for me when trying to release GNOME 2.22.3.
Comment 5 Colin Walters 2008-08-22 16:40:06 UTC
*** Bug 534942 has been marked as a duplicate of this bug. ***
Comment 6 André Klapper 2008-09-27 12:10:15 UTC
I ask for a non-maintainer release. I Just run into this too with 0.1.9, http://svn.gnome.org/viewvc/gamin?view=revision&revision=330 fixed it for me.
Comment 7 André Klapper 2008-09-27 12:10:29 UTC
*** Bug 548603 has been marked as a duplicate of this bug. ***
Comment 8 Olav Vitters 2008-11-02 12:08:36 UTC
*** Bug 558909 has been marked as a duplicate of this bug. ***
Comment 9 David King 2010-07-15 07:35:14 UTC
This fix as per comment #6 was released in 0.1.10.