SETUID(2)

NAME
setgid, setegid - get group identity

SYNOPSIS
#include <unistd.h>

intsetuid(gid_t gid )
intseteuid(gid_tgid)

DESCRIPTION
setgid sets the real group ID of the current process. setegid sets the effective group ID of the current process. The real ID corresonds to the ID of the calling process. The effective ID corresponds to the set ID bit on the file being executed.

NOTES FROM THE KERNEL SOURCE
Under Linux 0.99.11, setgid is implemeneted like SysV w/ SAVED_IDS

RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.

ERRORS

EPERM
    The user is not the super-user, and uid does not match the real or effective user ID of the calling process.

CONFORMING TO
POSIX, System V

SEE ALSO
getgid(2), setregid(2)