SETUID
Section: C Library Functions (3)
Index
Return to Main Contents
BSD mandoc
BSD 4.2
NAME
setuid
seteuid
setruid
setgid
setegid
setrgid
- set user and group ID
SYNOPSIS
Fd #include <sys/types.h>
Ft int
Fn setuid uid_t uid
Ft int
Fn seteuid uid_t euid
Ft int
Fn setruid uid_t ruid
Ft int
Fn setgid gid_t gid
Ft int
Fn setegid gid_t egid
Ft int
Fn setrgid gid_t rgid
DESCRIPTION
The
Fn setuid
function
(Fn setgid
)
sets both the real and effective
user ID (group ID) of the current process
as specified.
The
Fn seteuid
function
(Fn setegid
)
sets the effective user ID (group ID) of the
current process.
The
Fn setruid
function
(Fn setrgid
)
sets the real user ID (group ID) of the
current process.
RETURN VALUES
Upon success, these functions return 0;
otherwise -1 is returned.
If the user is not the super user, or the uid
specified is not the real or effective ID, these
functions return -1.
SEE ALSO
setreuid(2),
setregid(2),
getuid(2),
getgid(2)
HISTORY
A
Fn setuid
and
Fn setgid
syscall appeared in
AT&T System
v6 .
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUES
-
- SEE ALSO
-
- HISTORY
-
This document was created by
man2html,
using the manual pages.
Time: 06:41:59 GMT, May 19, 2025