trysetgroups.c (456B)
1 /* ISC license. */ 2 3 #undef _POSIX_C_SOURCE 4 #undef _XOPEN_SOURCE 5 6 #ifndef _BSD_SOURCE 7 #define _BSD_SOURCE 8 #endif 9 10 #ifndef _GNU_SOURCE 11 #define _GNU_SOURCE 12 #endif 13 14 #ifndef _DEFAULT_SOURCE 15 #define _DEFAULT_SOURCE 16 #endif 17 18 #ifndef _NETBSD_SOURCE 19 #define _NETBSD_SOURCE 20 #endif 21 22 #ifndef __EXTENSIONS__ 23 #define __EXTENSIONS__ 24 #endif 25 26 #include <sys/types.h> 27 #include <unistd.h> 28 #include <grp.h> 29 30 int main (void) 31 { 32 gid_t g = 0 ; 33 setgroups(1, &g) ; 34 return 0 ; 35 }