aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/include/grp.h
blob: a50396ecce2d1d2e617ff684857a3651f1ab9142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _GRP_H
#define _GRP_H

#include <stddef.h>
#include <stdio.h>
#include <abi-bits/gid_t.h>

#ifdef __cplusplus
extern "C" {
#endif

struct group {
	char *gr_name;
	char *gr_passwd;
	gid_t gr_gid;
	char **gr_mem;
};

#ifndef __MLIBC_ABI_ONLY

void endgrent(void);
struct group *getgrent(void);
struct group *getgrgid(gid_t);
int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
struct group *getgrnam(const char *);
int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
void setgrent(void);
int putgrent(const struct group *, FILE *);
struct group *fgetgrent(FILE *);

int setgroups(size_t size, const gid_t *list);
int initgroups(const char *user, gid_t group);

// Non standard extension
int getgrouplist(const char *, gid_t, gid_t *, int *);

#endif /* !__MLIBC_ABI_ONLY */

#ifdef __cplusplus
}
#endif

#endif // _GRP_H