mgetgroups: new module, taken from coreutils
[pspp] / lib / unistd.in.h
index 38e2e13f702b91e4d3432fba0d4daba79aea89da..c3219872d8eab6a672a4014df244480d1ae5132e 100644 (file)
@@ -49,7 +49,7 @@
 #endif
 
 /* Get getopt(), optarg, optind, opterr, optopt.  */
-#if @GNULIB_UNISTD_H_GETOPT@
+#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
 # include <getopt.h>
 #endif
 
@@ -239,7 +239,7 @@ extern char **environ;
 
 #if @GNULIB_EUIDACCESS@
 # if !@HAVE_EUIDACCESS@
-/* Like access(), except that is uses the effective user id and group id of
+/* Like access(), except that it uses the effective user id and group id of
    the current process.  */
 extern int euidaccess (const char *filename, int mode);
 # endif
@@ -406,6 +406,28 @@ extern int getdtablesize (void);
 #endif
 
 
+#if @GNULIB_GETGROUPS@
+# if @REPLACE_GETGROUPS@
+#  undef getgroups
+#  define getgroups rpl_getgroups
+# endif
+# if !@HAVE_GETGROUPS@ || @REPLACE_GETGROUPS@
+/* Return the supplemental groups that the current process belongs to.
+   It is unspecified whether the effective group id is in the list.
+   If N is 0, return the group count; otherwise, N describes how many
+   entries are available in GROUPS.  Return -1 and set errno if N is
+   not 0 and not large enough.  Fails with ENOSYS on some systems.  */
+int getgroups (int n, gid_t *groups);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getgroups
+# define getgroups(n,g)                                                 \
+    (GL_LINK_WARNING ("getgroups is unportable - "                      \
+                      "use gnulib module getgroups for portability"),   \
+     getgroups (n, g))
+#endif
+
+
 #if @GNULIB_GETHOSTNAME@
 /* Return the standard host name of the machine.
    WARNING! The host name may or may not be fully qualified.