Go to the previous, next section.

setuid

SYNOPSIS

int setuid(gid_t uid);

PARAMETERS

uid: [in] the new uid.

DESCRIPTION

If the calling task does not have superuser privileges, it may use setuid to sets its effective uid to its saved uid or its real uid (other values are illegal). If the calling task has superuser privileges, the real, effective and saved uids are set to uid.

RETURN VALUE

On success, returns 0. On error, returns -1 and errno is set to one of the following values: EPERM: the uid is not the real uid or the saved uid of the task and the task does not have superuser privileges.

Go to the previous, next section.