etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libc / sys / geteuid.c
blob30da04f1a83c76c6cdfa96fff068c60b95787688
1 #include <sys/cdefs.h>
2 #include "namespace.h"
3 #include <lib.h>
5 #include <string.h>
6 #include <unistd.h>
8 uid_t geteuid(void)
10 message m;
12 memset(&m, 0, sizeof(m));
13 /* POSIX says that this function is always successful and that no
14 * return value is reserved to indicate an error. Minix syscalls
15 * are not always successful and Minix returns the unreserved value
16 * (uid_t) -1 when there is an error.
18 if (_syscall(PM_PROC_NR, PM_GETUID, &m) < 0) return(-1);
19 return(m.m_pm_lc_getuid.euid);