setrgid man page on Ultrix

Man page or keyword search:  
man Server   3690 pages
apropos Keyword Search (all sections)
Output format
Ultrix logo
[printable version]

setuid(3)							     setuid(3)

Name
       setuid, seteuid, setruid, setgid, setegid, setrgid - set user and group
       ID

Syntax
       #include <sys/types.h>
       #include <unistd.h>

       setuid(uid)
       uid_t uid;
       seteuid(euid)
       uid_t euid;
       setruid(ruid)
       uid_t ruid;

       setgid(gid)
       gid_t gid;
       setegid(egid)
       gid_t egid;
       setrgid(rgid)
       gid_t rgid;

Description
       The subroutine sets both the real and effective user ID of the  current
       process	to  the	 ID specified.	Likewise, the subroutine sets the real
       and effective group ID of the current process to the ID specified.

       The subroutine sets the effective user ID of the current process, while
       the subroutine sets the effective group ID of the current process.

       The  subroutine sets the real user ID of the current process, while the
       subroutine sets the real group ID of the current process.

       These calls are only permitted to the super-user or if the argument  is
       the real or effective ID.

Environment
       POSIX
       SYSTEM_FIVE
       When  your  program is compiled in POSIX or System V mode the following
       semantics apply when using the or functions:

       If the process is the super-user the real, effective, and saved set (as
       described in user/group ID are set to uid.

       If  the	process is not the super-user, but uid is equal to the real or
       the saved set user/group ID, the effective user/group ID is set to uid.
       The real and saved set user/group ID remain unchanged.

       POSIX
       In POSIX mode, the function returns a value of type uid_t. The function
       returns a value of type gid_t.

Return Values
       Zero is returned if the user ID or group ID is set; -1 is returned oth‐
       erwise.

See Also
       setreuid(2), setregid(2), getuid(2), getgid(2)

								     setuid(3)
[top]

List of man pages available for Ultrix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net