
SETREGID(2)                UNIX Programmer's Manual                SETREGID(2)

NNAAMMEE
     sseettrreeggiidd - set real and effective group ID

SSYYNNOOPPSSIISS
     ##iinncclluuddee <<uunniissttdd..hh>>

     _i_n_t
     sseettrreeggiidd(_i_n_t _r_g_i_d, _i_n_t _e_g_i_d)

DDEESSCCRRIIPPTTIIOONN
     The real and effective group ID's of the current process are set to the
     arguments.  Unprivileged users may change the real group ID to the effec-
     tive group ID and vice-versa; only the super-user may make other changes.

     Supplying a value of -1 for either the real or effective group ID forces
     the system to substitute the current ID in place of the -1 parameter.

RREETTUURRNN VVAALLUUEESS
     Upon successful completion, a value of 0 is returned.  Otherwise, a value
     of -1 is returned and _e_r_r_n_o is set to indicate the error.

EERRRROORRSS
     [EPERM]  The current process is not the super-user and a change other
              than changing the effective group-id to the real group-id was
              specified.

SSEEEE AALLSSOO
     getgid(2),  setreuid(2),  setgid(3)

HHIISSTTOORRYY
     The sseettrreeggiidd function call appeared in 4.2BSD.

4.2 Berkeley Distribution       March 10, 1991                               1






























