Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _GRP_H |
| 2 | #define _GRP_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Rich Felker | c1a9658 | 2012-09-07 23:13:55 -0400 | [diff] [blame] | 8 | #include <features.h> |
| 9 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 10 | #define __NEED_size_t |
| 11 | #define __NEED_gid_t |
| 12 | |
| 13 | #include <bits/alltypes.h> |
| 14 | |
| 15 | struct group |
| 16 | { |
| 17 | char *gr_name; |
| 18 | char *gr_passwd; |
| 19 | gid_t gr_gid; |
| 20 | char **gr_mem; |
| 21 | }; |
| 22 | |
| 23 | struct group *getgrgid(gid_t); |
| 24 | struct group *getgrnam(const char *); |
| 25 | |
| 26 | int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); |
| 27 | int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); |
| 28 | |
| 29 | struct group *getgrent(void); |
| 30 | void endgrent(void); |
| 31 | void setgrent(void); |
| 32 | |
Rich Felker | 419ae6d | 2012-05-22 21:52:08 -0400 | [diff] [blame] | 33 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
Rich Felker | 3f44f29 | 2011-04-13 09:03:22 -0400 | [diff] [blame] | 34 | int getgrouplist(const char *, gid_t, gid_t *, int *); |
| 35 | int setgroups(size_t, const gid_t *); |
| 36 | int initgroups(const char *, gid_t); |
| 37 | #endif |
| 38 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 39 | #ifdef __cplusplus |
| 40 | } |
| 41 | #endif |
| 42 | |
| 43 | #endif |