blob: a5ab89afe22b9dba906df628cf24a97a8f171ddd (
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
|
#define PERM_GETINFO 0x100
#define PERM_GETGROUP 0x200
struct {
int pid;
int ppid;
int uid;
int gid;
int euid;
int egid;
}
__info_safe;
getgroups(count, locn)
int count;
void * locn;
{
if( count < 0 ) {errno = EINVAL; return -1; }
return __permissions(PERM_GETGROUP, count, locn);
}
getpid()
{
__permissions(PERM_GETINFO, 6, &__info_safe);
return __info_safe.pid;
}
getppid()
{
return __permissions(PERM_GETITEM(1) /*, 0, 0 */);
}
|