cb40e07e73a5624d9dfb4e3299c5e13daba874c1
[musl] / include / grp.h
1 #ifndef _GRP_H
2 #define _GRP_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <features.h>
9
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
33 #ifdef _GNU_SOURCE
34 struct group  *fgetgrent(FILE *stream);
35 #endif
36
37 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
38 int getgrouplist(const char *, gid_t, gid_t *, int *);
39 int setgroups(size_t, const gid_t *);
40 int initgroups(const char *, gid_t);
41 #endif
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif