.TH getuid() "" "" "System Call (libc)"
.PC "Get real user identifier"
.B "#include <unistd.h>"
.B "int getuid()"
.PP
Every process has two different versions of its
.IR "user id" ,
called the
.I real
user id and the
.I effective
user id.
The user ids
determine eligibility to access files or
employ system privileges.
Normally, these two ids are identical.
However, for a
.I "set user id"
load module
(see
.BR exec() ),
the real user id is that of the user,
whereas the effective user id is that of the load module owner.
This distinction allows system programs to use files which are protected from
the user who invokes the program.
.PP
.B getuid()
returns the real user id.
.SH Example
For an example of this call, see the entry for
.BR getpwent() .
.SH "See Also"
.Xr "access()," access
.Xr "exec," exec
.Xr "getegid()," getegid
.Xr "geteuid()," geteuid
.Xr "getgid()," getgid
.Xr "libc," libc
.Xr "login," login
.Xr "setuid()," setuid
.Xr "unistd.h" unistd.h
.br
\*(PX Standard, \(sc4.2.1
