setresuid(2) - SerenityOS man pages


setresuid, setresgid - set real, effective, and saved user / group ID


#include <unistd.h>

int setresuid(uid_t, uid_t, uid_t);
int setresgid(gid_t, gid_t, gid_t);


Sets all of real, effective, and saved user or group ID to the given values.

An argument of -1 keeps the corresponding ID unchanged.

For non-superusers, each of the given values has to be equal to any of the current real, effective, or saved IDs for the call to succeed.

Return value

If the call was set successful, returns 0. Otherwise, returns -1 and sets errno to describe the error.


See also