xref: /haiku/headers/private/kernel/usergroup.h (revision 7749d0bb0c358a3279b1b9cc76d8376e900130a5)
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 
9 #include <unistd.h>
10 
11 #include <SupportDefs.h>
12 
13 
14 namespace BKernel {
15 	struct Team;
16 }
17 
18 using BKernel::Team;
19 
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 // kernel private functions
26 
27 void		inherit_parent_user_and_group(Team* team, Team* parent);
28 status_t	update_set_id_user_and_group(Team* team, const char* file);
29 
30 // syscalls
31 
32 gid_t		_user_getgid(bool effective);
33 uid_t		_user_getuid(bool effective);
34 status_t	_user_setregid(gid_t rgid, gid_t egid, bool setAllIfPrivileged);
35 status_t	_user_setreuid(uid_t ruid, uid_t euid, bool setAllIfPrivileged);
36 ssize_t		_user_getgroups(int groupCount, gid_t* groupList);
37 ssize_t		_user_setgroups(int groupCount, const gid_t* groupList);
38 
39 #ifdef __cplusplus
40 }	// extern "C"
41 #endif
42 
43 
44 #endif	// _KERNEL_USERGROUP_H
45