X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgetugroups.c;h=a614ec7be35221ec7053d1eb4a984250becf469e;hb=61b3a42219dc8f575923346b59162f81186b7425;hp=2207b85a176f1fdd24fc852203e09a2f875b53d5;hpb=80074d103cc72ea8f289b82c56bd3734aac82cd7;p=gnulib.git diff --git a/lib/getugroups.c b/lib/getugroups.c index 2207b85a1..a614ec7be 100644 --- a/lib/getugroups.c +++ b/lib/getugroups.c @@ -21,22 +21,31 @@ #include "getugroups.h" +#include #include #include /* grp.h on alpha OSF1 V2.0 uses "FILE *". */ -#include - +#include #include -#include +#if !HAVE_GRP_H -/* Some old header files might not declare setgrent, getgrent, and endgrent. - If you don't have them at all, we can't implement this function. - You lose! */ -struct group *getgrent (void); +/* Mingw lacks all things related to group management. The best we + can do is fail with ENOSYS. */ -#include +int +getugroups (int maxcount _UNUSED_PARAMETER_, + gid_t *grouplist _UNUSED_PARAMETER_, + char const *username _UNUSED_PARAMETER_, + gid_t gid _UNUSED_PARAMETER_) +{ + errno = ENOSYS; + return -1; +} -#define STREQ(s1, s2) (strcmp (s1, s2) == 0) +#else /* HAVE_GRP_H */ +# include + +# define STREQ(s1, s2) (strcmp (s1, s2) == 0) /* Like `getgroups', but for user USERNAME instead of for the current process. Store at most MAXCOUNT group IDs in the GROUPLIST array. @@ -112,3 +121,5 @@ getugroups (int maxcount, GETGROUPS_T *grouplist, char const *username, return count; } + +#endif /* HAVE_GRP_H */