xref: /haiku/headers/private/kernel/usergroup.h (revision d2e1e872611179c9cfaa43ce11bd58b1e3554e4b)
1 /*
2  * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _KERNEL_USERGROUP_H
6 #define _KERNEL_USERGROUP_H
7 
8 #include <unistd.h>
9 
10 #include <SupportDefs.h>
11 
12 
13 struct team;
14 
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 // kernel private functions
21 
22 void		inherit_parent_user_and_group(struct team* team,
23 				struct team* parent);
24 status_t	update_set_id_user_and_group(struct team* team, const char* file);
25 
26 // syscalls
27 
28 gid_t		_user_getgid(bool effective);
29 uid_t		_user_getuid(bool effective);
30 status_t	_user_setregid(gid_t rgid, gid_t egid, bool setAllIfPrivileged);
31 status_t	_user_setreuid(uid_t ruid, uid_t euid, bool setAllIfPrivileged);
32 ssize_t		_user_getgroups(int groupCount, gid_t* groupList);
33 ssize_t		_user_setgroups(int groupCount, const gid_t* groupList);
34 
35 #ifdef __cplusplus
36 }	// extern "C"
37 #endif
38 
39 
40 #endif	// _KERNEL_USERGROUP_H
41