Initial import from FreeBSD RELENG_4:
[games.git] / lib / libc / sys / setresuid.2
1 .\" Copyright (c) 2000
2 .\"      Sheldon Hearn.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES
19 .\"
20 .\" $FreeBSD: src/lib/libc/sys/setresuid.2,v 1.2.2.8 2001/12/14 18:34:01 ru Exp $
21 .\"
22 .Dd January 17, 2000
23 .Dt SETRESUID 2
24 .Os
25 .Sh NAME
26 .Nm setresgid ,
27 .Nm setresuid
28 .Nd set real, effective and saved user or group ID
29 .Sh LIBRARY
30 .Lb libc
31 .Sh SYNOPSIS
32 .In sys/types.h
33 .In unistd.h
34 .Ft int
35 .Fn setresgid "gid_t rgid" "gid_t egid" "gid_t sgid"
36 .Ft int
37 .Fn setresuid "uid_t ruid" "uid_t euid" "uid_t suid"
38 .Sh DESCRIPTION
39 The
40 .Fn setresuid
41 system call sets the real,
42 effective and saved user IDs of the current process.
43 The analogous
44 .Fn setresgid
45 sets the real, effective and saved group IDs.
46 .Pp
47 Privileged processes may set these IDs
48 to arbitrary values.
49 Unprivileged processes are restricted
50 in that each of the new IDs must match one of the current IDs.
51 .Pp
52 Passing -1 as an argument causes the corresponding value
53 to remain unchanged.
54 .Sh RETURN VALUES
55 .Rv -std
56 .Sh ERRORS
57 .Bl -tag -width Er
58 .It Bq Er EPERM
59 The calling process was not privileged
60 and tried to change one or more IDs to a value
61 which was not the current real ID, the current effective ID
62 nor the current saved ID.
63 .El
64 .Sh SEE ALSO
65 .Xr getegid 2 ,
66 .Xr geteuid 2 ,
67 .Xr getgid 2 ,
68 .Xr getuid 2 ,
69 .Xr issetugid 2 ,
70 .Xr setgid 2 ,
71 .Xr setregid 2 ,
72 .Xr setreuid 2 ,
73 .Xr setuid 2
74 .Sh STANDARDS
75 These system calls are not available on many platforms.
76 They exist in
77 .Fx
78 to support Linux binaries linked against GNU libc2.
79 .Sh HISTORY
80 These system calls first appeared in HP-UX.