Skip to content
BSD syscall#127

svc · unix #127

setregid

Sets the real and effective group IDs simultaneously.

Prototype

int setregid(gid_t rgid, gid_t egid);

Returns: int

Arguments

NameTypeDirDescription
rgidgid_t-
egidgid_t-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard127
xnu-1486.2.11127
xnu-1504.15.3127
xnu-1504.3.12127
xnu-1504.7.4127
xnu-1504.9.17127
xnu-1504.9.26127
xnu-1504.9.37127

Notes

Analogue of setreuid() for groups. As with the UID variant, -1 leaves an ID unchanged and the saved-set GID is updated in specific cases. Supplementary groups are unaffected.

Related APIs

setgidsetegidgetgidgetegidsetgroups