setruid3
Set user and group id
Usage
#include <unistd.h>
int
setruid(uid_t ruid);
int
setrgid(gid_t rgid);
Library
Standard C Library (libc, -lc)
Overview
The setruid() function (setrgid()) sets the real user ID (group ID) of the current process.
Return values
The setruid() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
Compatibility
The use of these calls is not portable. Their use is discouraged; they will be removed in the future.
Errors
The functions fail if:
- [EPERM]
-
The user is not the super user and the ID specified is not the real or effective ID.
Releases
87 releases since FreeBSD 2.0.5-RELEASE; the text changed 42 times.