some coverity fixes.
[minix.git] / lib / libc / sys-minix / geteuid.c
blobecde17313823ff553f2f602ae7561a4293b75e62
1 #include <sys/cdefs.h>
2 #include "namespace.h"
3 #include <lib.h>
5 #include <unistd.h>
7 #ifdef __weak_alias
8 __weak_alias(geteuid, _geteuid)
9 #endif
11 uid_t geteuid()
13 message m;
15 /* POSIX says that this function is always successful and that no
16 * return value is reserved to indicate an error. Minix syscalls
17 * are not always successful and Minix returns the unreserved value
18 * (uid_t) -1 when there is an error.
20 if (_syscall(PM_PROC_NR, GETUID, &m) < 0) return ( (uid_t) -1);
21 return( (uid_t) m.m2_i1);