• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifdef _GNU_SOURCE
15 #include <stdio.h>
16 #endif
17 
18 struct group {
19 	char *gr_name;
20 	char *gr_passwd;
21 	gid_t gr_gid;
22 	char **gr_mem;
23 };
24 
25 struct group  *getgrgid(gid_t);
26 struct group  *getgrnam(const char *);
27 
28 int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
29 int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
30 
31 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
32 struct group  *getgrent(void);
33 void           endgrent(void);
34 void           setgrent(void);
35 #endif
36 
37 #ifdef _GNU_SOURCE
38 struct group  *fgetgrent(FILE *);
39 int putgrent(const struct group *, FILE *);
40 #endif
41 
42 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
43 int getgrouplist(const char *, gid_t, gid_t *, int *);
44 int setgroups(size_t, const gid_t *);
45 int initgroups(const char *, gid_t);
46 #endif
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif
53