#include <sys/types.h>
int setuid(uid) uid_t uid;
int seteuid(euid) uid_t euid;
int setruid(ruid) uid_t ruid;
int setgid(gid) gid_t gid;
int setegid(egid) gid_t egid;
int setrgid(rgid) gid_t rgid;
setuid() (setgid()) sets both the real and effective user ID (group ID) of the current process as specified by uid (gid) (see NOTES).
seteuid() (setegid()) sets the effective user ID (group ID) of the current process.
setruid() (setrgid()) sets the real user ID (group ID) of the current process.
These calls are only permitted to the super-user or if the argument is the real or effective user (group) ID of the calling process.
If the effective user ID of the calling process is not super-user, but if its real user (group) ID is equal to uid (gid), or if the saved set-user (group) ID from execve.2v is equal to uid (gid), then the effective user (group) ID is set to uid (gid).
These functions return:
For setuid() to behave as described above, {_POSIX_SAVED_IDS} must be in effect (see sysconf.2v {_POSIX_SAVED_IDS} is always in effect on SunOS systems, but for portability, applications should call sysconf() to determine whether {_POSIX_SAVED_IDS} is in effect for the current system.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97