*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->HP-UX 11i man pages -> setregid (2)              
Title
Content
Arch
Section
 

Contents


 setregid(2)                                                     setregid(2)




 NAME    [Toc]    [Back]
      setregid - sets the real and effective group IDs

 SYNOPSIS    [Toc]    [Back]
      #include <unistd.h>

      int setregid(gid_t rgid, gid_t egid);

 DESCRIPTION    [Toc]    [Back]
      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    [Toc]    [Back]
      Upon successful completion errno is set 0.  Otherwise, errno is set to
      indicate the type of error and neither group IDs are changed.

 ERRORS    [Toc]    [Back]
      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    [Toc]    [Back]
      getregid() was developed by AT&T, the University of California,
      Berkeley and HP.





 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003






 setregid(2)                                                     setregid(2)




      getregid() was developed by AT&T.

 SEE ALSO    [Toc]    [Back]
      exec(2), geteuid(2), getgid(2), getuid(2), setegid(2), setgid(2),
      setreuid(2), setuid(2).


 Hewlett-Packard Company            - 2 -   HP-UX 11i Version 2: August 2003
[ Back ]
      
      
 Similar pages
Name OS Title
setregid OpenBSD set real and effective group IDs
setregid Tru64 Set the real and effective group ID
setregid FreeBSD set real and effective group ID
setregid IRIX set real and effective group ID
getegid HP-UX get real user, effective user, real group, and effective group IDs
geteuid HP-UX get real user, effective user, real group, and effective group IDs
setreuid Linux set real and/or effective user or group ID
getgid HP-UX get real user, effective user, real group, and effective group IDs
setregid NetBSD set real and effective group ID's
getuid HP-UX get real user, effective user, real group, and effective group IDs
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service