xref: /original-bsd/lib/libc/compat-43/setruid.3 (revision 42f60e33)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)setruid.3	8.1 (Berkeley) 06/02/93
7.\"
8.Dd
9.Dt SETRUID 3
10.Os BSD 4.2
11.Sh NAME
12.Nm setruid ,
13.Nm setrgid
14.Nd set user and group ID
15.Sh SYNOPSIS
16.Fd #include <sys/types.h>
17.Ft int
18.Fn setruid "uid_t ruid"
19.Ft int
20.Fn setrgid "gid_t rgid"
21.Sh DESCRIPTION
22The
23.Fn setruid
24function
25.Pq Fn setrgid
26sets the real user ID (group ID) of the
27current process.
28.Sh RETURN VALUES
29Upon success, these functions return 0;
30otherwise \-1 is returned.
31.Pp
32If the user is not the super user, or the uid
33specified is not the real or effective ID, these
34functions return \-1.
35.Pp
36The use of these calls is not portable.
37Their use is discouraged; they will be removed in the future.
38.Sh SEE ALSO
39.Xr setuid 2 ,
40.Xr setgid 2 ,
41.Xr seteuid 2 ,
42.Xr setegid 2 ,
43.Xr getuid 2 ,
44.Xr getgid 2
45.Sh HISTORY
46The
47.Fn setruid
48and
49.Fn setrgid
50syscalls appeared in
51.Bx 4.2
52and were dropped in
53.Bx 4.4 .
54