summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-07-16 15:24:33 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-07-16 15:24:33 +0000
commit42c13f4acdd1e9f6a6cbdd88cb76006768d7ff6a (patch)
treebf885d11f5a376cfa0e7604ff18cc9f058c13745 /src/include
parent16013c560e189bd0c4fb58e038c0f449542dba7a (diff)
downloadskalibs-42c13f4acdd1e9f6a6cbdd88cb76006768d7ff6a.tar.xz
Change setgroups() management, in particular add skalibs_setgroups()
Diffstat (limited to 'src/include')
-rw-r--r--src/include/skalibs/nonposix.h9
-rw-r--r--src/include/skalibs/stddjb.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/include/skalibs/nonposix.h b/src/include/skalibs/nonposix.h
index 7f064d5..3ef4e99 100644
--- a/src/include/skalibs/nonposix.h
+++ b/src/include/skalibs/nonposix.h
@@ -53,6 +53,15 @@
#endif
+ /* Unfortunately we can't fully avoid #ifdef forests,
+ because the BSDs are bloody snowflakes. See: setgroups(). */
+
+#undef SKALIBS_BSD_SUCKS
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)
+# define SKALIBS_BSD_SUCKS
+#endif
+
+
/* old versions of BSD and some broken GNU toolchains:
system headers are not self-contained,
starting with sys/types.h normally always works. */
diff --git a/src/include/skalibs/stddjb.h b/src/include/skalibs/stddjb.h
index 1a2ccca..50e07c5 100644
--- a/src/include/skalibs/stddjb.h
+++ b/src/include/skalibs/stddjb.h
@@ -10,7 +10,6 @@
#include <skalibs/types.h>
#include <skalibs/error.h>
#include <skalibs/ip46.h>
-#include <skalibs/setgroups.h>
#include <skalibs/alarm.h>
#include <skalibs/alloc.h>
@@ -45,6 +44,7 @@
#include <skalibs/nsig.h>
#include <skalibs/segfault.h>
#include <skalibs/selfpipe.h>
+#include <skalibs/setgroups.h>
#include <skalibs/sgetopt.h>
#include <skalibs/sig.h>
#include <skalibs/siovec.h>