1 #include <sys/cdefs.h> 2 #include "namespace.h" 3 #include <lib.h> 4 5 #include <string.h> 6 #include <unistd.h> 7 geteuid(void)8uid_t geteuid(void) 9 { 10 message m; 11 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. 17 */ 18 if (_syscall(PM_PROC_NR, PM_GETUID, &m) < 0) return(-1); 19 return(m.m_pm_lc_getuid.euid); 20 } 21