Manual Page Result
0
Command: getuid | Section: 2 | Source: UNIX v10 | File: getuid.2
GETUID(2) System Calls Manual GETUID(2)
NAME
getuid, getgid, geteuid, getegid, getlogname, getpid, getppid, getpgrp,
setuid, setgid, setruid, setlogname, setpgrp - get or set user, group,
or process identity
SYNOPSIS
int getuid()
int geteuid()
int getgid()
int getegid()
int getlogname(buf)
char *buf;
int getpid()
int getppid()
int getpgrp(pid)
int pid;
int setuid(uid)
int setgid(gid)
int setruid(uid)
int setlogname(buf)
char buf[8];
int setpgrp(pid, pgrp)
int pid, pgrp;
DESCRIPTION
Getuid returns the real userid of the current process, geteuid the ef-
fective userid. The real userid identifies the person who is logged
in, rather than the effective userid, which determines access permis-
sion at the moment. It is thus useful to set-userid programs to find
out who invoked them.
Getgid returns the real groupid, getegid the effective groupid.
Getlogname copies the login name of the current process into the buffer
pointed to by buf, which must be at least eight characters long.
Getpid returns the process id of the current process, getppid that of
its parent process.
Getpgrp returns the process group id of process pid; 0 means the cur-
rent process.
Setuid (setgid) sets the effective and real userid (groupid) of the
current process to uid (gid). Both the effective and the real userid
(groupid) are set. These calls are permitted only if the process is
super-user or if the argument is the real or effective userid
(groupid).
Setruid sets the real userid only. It may only be used by the super-
user.
Setlogname sets the login name returned by getlogname. It may only be
used by the super-user.
Setpgrp sets the process group id of process pid to pgrp. Pid 0 is the
current process. Only the super-user may set the process group of
processes with other userids or set a process group to 0.
SEE ALSO
getuid(1), getlogin(3)
DIAGNOSTICS
getlogname: EFAULT
setlogname: EFAULT, EPERM
setuid, setgid, setruid, setpgrp: EPERM
BUGS
Non-super-user processes may set the process group of descendant
processes; only certain unsupported shells use this, and the facility
may vanish presently.
GETUID(2)