1*433d6423SLionel Sambuc #include <sys/cdefs.h> 2*433d6423SLionel Sambuc #include "namespace.h" 3*433d6423SLionel Sambuc #include <lib.h> 4*433d6423SLionel Sambuc 5*433d6423SLionel Sambuc #include <string.h> 6*433d6423SLionel Sambuc #include <unistd.h> 7*433d6423SLionel Sambuc geteuid(void)8*433d6423SLionel Sambucuid_t geteuid(void) 9*433d6423SLionel Sambuc { 10*433d6423SLionel Sambuc message m; 11*433d6423SLionel Sambuc 12*433d6423SLionel Sambuc memset(&m, 0, sizeof(m)); 13*433d6423SLionel Sambuc /* POSIX says that this function is always successful and that no 14*433d6423SLionel Sambuc * return value is reserved to indicate an error. Minix syscalls 15*433d6423SLionel Sambuc * are not always successful and Minix returns the unreserved value 16*433d6423SLionel Sambuc * (uid_t) -1 when there is an error. 17*433d6423SLionel Sambuc */ 18*433d6423SLionel Sambuc if (_syscall(PM_PROC_NR, PM_GETUID, &m) < 0) return(-1); 19*433d6423SLionel Sambuc return(m.m_pm_lc_getuid.euid); 20*433d6423SLionel Sambuc } 21