xref: /386bsd/usr/share/man/cat2/setregid.0 (revision a2142627)
1SETREGID(2)               386BSD Programmer's Manual               SETREGID(2)
2
3NNAAMMEE
4     sseettrreeggiidd - set real and effective group ID
5
6SSYYNNOOPPSSIISS
7     ##iinncclluuddee <<uunniissttdd..hh>>
8
9     _i_n_t
10     sseettrreeggiidd(_i_n_t _r_g_i_d, _i_n_t _e_g_i_d)
11
12DDEESSCCRRIIPPTTIIOONN
13     The real and effective group ID's of the current process are set to the
14     arguments.  Unprivileged users may change the real group ID to the
15     effective group ID and vice-versa; only the super-user may make other
16     changes.
17
18     Supplying a value of -1 for either the real or effective group ID forces
19     the system to substitute the current ID in place of the -1 parameter.
20
21RREETTUURRNN VVAALLUUEESS
22     Upon successful completion, a value of 0 is returned.  Otherwise, a value
23     of -1 is returned and _e_r_r_n_o is set to indicate the error.
24
25EERRRROORRSS
26     [EPERM]  The current process is not the super-user and a change other
27              than changing the effective group-id to the real group-id was
28              specified.
29
30SSEEEE AALLSSOO
31     getgid(2),  setreuid(2),  setgid(3)
32
33HHIISSTTOORRYY
34     The sseettrreeggiidd function call appeared in 4.2BSD.
35
364.2 Berkeley Distribution       March 10, 1991                               1
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67