setregid(2) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

setregid(2)

setregid(2)                      System Calls                      setregid(2)

NAME
       setregid - set real and effective group IDs

SYNOPSIS
       #include <unistd.h>

       int setregid(gid_t rgid, gid_t egid);

DESCRIPTION
       The setregid() function is used to set the real and effective group IDs
       of  the  calling  process.  If  rgid  is  −1,  the real group ID is not
       changed; if egid is −1, the effective group ID is not changed. The real
       and effective group IDs may be set to  different  values  in  the  same
       call.


       If  the {PRIV_PROC_SETID} privilege is asserted in the effective set of
       the calling process, the real group ID and the effective group  ID  can
       be set to any legal value.


       If the {PRIV_PROC_SETID} privilege is not asserted in the effective set
       of  the  calling  process,  either  the real group ID can be set to the
       saved set-group-ID from execve(2), or the effective group ID can either
       be set to the saved set-group-ID or the real group ID.


       In either case, if the real group ID is being changed (that is, if rgid
       is not −1), or the effective group ID is being changed to a  value  not
       equal  to the real group ID, the saved set-group-ID is set equal to the
       new effective group ID.

RETURN VALUES
       Upon successful completion, 0 is returned. Otherwise, −1  is  returned,
       errno  is  set to indicate the error, and neither of the group IDs will
       be changed.

ERRORS
       The setregid() function will fail if:

       EINVAL    The value of rgid or egid is less  than  0  or  greater  than
                 UID_MAX (defined in <limits.h>).


       EPERM     The {PRIV_PROC_SETID} privilege is not asserted in the effec‐
                 tive  set of the calling processes and a change was specified
                 other than changing the real group ID to the saved set-group-
                 ID or changing the effective group ID to the real group ID or
                 the saved group ID.


USAGE
       If a set-group-ID process sets its effective group ID to its real group
       ID, it can still set its effective group ID  back  to  the  saved  set-
       group-ID.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface  StabilityCommitted  _  MT-LevelAsync-Signal-
       Safe _ StandardSee standards(7).


SEE ALSO
       setreuid(2),  execve(2),  getgid(2),  setuid(2),  attributes(7), privi‐
       leges(7), standards(7)

Oracle Solaris 11.4               2 Jun 2022                       setregid(2)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3