Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > s

setregid(2)

HP-UX 11i Version 2: August 2003
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

setregid — sets the real and effective group IDs

SYNOPSIS

#include <unistd.h> int setregid(gid_t rgid, gid_t egid);

DESCRIPTION

setregid() sets the real and effective group IDs of the calling process.

Only a privileged process can set the real group ID and/or the effective group ID to any valid value. A non-privileged process can set the real group ID to the saved set-group-ID from one of the exec family of functions, or the effective group ID to either the saved set-group-ID or the real group ID.

Any supplementary group IDs of the calling process remain unchanged.

Argument rgid is the read group ID value to be set with. If rgid is set to -1, the real group ID is not be changed.

Argument egid is the effective group ID value to be set with. If egid is set to -1, the effective group ID is not changed.

The real and effective group IDs may be set to different values in the same call.

RETURN VALUE

Upon successful completion errno is set 0. Otherwise, errno is set to indicate the type of error and neither group IDs are changed.

ERRORS

setregid() fails if any of the following conditions are encountered:

EINVAL

The value of the rgid or egid argument is invalid or out-of-range.

EPERM

The process does NOT have all the appropriate privileges other than to change the real group ID to the saved set-group-ID, or to change the effective group ID to either the real group ID or the saved set-group-ID.

AUTHOR

getregid() was developed by AT*T, the University of California, Berkeley and HP.

getregid() was developed by AT*T.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2003 Hewlett-Packard Development Company, L.P.