9.53 getuid/geteuid

uid_t getuid(void);
uid_t geteuid(void);

These syscalls fetch the UID and the effective UID of the calling process. They never fail.