getpeuid implementation. Get the uid of a process (by endpoint)
This commit is contained in:
@@ -44,6 +44,7 @@ libc_FILES=" \
|
||||
getlogin.c \
|
||||
getpagesize.c \
|
||||
getpass.c \
|
||||
getpeuid.c \
|
||||
getpwent.c \
|
||||
getttyent.c \
|
||||
getw.c \
|
||||
|
||||
12
lib/other/getpeuid.c
Executable file
12
lib/other/getpeuid.c
Executable file
@@ -0,0 +1,12 @@
|
||||
#include <lib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
PUBLIC uid_t getpeuid(ep)
|
||||
endpoint_t ep;
|
||||
{
|
||||
message m;
|
||||
|
||||
m.m1_i1= ep;
|
||||
if (_syscall(MM, GETPUID, &m) < 0) return ( (uid_t) -1);
|
||||
return( (uid_t) m.m2_i1);
|
||||
}
|
||||
Reference in New Issue
Block a user