geteuid(2) - Linux man page

Name

getuid, geteuid - get user identity

Synopsis

#include <unistd.h>
#include <sys/types.h>

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

Description

getuid() returns the real user ID of the current process.

geteuid() returns the effective user ID of the current process.

Errors

These functions are always successful.

Conforming to

POSIX.1-2001, 4.3BSD.

History

In Unix V6 the getuid() call returned (euid << 8) + uid. Unix V7 introduced separate calls getuid() and geteuid().

See Also

setreuid(2), setuid(2)

Referenced By

awk(1), credentials(7), getlogin_r(3), pam_close_session(3), pam_open_session(3), ps(1), seteuid(2), syscalls(2)