get the effective user ID
#include <sys/types.h> #include <unistd.h> uid_t geteuid( void );
The geteuid() function allows the calling process to find out its effective user ID.
The calling process's effective user ID.
/* * Print the effective user ID of the process. */ #include <stdio.h> #include <sys/types.h> #include <unistd.h> void main() { printf( "My effective user ID is %d\n", geteuid() ); }
POSIX 1003.1
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |