From 95abd05e31f10d86d82ae7c3de9d804db9478def Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 28 Feb 2009 22:39:50 +0100 Subject: [PATCH] Define _GNU_SOURCE to get the ucred structure. This is needed for glibc >= 2.8. --- configure.ac | 1 + net.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index dca49203..f783db78 100644 --- a/configure.ac +++ b/configure.ac @@ -223,6 +223,7 @@ AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[ ########################################################################### ucred AC_MSG_CHECKING(for struct ucred) AC_TRY_LINK([ + #define _GNU_SOURCE #include #include ],[ diff --git a/net.c b/net.c index 2a3fc72b..88b3e3cc 100644 --- a/net.c +++ b/net.c @@ -6,6 +6,12 @@ /** \file net.c Networking-related helper functions. */ +/* + * Since glibc 2.8, the _GNU_SOURCE feature test macro must be defined in order + * to obtain the definition of the ucred structure. + */ +#define _GNU_SOURCE + #include /* At least NetBSD needs these. */ -- 2.39.5