-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
grp.h
35 lines (28 loc) · 956 Bytes
/
grp.h
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
/*
* Copyright (c) 2018-2020, Andreas Kling <[email protected]>
* Copyright (c) 2021, Maxime Friess <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <bits/FILE.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
struct group {
char* gr_name;
char* gr_passwd;
gid_t gr_gid;
char** gr_mem;
};
struct group* getgrent(void);
int getgrent_r(struct group* group_buf, char* buffer, size_t buffer_size, struct group** group_entry_ptr);
void setgrent(void);
void endgrent(void);
struct group* getgrnam(char const* name);
int getgrnam_r(char const* name, struct group* group_buf, char* buffer, size_t buffer_size, struct group** group_entry_ptr);
struct group* getgrgid(gid_t);
int getgrgid_r(gid_t gid, struct group* group_buf, char* buffer, size_t buffer_size, struct group** group_entry_ptr);
int putgrent(const struct group*, FILE*);
int initgroups(char const* user, gid_t);
__END_DECLS