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