VMS Help  —  CRTL  setregid
    Sets the real and effective group IDs.

    This function is supported on OpenVMS Integrity servers and
    Alpha only.

    Format

      #include  <unistd.h>

      int setregid  (gid_t rgid, gid_t egid);

1  –  Arguments

 rgid

    The value to which you want the real group ID set.

 egid

    The value to which you want the effective group ID set.

2  –  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 can be set to different
    values in the same call.

    Only a process with the IMPERSONATE privilege can set the real
    group ID and the effective group ID to any valid value.

    A nonprivileged process can set either the real group ID to the
    saved set-group-ID from an exec function, or the effective group
    ID to the saved set-group-ID or the real group ID.

    Any supplementary group IDs of the calling process remain
    unchanged.

    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.

    This function requires that long (32-bit) UID/GID support be
    enabled. See 32-Bit UID and GID Macro (Integrity servers, Alpha)
    for more information.

3  –  Return Values

    0                  Successful completion.
    -1                 Indicates an error. Neither of the group IDs
                       is changed, and errno is set to one of the
                       following values:

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

                       o  EPERM - The process does not have the
                          IMPERSONATE privilege, and a change
                          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, was requested.
Close Help