getpeuid implementation. Get the uid of a process (by endpoint)

This commit is contained in:
Philip Homburg
2007-04-27 12:21:06 +00:00
parent 8eb09f6ddc
commit 69ca935251
7 changed files with 49 additions and 0 deletions

View File

@@ -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
View 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);
}