summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--src/include/skalibs/setgroups.h24
2 files changed, 24 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 2d7749e..77ee7b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@ config.mak
src/include/skalibs/config.h
src/include/skalibs/error.h
src/include/skalibs/ip46.h
-src/include/skalibs/setgroups.h
src/include/skalibs/sysdeps.h
src/include/skalibs/types.h
src/include/skalibs/uint16.h
diff --git a/src/include/skalibs/setgroups.h b/src/include/skalibs/setgroups.h
new file mode 100644
index 0000000..fab0614
--- /dev/null
+++ b/src/include/skalibs/setgroups.h
@@ -0,0 +1,24 @@
+/* ISC license. */
+
+#ifndef SKALIBS_SETGROUPS_H
+#define SKALIBS_SETGROUPS_H
+
+#include <skalibs/sysdeps.h>
+
+#ifdef SKALIBS_HASSETGROUPS
+
+#include <unistd.h>
+
+extern int setgroups_with_egid (size_t, gid_t const *) ;
+extern int skalibs_setgroups (size_t, gid_t const *) ;
+
+#else
+
+#include <errno.h>
+#define setgroups(n, tab) (errno = ENOSYS, -1)
+#define setgroups_with_egid(n, tab) (errno = ENOSYS, -1)
+#define skalibs_setgroups(n, tab) (errno = ENOSYS, -1)
+
+#endif
+
+#endif