GETUID(2) — UNIX Programmer’s Manual
NAME
getuid, getgid, geteuid, getegid − get user and group identity
SYNOPSIS
getuid()
geteuid()
getgid()
getegid()
DESCRIPTION
Getuid returns the real user ID of the current process, geteuid the effective user ID. The real user ID identifies the person who is logged in, in contrast to the effective user ID, which determines his access permission at the moment. It is thus useful to programs which operate using the ’set user ID’ mode, to find out who invoked them.
Getgid returns the real group ID, getegid the effective group ID.
SEE ALSO
7th Edition