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
14namespace BKernel {
15	struct Team;
16}
17
18using BKernel::Team;
19
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25// kernel private functions
26
27void		inherit_parent_user_and_group(Team* team, Team* parent);
28status_t	update_set_id_user_and_group(Team* team, const char* file);
29
30// syscalls
31
32gid_t		_user_getgid(bool effective);
33uid_t		_user_getuid(bool effective);
34status_t	_user_setregid(gid_t rgid, gid_t egid, bool setAllIfPrivileged);
35status_t	_user_setreuid(uid_t ruid, uid_t euid, bool setAllIfPrivileged);
36ssize_t		_user_getgroups(int groupCount, gid_t* groupList);
37ssize_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