4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / lib / libc / sys / getuid.2
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" %sccs.include.redist.man%
.\"
.\" @(#)getuid.2 8.1 (Berkeley) %G%
.\"
.Dd
.Dt GETUID 2
.Os BSD 4
.Sh NAME
.Nm getuid ,
.Nm geteuid
.Nd get user identification
.Sh SYNOPSIS
.Fd #include <unistd.h>
.Fd #include <sys/types.h>
.Ft uid_t
.Fn getuid void
.Ft uid_t
.Fn geteuid void
.Sh DESCRIPTION
The
.Fn getuid
function returns the real user ID of the calling process.
The
.Fn geteuid
function
returns the effective user ID of the calling process.
.Pp
The real user ID is that of the user who has invoked the program.
As the effective user ID
gives the process additional permissions during
execution of
.Dq Em set-user-ID
mode processes,
.Fn getuid
is used to determine the real-user-id of the calling process.
.Sh ERRORS
The
.Fn getuid
and
.Fn geteuid
functions are always successful, and no return value is reserved to
indicate an error.
.Sh SEE ALSO
.Xr getgid 2 ,
.Xr setreuid 2
.Sh STANDARDS
.Fn Geteuid
and
.Fn getuid
conform to IEEE Std 1003.1-1988
.Pq Dq Tn POSIX .