OSDN Git Service

LDP: Update POT and ja.po to LDP v3.78
[linuxjm/LDP_man-pages.git] / po4a / process / po / process.pot
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2015-01-23 22:25+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man2/acct.2:31 build/C/man5/acct.5:25
21 #, no-wrap
22 msgid "ACCT"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man2/acct.2:31
27 #, no-wrap
28 msgid "2008-06-16"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man2/acct.2:31 build/C/man5/acct.5:25 build/C/man7/capabilities.7:48 build/C/man2/capget.2:15 build/C/man7/cpuset.7:25 build/C/man7/credentials.7:27 build/C/man2/getgid.2:25 build/C/man2/getgroups.2:31 build/C/man2/getpid.2:25 build/C/man2/getpriority.2:45 build/C/man2/getresuid.2:28 build/C/man2/getrlimit.2:64 build/C/man2/getrusage.2:39 build/C/man2/getsid.2:26 build/C/man2/getuid.2:26 build/C/man2/iopl.2:33 build/C/man2/ioprio_set.2:24 build/C/man2/ipc.2:25 build/C/man7/namespaces.7:27 build/C/man7/pid_namespaces.7:27 build/C/man2/seteuid.2:29 build/C/man2/setfsgid.2:31 build/C/man2/setfsuid.2:31 build/C/man2/setgid.2:29 build/C/man2/setpgid.2:48 build/C/man2/setresuid.2:26 build/C/man2/setreuid.2:45 build/C/man2/setsid.2:31 build/C/man2/setuid.2:30 build/C/man7/svipc.7:40 build/C/man3/ulimit.3:27 build/C/man7/user_namespaces.7:27 build/C/man2/seccomp.2:27
33 #, no-wrap
34 msgid "Linux"
35 msgstr ""
36
37 #. type: TH
38 #: build/C/man2/acct.2:31 build/C/man5/acct.5:25 build/C/man7/capabilities.7:48 build/C/man2/capget.2:15 build/C/man7/cpuset.7:25 build/C/man7/credentials.7:27 build/C/man2/getgid.2:25 build/C/man2/getgroups.2:31 build/C/man2/getpid.2:25 build/C/man2/getpriority.2:45 build/C/man2/getresuid.2:28 build/C/man2/getrlimit.2:64 build/C/man2/getrusage.2:39 build/C/man2/getsid.2:26 build/C/man2/getuid.2:26 build/C/man3/group_member.3:25 build/C/man2/iopl.2:33 build/C/man2/ioprio_set.2:24 build/C/man2/ipc.2:25 build/C/man7/namespaces.7:27 build/C/man7/pid_namespaces.7:27 build/C/man2/seteuid.2:29 build/C/man2/setfsgid.2:31 build/C/man2/setfsuid.2:31 build/C/man2/setgid.2:29 build/C/man2/setpgid.2:48 build/C/man2/setresuid.2:26 build/C/man2/setreuid.2:45 build/C/man2/setsid.2:31 build/C/man2/setuid.2:30 build/C/man7/svipc.7:40 build/C/man3/ulimit.3:27 build/C/man7/user_namespaces.7:27 build/C/man2/seccomp.2:27
39 #, no-wrap
40 msgid "Linux Programmer's Manual"
41 msgstr ""
42
43 #. type: SH
44 #: build/C/man2/acct.2:32 build/C/man5/acct.5:26 build/C/man7/capabilities.7:49 build/C/man2/capget.2:16 build/C/man7/cpuset.7:26 build/C/man7/credentials.7:28 build/C/man2/getgid.2:26 build/C/man2/getgroups.2:32 build/C/man2/getpid.2:26 build/C/man2/getpriority.2:46 build/C/man2/getresuid.2:29 build/C/man2/getrlimit.2:65 build/C/man2/getrusage.2:40 build/C/man2/getsid.2:27 build/C/man2/getuid.2:27 build/C/man3/group_member.3:26 build/C/man2/iopl.2:34 build/C/man2/ioprio_set.2:25 build/C/man2/ipc.2:26 build/C/man7/namespaces.7:28 build/C/man7/pid_namespaces.7:28 build/C/man2/seteuid.2:30 build/C/man2/setfsgid.2:32 build/C/man2/setfsuid.2:32 build/C/man2/setgid.2:30 build/C/man2/setpgid.2:49 build/C/man2/setresuid.2:27 build/C/man2/setreuid.2:46 build/C/man2/setsid.2:32 build/C/man2/setuid.2:31 build/C/man7/svipc.7:41 build/C/man3/ulimit.3:28 build/C/man7/user_namespaces.7:28 build/C/man2/seccomp.2:28
45 #, no-wrap
46 msgid "NAME"
47 msgstr ""
48
49 #. type: Plain text
50 #: build/C/man2/acct.2:34
51 msgid "acct - switch process accounting on or off"
52 msgstr ""
53
54 #. type: SH
55 #: build/C/man2/acct.2:34 build/C/man5/acct.5:28 build/C/man2/capget.2:18 build/C/man2/getgid.2:28 build/C/man2/getgroups.2:34 build/C/man2/getpid.2:28 build/C/man2/getpriority.2:48 build/C/man2/getresuid.2:31 build/C/man2/getrlimit.2:67 build/C/man2/getrusage.2:42 build/C/man2/getsid.2:29 build/C/man2/getuid.2:29 build/C/man3/group_member.3:28 build/C/man2/iopl.2:36 build/C/man2/ioprio_set.2:27 build/C/man2/ipc.2:28 build/C/man2/seteuid.2:32 build/C/man2/setfsgid.2:34 build/C/man2/setfsuid.2:34 build/C/man2/setgid.2:32 build/C/man2/setpgid.2:51 build/C/man2/setresuid.2:29 build/C/man2/setreuid.2:48 build/C/man2/setsid.2:34 build/C/man2/setuid.2:33 build/C/man7/svipc.7:43 build/C/man3/ulimit.3:30 build/C/man2/seccomp.2:30
56 #, no-wrap
57 msgid "SYNOPSIS"
58 msgstr ""
59
60 #. type: Plain text
61 #: build/C/man2/acct.2:38
62 #, no-wrap
63 msgid "B<#include E<lt>unistd.hE<gt>>\n"
64 msgstr ""
65
66 #. type: Plain text
67 #: build/C/man2/acct.2:40
68 #, no-wrap
69 msgid "B<int acct(const char *>I<filename>B<);>\n"
70 msgstr ""
71
72 #. type: Plain text
73 #: build/C/man2/acct.2:46 build/C/man2/getgroups.2:48 build/C/man2/getrlimit.2:84 build/C/man2/getsid.2:37 build/C/man3/group_member.3:36 build/C/man2/seteuid.2:44 build/C/man2/setpgid.2:71 build/C/man2/setreuid.2:60
74 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
75 msgstr ""
76
77 #. type: Plain text
78 #: build/C/man2/acct.2:50
79 msgid "B<acct>(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\\ E<lt>\\ 500)"
80 msgstr ""
81
82 #. type: SH
83 #: build/C/man2/acct.2:50 build/C/man5/acct.5:30 build/C/man7/capabilities.7:51 build/C/man2/capget.2:24 build/C/man7/cpuset.7:28 build/C/man7/credentials.7:30 build/C/man2/getgid.2:36 build/C/man2/getgroups.2:52 build/C/man2/getpid.2:36 build/C/man2/getpriority.2:56 build/C/man2/getresuid.2:39 build/C/man2/getrlimit.2:88 build/C/man2/getrusage.2:48 build/C/man2/getsid.2:50 build/C/man2/getuid.2:37 build/C/man3/group_member.3:40 build/C/man2/iopl.2:40 build/C/man2/ioprio_set.2:35 build/C/man2/ipc.2:34 build/C/man7/namespaces.7:30 build/C/man7/pid_namespaces.7:30 build/C/man2/seteuid.2:53 build/C/man2/setfsgid.2:38 build/C/man2/setfsuid.2:38 build/C/man2/setgid.2:38 build/C/man2/setpgid.2:100 build/C/man2/setresuid.2:37 build/C/man2/setreuid.2:70 build/C/man2/setsid.2:41 build/C/man2/setuid.2:39 build/C/man7/svipc.7:49 build/C/man3/ulimit.3:34 build/C/man7/user_namespaces.7:30 build/C/man2/seccomp.2:43
84 #, no-wrap
85 msgid "DESCRIPTION"
86 msgstr ""
87
88 #. type: Plain text
89 #: build/C/man2/acct.2:60
90 msgid ""
91 "The B<acct>()  system call enables or disables process accounting.  If "
92 "called with the name of an existing file as its argument, accounting is "
93 "turned on, and records for each terminating process are appended to "
94 "I<filename> as it terminates.  An argument of NULL causes accounting to be "
95 "turned off."
96 msgstr ""
97
98 #. type: SH
99 #: build/C/man2/acct.2:60 build/C/man2/capget.2:160 build/C/man2/getgroups.2:92 build/C/man2/getpriority.2:104 build/C/man2/getresuid.2:50 build/C/man2/getrlimit.2:461 build/C/man2/getrusage.2:188 build/C/man2/getsid.2:58 build/C/man3/group_member.3:48 build/C/man2/iopl.2:66 build/C/man2/ioprio_set.2:149 build/C/man2/seteuid.2:67 build/C/man2/setfsgid.2:68 build/C/man2/setfsuid.2:68 build/C/man2/setgid.2:53 build/C/man2/setpgid.2:195 build/C/man2/setresuid.2:64 build/C/man2/setreuid.2:93 build/C/man2/setsid.2:54 build/C/man2/setuid.2:70 build/C/man3/ulimit.3:67 build/C/man2/seccomp.2:342
100 #, no-wrap
101 msgid "RETURN VALUE"
102 msgstr ""
103
104 #. type: Plain text
105 #: build/C/man2/acct.2:65 build/C/man2/capget.2:165 build/C/man2/getresuid.2:55 build/C/man2/getrusage.2:193 build/C/man2/iopl.2:71 build/C/man2/seteuid.2:72 build/C/man2/setgid.2:58 build/C/man2/setresuid.2:69 build/C/man2/setreuid.2:98 build/C/man2/setuid.2:75
106 msgid ""
107 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
108 "appropriately."
109 msgstr ""
110
111 #. type: SH
112 #: build/C/man2/acct.2:65 build/C/man2/capget.2:179 build/C/man7/cpuset.7:1100 build/C/man2/getgid.2:42 build/C/man2/getgroups.2:106 build/C/man2/getpid.2:44 build/C/man2/getpriority.2:117 build/C/man2/getresuid.2:55 build/C/man2/getrlimit.2:466 build/C/man2/getrusage.2:193 build/C/man2/getsid.2:63 build/C/man2/getuid.2:43 build/C/man2/iopl.2:71 build/C/man2/ioprio_set.2:169 build/C/man2/seteuid.2:79 build/C/man2/setgid.2:58 build/C/man2/setpgid.2:216 build/C/man2/setresuid.2:76 build/C/man2/setreuid.2:105 build/C/man2/setsid.2:61 build/C/man2/setuid.2:82 build/C/man3/ulimit.3:74 build/C/man2/seccomp.2:358
113 #, no-wrap
114 msgid "ERRORS"
115 msgstr ""
116
117 #. type: TP
118 #: build/C/man2/acct.2:66 build/C/man7/cpuset.7:1116 build/C/man7/cpuset.7:1123 build/C/man7/cpuset.7:1129 build/C/man7/cpuset.7:1137 build/C/man7/cpuset.7:1144 build/C/man2/getpriority.2:137 build/C/man2/setpgid.2:217
119 #, no-wrap
120 msgid "B<EACCES>"
121 msgstr ""
122
123 #. type: Plain text
124 #: build/C/man2/acct.2:77
125 msgid ""
126 "Write permission is denied for the specified file, or search permission is "
127 "denied for one of the directories in the path prefix of I<filename> (see "
128 "also B<path_resolution>(7)), or I<filename> is not a regular file."
129 msgstr ""
130
131 #. type: TP
132 #: build/C/man2/acct.2:77 build/C/man2/capget.2:180 build/C/man7/cpuset.7:1172 build/C/man2/getgroups.2:107 build/C/man2/getresuid.2:56 build/C/man2/getrlimit.2:467 build/C/man2/getrusage.2:194 build/C/man2/seccomp.2:369
133 #, no-wrap
134 msgid "B<EFAULT>"
135 msgstr ""
136
137 #. type: Plain text
138 #: build/C/man2/acct.2:81
139 msgid "I<filename> points outside your accessible address space."
140 msgstr ""
141
142 #. type: TP
143 #: build/C/man2/acct.2:81 build/C/man7/cpuset.7:1238 build/C/man7/cpuset.7:1246
144 #, no-wrap
145 msgid "B<EIO>"
146 msgstr ""
147
148 #. type: Plain text
149 #: build/C/man2/acct.2:85
150 msgid "Error writing to the file I<filename>."
151 msgstr ""
152
153 #. type: TP
154 #: build/C/man2/acct.2:85
155 #, no-wrap
156 msgid "B<EISDIR>"
157 msgstr ""
158
159 #. type: Plain text
160 #: build/C/man2/acct.2:89
161 msgid "I<filename> is a directory."
162 msgstr ""
163
164 #. type: TP
165 #: build/C/man2/acct.2:89
166 #, no-wrap
167 msgid "B<ELOOP>"
168 msgstr ""
169
170 #. type: Plain text
171 #: build/C/man2/acct.2:93
172 msgid "Too many symbolic links were encountered in resolving I<filename>."
173 msgstr ""
174
175 #. type: TP
176 #: build/C/man2/acct.2:93 build/C/man7/cpuset.7:1251 build/C/man7/cpuset.7:1258 build/C/man7/cpuset.7:1263
177 #, no-wrap
178 msgid "B<ENAMETOOLONG>"
179 msgstr ""
180
181 #. type: Plain text
182 #: build/C/man2/acct.2:97
183 msgid "I<filename> was too long."
184 msgstr ""
185
186 #. type: TP
187 #: build/C/man2/acct.2:97
188 #, no-wrap
189 msgid "B<ENFILE>"
190 msgstr ""
191
192 #. type: Plain text
193 #: build/C/man2/acct.2:100
194 msgid "The system limit on the total number of open files has been reached."
195 msgstr ""
196
197 #. type: TP
198 #: build/C/man2/acct.2:100 build/C/man7/cpuset.7:1275 build/C/man7/cpuset.7:1280
199 #, no-wrap
200 msgid "B<ENOENT>"
201 msgstr ""
202
203 #. type: Plain text
204 #: build/C/man2/acct.2:103
205 msgid "The specified filename does not exist."
206 msgstr ""
207
208 #. type: TP
209 #: build/C/man2/acct.2:103 build/C/man7/cpuset.7:1287 build/C/man2/getgroups.2:127 build/C/man2/seccomp.2:413 build/C/man2/seccomp.2:416
210 #, no-wrap
211 msgid "B<ENOMEM>"
212 msgstr ""
213
214 #. type: Plain text
215 #: build/C/man2/acct.2:106 build/C/man2/getgroups.2:130 build/C/man2/seccomp.2:416
216 msgid "Out of memory."
217 msgstr ""
218
219 #. type: TP
220 #: build/C/man2/acct.2:106 build/C/man2/iopl.2:76
221 #, no-wrap
222 msgid "B<ENOSYS>"
223 msgstr ""
224
225 #. type: Plain text
226 #: build/C/man2/acct.2:112
227 msgid ""
228 "BSD process accounting has not been enabled when the operating system kernel "
229 "was compiled.  The kernel configuration parameter controlling this feature "
230 "is B<CONFIG_BSD_PROCESS_ACCT>."
231 msgstr ""
232
233 #. type: TP
234 #: build/C/man2/acct.2:112 build/C/man7/cpuset.7:1314
235 #, no-wrap
236 msgid "B<ENOTDIR>"
237 msgstr ""
238
239 #. type: Plain text
240 #: build/C/man2/acct.2:117
241 msgid "A component used as a directory in I<filename> is not in fact a directory."
242 msgstr ""
243
244 #. type: TP
245 #: build/C/man2/acct.2:117 build/C/man2/capget.2:191 build/C/man2/capget.2:196 build/C/man7/cpuset.7:1319 build/C/man2/getgroups.2:130 build/C/man2/getpriority.2:149 build/C/man2/getrlimit.2:483 build/C/man2/getrlimit.2:488 build/C/man2/getrlimit.2:496 build/C/man2/getsid.2:64 build/C/man2/iopl.2:79 build/C/man2/ioprio_set.2:179 build/C/man2/seteuid.2:83 build/C/man2/setgid.2:64 build/C/man2/setpgid.2:231 build/C/man2/setresuid.2:103 build/C/man2/setreuid.2:132 build/C/man2/setsid.2:62 build/C/man2/setuid.2:110 build/C/man3/ulimit.3:75
246 #, no-wrap
247 msgid "B<EPERM>"
248 msgstr ""
249
250 #. type: Plain text
251 #: build/C/man2/acct.2:123
252 msgid ""
253 "The calling process has insufficient privilege to enable process "
254 "accounting.  On Linux the B<CAP_SYS_PACCT> capability is required."
255 msgstr ""
256
257 #. type: TP
258 #: build/C/man2/acct.2:123
259 #, no-wrap
260 msgid "B<EROFS>"
261 msgstr ""
262
263 #. type: Plain text
264 #: build/C/man2/acct.2:127
265 msgid "I<filename> refers to a file on a read-only filesystem."
266 msgstr ""
267
268 #. type: TP
269 #: build/C/man2/acct.2:127
270 #, no-wrap
271 msgid "B<EUSERS>"
272 msgstr ""
273
274 #. type: Plain text
275 #: build/C/man2/acct.2:130
276 msgid "There are no more free file structures or we ran out of memory."
277 msgstr ""
278
279 #. type: SH
280 #: build/C/man2/acct.2:130 build/C/man5/acct.5:153 build/C/man7/capabilities.7:1120 build/C/man2/capget.2:218 build/C/man7/credentials.7:287 build/C/man2/getgid.2:44 build/C/man2/getgroups.2:133 build/C/man2/getpid.2:46 build/C/man2/getpriority.2:157 build/C/man2/getresuid.2:67 build/C/man2/getrlimit.2:511 build/C/man2/getrusage.2:202 build/C/man2/getsid.2:79 build/C/man2/getuid.2:45 build/C/man3/group_member.3:55 build/C/man2/iopl.2:87 build/C/man2/ioprio_set.2:196 build/C/man2/ipc.2:45 build/C/man7/namespaces.7:359 build/C/man7/pid_namespaces.7:351 build/C/man2/seteuid.2:99 build/C/man2/setfsgid.2:75 build/C/man2/setfsuid.2:75 build/C/man2/setgid.2:71 build/C/man2/setpgid.2:250 build/C/man2/setresuid.2:109 build/C/man2/setreuid.2:148 build/C/man2/setsid.2:68 build/C/man2/setuid.2:117 build/C/man3/ulimit.3:78 build/C/man7/user_namespaces.7:645 build/C/man2/seccomp.2:435
281 #, no-wrap
282 msgid "CONFORMING TO"
283 msgstr ""
284
285 #.  SVr4 documents an EBUSY error condition, but no EISDIR or ENOSYS.
286 #.  Also AIX and HP-UX document EBUSY (attempt is made
287 #.  to enable accounting when it is already enabled), as does Solaris
288 #.  (attempt is made to enable accounting using the same file that is
289 #.  currently being used).
290 #. type: Plain text
291 #: build/C/man2/acct.2:137
292 msgid "SVr4, 4.3BSD (but not POSIX)."
293 msgstr ""
294
295 #. type: SH
296 #: build/C/man2/acct.2:137 build/C/man5/acct.5:157 build/C/man7/capabilities.7:1126 build/C/man2/capget.2:220 build/C/man7/cpuset.7:1341 build/C/man7/credentials.7:293 build/C/man2/getgid.2:46 build/C/man2/getgroups.2:141 build/C/man2/getpid.2:48 build/C/man2/getpriority.2:160 build/C/man2/getresuid.2:70 build/C/man2/getrlimit.2:534 build/C/man2/getrusage.2:213 build/C/man2/getsid.2:81 build/C/man2/getuid.2:47 build/C/man2/iopl.2:91 build/C/man2/ioprio_set.2:198 build/C/man2/ipc.2:49 build/C/man2/seteuid.2:101 build/C/man2/setfsgid.2:79 build/C/man2/setfsuid.2:79 build/C/man2/setgid.2:73 build/C/man2/setpgid.2:272 build/C/man2/setresuid.2:112 build/C/man2/setreuid.2:154 build/C/man2/setsid.2:70 build/C/man2/setuid.2:122 build/C/man7/user_namespaces.7:648 build/C/man2/seccomp.2:439
297 #, no-wrap
298 msgid "NOTES"
299 msgstr ""
300
301 #. type: Plain text
302 #: build/C/man2/acct.2:140
303 msgid ""
304 "No accounting is produced for programs running when a system crash occurs.  "
305 "In particular, nonterminating processes are never accounted for."
306 msgstr ""
307
308 #. type: Plain text
309 #: build/C/man2/acct.2:143
310 msgid ""
311 "The structure of the records written to the accounting file is described in "
312 "B<acct>(5)."
313 msgstr ""
314
315 #. type: SH
316 #: build/C/man2/acct.2:143 build/C/man5/acct.5:174 build/C/man7/capabilities.7:1183 build/C/man2/capget.2:228 build/C/man7/cpuset.7:1488 build/C/man7/credentials.7:304 build/C/man2/getgid.2:62 build/C/man2/getgroups.2:178 build/C/man2/getpid.2:100 build/C/man2/getpriority.2:232 build/C/man2/getresuid.2:86 build/C/man2/getrlimit.2:766 build/C/man2/getrusage.2:253 build/C/man2/getsid.2:84 build/C/man2/getuid.2:73 build/C/man3/group_member.3:57 build/C/man2/iopl.2:100 build/C/man2/ioprio_set.2:346 build/C/man2/ipc.2:57 build/C/man7/namespaces.7:364 build/C/man7/pid_namespaces.7:356 build/C/man2/seteuid.2:141 build/C/man2/setfsgid.2:123 build/C/man2/setfsuid.2:131 build/C/man2/setgid.2:83 build/C/man2/setpgid.2:340 build/C/man2/setresuid.2:132 build/C/man2/setreuid.2:194 build/C/man2/setsid.2:93 build/C/man2/setuid.2:145 build/C/man7/svipc.7:335 build/C/man3/ulimit.3:83 build/C/man7/user_namespaces.7:1011 build/C/man2/seccomp.2:662
317 #, no-wrap
318 msgid "SEE ALSO"
319 msgstr ""
320
321 #. type: Plain text
322 #: build/C/man2/acct.2:145
323 msgid "B<acct>(5)"
324 msgstr ""
325
326 #. type: SH
327 #: build/C/man2/acct.2:145 build/C/man5/acct.5:179 build/C/man7/capabilities.7:1205 build/C/man2/capget.2:232 build/C/man7/cpuset.7:1506 build/C/man7/credentials.7:340 build/C/man2/getgid.2:67 build/C/man2/getgroups.2:186 build/C/man2/getpid.2:111 build/C/man2/getpriority.2:241 build/C/man2/getresuid.2:92 build/C/man2/getrlimit.2:784 build/C/man2/getrusage.2:260 build/C/man2/getsid.2:88 build/C/man2/getuid.2:78 build/C/man3/group_member.3:62 build/C/man2/iopl.2:104 build/C/man2/ioprio_set.2:354 build/C/man2/ipc.2:70 build/C/man7/namespaces.7:377 build/C/man7/pid_namespaces.7:365 build/C/man2/seteuid.2:149 build/C/man2/setfsgid.2:128 build/C/man2/setfsuid.2:136 build/C/man2/setgid.2:90 build/C/man2/setpgid.2:347 build/C/man2/setresuid.2:142 build/C/man2/setreuid.2:203 build/C/man2/setsid.2:100 build/C/man2/setuid.2:153 build/C/man7/svipc.7:353 build/C/man3/ulimit.3:88 build/C/man7/user_namespaces.7:1027 build/C/man2/seccomp.2:679
328 #, no-wrap
329 msgid "COLOPHON"
330 msgstr ""
331
332 #. type: Plain text
333 #: build/C/man2/acct.2:153 build/C/man5/acct.5:187 build/C/man7/capabilities.7:1213 build/C/man2/capget.2:240 build/C/man7/cpuset.7:1514 build/C/man7/credentials.7:348 build/C/man2/getgid.2:75 build/C/man2/getgroups.2:194 build/C/man2/getpid.2:119 build/C/man2/getpriority.2:249 build/C/man2/getresuid.2:100 build/C/man2/getrlimit.2:792 build/C/man2/getrusage.2:268 build/C/man2/getsid.2:96 build/C/man2/getuid.2:86 build/C/man3/group_member.3:70 build/C/man2/iopl.2:112 build/C/man2/ioprio_set.2:362 build/C/man2/ipc.2:78 build/C/man7/namespaces.7:385 build/C/man7/pid_namespaces.7:373 build/C/man2/seteuid.2:157 build/C/man2/setfsgid.2:136 build/C/man2/setfsuid.2:144 build/C/man2/setgid.2:98 build/C/man2/setpgid.2:355 build/C/man2/setresuid.2:150 build/C/man2/setreuid.2:211 build/C/man2/setsid.2:108 build/C/man2/setuid.2:161 build/C/man7/svipc.7:361 build/C/man3/ulimit.3:96 build/C/man7/user_namespaces.7:1035 build/C/man2/seccomp.2:687
334 msgid ""
335 "This page is part of release 3.78 of the Linux I<man-pages> project.  A "
336 "description of the project, information about reporting bugs, and the latest "
337 "version of this page, can be found at "
338 "\\%http://www.kernel.org/doc/man-pages/."
339 msgstr ""
340
341 #. type: TH
342 #: build/C/man5/acct.5:25
343 #, no-wrap
344 msgid "2008-06-15"
345 msgstr ""
346
347 #. type: Plain text
348 #: build/C/man5/acct.5:28
349 msgid "acct - process accounting file"
350 msgstr ""
351
352 #. type: Plain text
353 #: build/C/man5/acct.5:30
354 msgid "B<#include E<lt>sys/acct.hE<gt>>"
355 msgstr ""
356
357 #. type: Plain text
358 #: build/C/man5/acct.5:36
359 msgid ""
360 "If the kernel is built with the process accounting option enabled "
361 "(B<CONFIG_BSD_PROCESS_ACCT>), then calling B<acct>(2)  starts process "
362 "accounting, for example:"
363 msgstr ""
364
365 #. type: Plain text
366 #: build/C/man5/acct.5:39
367 msgid "acct(\"/var/log/pacct\");"
368 msgstr ""
369
370 #. type: Plain text
371 #: build/C/man5/acct.5:47
372 msgid ""
373 "When process accounting is enabled, the kernel writes a record to the "
374 "accounting file as each process on the system terminates.  This record "
375 "contains information about the terminated process, and is defined in "
376 "I<E<lt>sys/acct.hE<gt>> as follows:"
377 msgstr ""
378
379 #. type: Plain text
380 #: build/C/man5/acct.5:51
381 #, no-wrap
382 msgid "#define ACCT_COMM 16\n"
383 msgstr ""
384
385 #. type: Plain text
386 #: build/C/man5/acct.5:53
387 #, no-wrap
388 msgid "typedef u_int16_t comp_t;\n"
389 msgstr ""
390
391 #. type: Plain text
392 #: build/C/man5/acct.5:77
393 #, no-wrap
394 msgid ""
395 "struct acct {\n"
396 "    char ac_flag;           /* Accounting flags */\n"
397 "    u_int16_t ac_uid;       /* Accounting user ID */\n"
398 "    u_int16_t ac_gid;       /* Accounting group ID */\n"
399 "    u_int16_t ac_tty;       /* Controlling terminal */\n"
400 "    u_int32_t ac_btime;     /* Process creation time\n"
401 "                               (seconds since the Epoch) */\n"
402 "    comp_t    ac_utime;     /* User CPU time */\n"
403 "    comp_t    ac_stime;     /* System CPU time */\n"
404 "    comp_t    ac_etime;     /* Elapsed time */\n"
405 "    comp_t    ac_mem;       /* Average memory usage (kB) */\n"
406 "    comp_t    ac_io;        /* Characters transferred (unused) */\n"
407 "    comp_t    ac_rw;        /* Blocks read or written (unused) */\n"
408 "    comp_t    ac_minflt;    /* Minor page faults */\n"
409 "    comp_t    ac_majflt;    /* Major page faults */\n"
410 "    comp_t    ac_swaps;     /* Number of swaps (unused) */\n"
411 "    u_int32_t ac_exitcode;  /* Process termination status\n"
412 "                               (see wait(2)) */\n"
413 "    char      ac_comm[ACCT_COMM+1];\n"
414 "                            /* Command name (basename of last\n"
415 "                               executed command; null-terminated) */\n"
416 "    char      ac_pad[I<X>];    /* padding bytes */\n"
417 "};\n"
418 msgstr ""
419
420 #. type: Plain text
421 #: build/C/man5/acct.5:84
422 #, no-wrap
423 msgid ""
424 "enum {          /* Bits that may be set in ac_flag field */\n"
425 "    AFORK = 0x01,           /* Has executed fork, but no exec */\n"
426 "    ASU   = 0x02,           /* Used superuser privileges */\n"
427 "    ACORE = 0x08,           /* Dumped core */\n"
428 "    AXSIG = 0x10            /* Killed by a signal */\n"
429 "};\n"
430 msgstr ""
431
432 #. type: Plain text
433 #: build/C/man5/acct.5:94
434 msgid ""
435 "The I<comp_t> data type is a floating-point value consisting of a 3-bit, "
436 "base-8 exponent, and a 13-bit mantissa.  A value, I<c>, of this type can be "
437 "converted to a (long) integer as follows:"
438 msgstr ""
439
440 #. type: Plain text
441 #: build/C/man5/acct.5:97
442 #, no-wrap
443 msgid "    v = (c & 0x1fff) E<lt>E<lt> (((c E<gt>E<gt> 13) & 0x7) * 3);\n"
444 msgstr ""
445
446 #. type: Plain text
447 #: build/C/man5/acct.5:107
448 msgid ""
449 "The I<ac_utime>, I<ac_stime>, and I<ac_etime> fields measure time in \"clock "
450 "ticks\"; divide these values by I<sysconf(_SC_CLK_TCK)> to convert them to "
451 "seconds."
452 msgstr ""
453
454 #. type: SS
455 #: build/C/man5/acct.5:107
456 #, no-wrap
457 msgid "Version 3 accounting file format"
458 msgstr ""
459
460 #. type: Plain text
461 #: build/C/man5/acct.5:122
462 msgid ""
463 "Since kernel 2.6.8, an optional alternative version of the accounting file "
464 "can be produced if the B<CONFIG_BSD_PROCESS_ACCT_V3> option is set when "
465 "building the kernel.  With this option is set, the records written to the "
466 "accounting file contain additional fields, and the width of I<c_uid> and "
467 "I<ac_gid> fields is widened from 16 to 32 bits (in line with the increased "
468 "size of UID and GIDs in Linux 2.4 and later).  The records are defined as "
469 "follows:"
470 msgstr ""
471
472 #. type: Plain text
473 #: build/C/man5/acct.5:147
474 #, no-wrap
475 msgid ""
476 "struct acct_v3 {\n"
477 "    char      ac_flag;      /* Flags */\n"
478 "    char      ac_version;   /* Always set to ACCT_VERSION (3) */\n"
479 "    u_int16_t ac_tty;       /* Controlling terminal */\n"
480 "    u_int32_t ac_exitcode;  /* Process termination status */\n"
481 "    u_int32_t ac_uid;       /* Real user ID */\n"
482 "    u_int32_t ac_gid;       /* Real group ID */\n"
483 "    u_int32_t ac_pid;       /* Process ID */\n"
484 "    u_int32_t ac_ppid;      /* Parent process ID */\n"
485 "    u_int32_t ac_btime;     /* Process creation time */\n"
486 "    float     ac_etime;     /* Elapsed time */\n"
487 "    comp_t    ac_utime;     /* User CPU time */\n"
488 "    comp_t    ac_stime;     /* System time */\n"
489 "    comp_t    ac_mem;       /* Average memory usage (kB) */\n"
490 "    comp_t    ac_io;        /* Characters transferred (unused) */\n"
491 "    comp_t    ac_rw;        /* Blocks read or written\n"
492 "                               (unused) */\n"
493 "    comp_t    ac_minflt;    /* Minor page faults */\n"
494 "    comp_t    ac_majflt;    /* Major page faults */\n"
495 "    comp_t    ac_swaps;     /* Number of swaps (unused) */\n"
496 "    char      ac_comm[ACCT_COMM]; /* Command name */\n"
497 "};\n"
498 msgstr ""
499
500 #. type: SH
501 #: build/C/man5/acct.5:149 build/C/man7/cpuset.7:1338 build/C/man2/getresuid.2:60 build/C/man2/getrlimit.2:506 build/C/man2/getsid.2:75 build/C/man2/ioprio_set.2:193 build/C/man2/setfsgid.2:71 build/C/man2/setfsuid.2:71 build/C/man2/setresuid.2:107 build/C/man2/seccomp.2:430
502 #, no-wrap
503 msgid "VERSIONS"
504 msgstr ""
505
506 #. type: Plain text
507 #: build/C/man5/acct.5:153
508 msgid "The I<acct_v3> structure is defined in glibc since version 2.6."
509 msgstr ""
510
511 #. type: Plain text
512 #: build/C/man5/acct.5:157
513 msgid ""
514 "Process accounting originated on BSD.  Although it is present on most "
515 "systems, it is not standardized, and the details vary somewhat between "
516 "systems."
517 msgstr ""
518
519 #. type: Plain text
520 #: build/C/man5/acct.5:160
521 msgid ""
522 "Records in the accounting file are ordered by termination time of the "
523 "process."
524 msgstr ""
525
526 #. type: Plain text
527 #: build/C/man5/acct.5:167
528 msgid ""
529 "In kernels up to and including 2.6.9, a separate accounting record is "
530 "written for each thread created using the NPTL threading library; since "
531 "Linux 2.6.10, a single accounting record is written for the entire process "
532 "on termination of the last thread in the process."
533 msgstr ""
534
535 #. type: Plain text
536 #: build/C/man5/acct.5:174
537 msgid ""
538 "The I<proc/sys/kernel/acct> file, described in B<proc>(5), defines settings "
539 "that control the behavior of process accounting when disk space runs low."
540 msgstr ""
541
542 #. type: Plain text
543 #: build/C/man5/acct.5:179
544 msgid "B<lastcomm>(1), B<acct>(2), B<accton>(8), B<sa>(8)"
545 msgstr ""
546
547 #. type: TH
548 #: build/C/man7/capabilities.7:48
549 #, no-wrap
550 msgid "CAPABILITIES"
551 msgstr ""
552
553 #. type: TH
554 #: build/C/man7/capabilities.7:48 build/C/man2/getpid.2:25 build/C/man7/namespaces.7:27 build/C/man2/seteuid.2:29 build/C/man2/setgid.2:29 build/C/man2/setresuid.2:26 build/C/man2/setreuid.2:45 build/C/man2/setuid.2:30 build/C/man7/svipc.7:40 build/C/man7/user_namespaces.7:27
555 #, no-wrap
556 msgid "2014-09-21"
557 msgstr ""
558
559 #. type: Plain text
560 #: build/C/man7/capabilities.7:51
561 msgid "capabilities - overview of Linux capabilities"
562 msgstr ""
563
564 #. type: Plain text
565 #: build/C/man7/capabilities.7:63
566 msgid ""
567 "For the purpose of performing permission checks, traditional UNIX "
568 "implementations distinguish two categories of processes: I<privileged> "
569 "processes (whose effective user ID is 0, referred to as superuser or root), "
570 "and I<unprivileged> processes (whose effective UID is nonzero).  Privileged "
571 "processes bypass all kernel permission checks, while unprivileged processes "
572 "are subject to full permission checking based on the process's credentials "
573 "(usually: effective UID, effective GID, and supplementary group list)."
574 msgstr ""
575
576 #. type: Plain text
577 #: build/C/man7/capabilities.7:70
578 msgid ""
579 "Starting with kernel 2.2, Linux divides the privileges traditionally "
580 "associated with superuser into distinct units, known as I<capabilities>, "
581 "which can be independently enabled and disabled.  Capabilities are a "
582 "per-thread attribute."
583 msgstr ""
584
585 #. type: SS
586 #: build/C/man7/capabilities.7:70
587 #, no-wrap
588 msgid "Capabilities list"
589 msgstr ""
590
591 #. type: Plain text
592 #: build/C/man7/capabilities.7:73
593 msgid ""
594 "The following list shows the capabilities implemented on Linux, and the "
595 "operations or behaviors that each capability permits:"
596 msgstr ""
597
598 #. type: TP
599 #: build/C/man7/capabilities.7:73
600 #, no-wrap
601 msgid "B<CAP_AUDIT_CONTROL> (since Linux 2.6.11)"
602 msgstr ""
603
604 #. type: Plain text
605 #: build/C/man7/capabilities.7:77
606 msgid ""
607 "Enable and disable kernel auditing; change auditing filter rules; retrieve "
608 "auditing status and filtering rules."
609 msgstr ""
610
611 #. type: TP
612 #: build/C/man7/capabilities.7:77
613 #, no-wrap
614 msgid "B<CAP_AUDIT_READ> (since Linux 3.16)"
615 msgstr ""
616
617 #.  commit a29b694aa1739f9d76538e34ae25524f9c549d59
618 #.  commit 3a101b8de0d39403b2c7e5c23fd0b005668acf48
619 #. type: Plain text
620 #: build/C/man7/capabilities.7:82
621 msgid "Allow reading the audit log via a multicast netlink socket."
622 msgstr ""
623
624 #. type: TP
625 #: build/C/man7/capabilities.7:82
626 #, no-wrap
627 msgid "B<CAP_AUDIT_WRITE> (since Linux 2.6.11)"
628 msgstr ""
629
630 #. type: Plain text
631 #: build/C/man7/capabilities.7:85
632 msgid "Write records to kernel auditing log."
633 msgstr ""
634
635 #. type: TP
636 #: build/C/man7/capabilities.7:85
637 #, no-wrap
638 msgid "B<CAP_BLOCK_SUSPEND> (since Linux 3.5)"
639 msgstr ""
640
641 #. type: Plain text
642 #: build/C/man7/capabilities.7:91
643 msgid ""
644 "Employ features that can block system suspend (B<epoll>(7)  B<EPOLLWAKEUP>, "
645 "I</proc/sys/wake_lock>)."
646 msgstr ""
647
648 #. type: TP
649 #: build/C/man7/capabilities.7:91
650 #, no-wrap
651 msgid "B<CAP_CHOWN>"
652 msgstr ""
653
654 #. type: Plain text
655 #: build/C/man7/capabilities.7:95
656 msgid "Make arbitrary changes to file UIDs and GIDs (see B<chown>(2))."
657 msgstr ""
658
659 #. type: TP
660 #: build/C/man7/capabilities.7:95
661 #, no-wrap
662 msgid "B<CAP_DAC_OVERRIDE>"
663 msgstr ""
664
665 #. type: Plain text
666 #: build/C/man7/capabilities.7:99
667 msgid ""
668 "Bypass file read, write, and execute permission checks.  (DAC is an "
669 "abbreviation of \"discretionary access control\".)"
670 msgstr ""
671
672 #. type: TP
673 #: build/C/man7/capabilities.7:99
674 #, no-wrap
675 msgid "B<CAP_DAC_READ_SEARCH>"
676 msgstr ""
677
678 #. type: IP
679 #: build/C/man7/capabilities.7:103 build/C/man7/capabilities.7:106 build/C/man7/capabilities.7:116 build/C/man7/capabilities.7:126 build/C/man7/capabilities.7:130 build/C/man7/capabilities.7:132 build/C/man7/capabilities.7:134 build/C/man7/capabilities.7:204 build/C/man7/capabilities.7:206 build/C/man7/capabilities.7:208 build/C/man7/capabilities.7:210 build/C/man7/capabilities.7:212 build/C/man7/capabilities.7:214 build/C/man7/capabilities.7:216 build/C/man7/capabilities.7:218 build/C/man7/capabilities.7:220 build/C/man7/capabilities.7:244 build/C/man7/capabilities.7:246 build/C/man7/capabilities.7:296 build/C/man7/capabilities.7:306 build/C/man7/capabilities.7:312 build/C/man7/capabilities.7:317 build/C/man7/capabilities.7:323 build/C/man7/capabilities.7:327 build/C/man7/capabilities.7:334 build/C/man7/capabilities.7:337 build/C/man7/capabilities.7:345 build/C/man7/capabilities.7:347 build/C/man7/capabilities.7:356 build/C/man7/capabilities.7:365 build/C/man7/capabilities.7:368 build/C/man7/capabilities.7:372 build/C/man7/capabilities.7:380 build/C/man7/capabilities.7:383 build/C/man7/capabilities.7:390 build/C/man7/capabilities.7:395 build/C/man7/capabilities.7:401 build/C/man7/capabilities.7:405 build/C/man7/capabilities.7:409 build/C/man7/capabilities.7:413 build/C/man7/capabilities.7:417 build/C/man7/capabilities.7:444 build/C/man7/capabilities.7:449 build/C/man7/capabilities.7:455 build/C/man7/capabilities.7:458 build/C/man7/capabilities.7:461 build/C/man7/capabilities.7:471 build/C/man7/capabilities.7:475 build/C/man7/capabilities.7:492 build/C/man7/capabilities.7:495 build/C/man7/capabilities.7:499 build/C/man7/capabilities.7:504 build/C/man7/capabilities.7:513 build/C/man7/capabilities.7:518 build/C/man7/capabilities.7:521 build/C/man7/capabilities.7:526 build/C/man7/capabilities.7:529 build/C/man7/capabilities.7:532 build/C/man7/capabilities.7:535 build/C/man7/capabilities.7:538 build/C/man7/capabilities.7:543 build/C/man7/capabilities.7:545 build/C/man7/capabilities.7:551 build/C/man7/capabilities.7:559 build/C/man7/capabilities.7:561 build/C/man7/capabilities.7:565 build/C/man7/capabilities.7:567 build/C/man7/capabilities.7:570 build/C/man7/capabilities.7:574 build/C/man7/capabilities.7:576 build/C/man7/capabilities.7:578 build/C/man7/capabilities.7:580 build/C/man7/capabilities.7:589 build/C/man7/capabilities.7:596 build/C/man7/capabilities.7:601 build/C/man7/capabilities.7:606 build/C/man7/capabilities.7:611 build/C/man7/capabilities.7:636 build/C/man7/capabilities.7:643 build/C/man7/capabilities.7:844 build/C/man7/capabilities.7:852 build/C/man7/capabilities.7:1172 build/C/man7/capabilities.7:1177 build/C/man7/cpuset.7:540 build/C/man7/cpuset.7:545 build/C/man7/cpuset.7:550 build/C/man7/cpuset.7:726 build/C/man7/cpuset.7:730 build/C/man7/cpuset.7:927 build/C/man7/cpuset.7:930 build/C/man7/cpuset.7:934 build/C/man7/cpuset.7:938 build/C/man7/cpuset.7:942 build/C/man7/credentials.7:177 build/C/man7/credentials.7:183 build/C/man7/credentials.7:195 build/C/man7/credentials.7:217 build/C/man7/credentials.7:234 build/C/man7/credentials.7:266 build/C/man7/credentials.7:269 build/C/man7/credentials.7:280 build/C/man7/credentials.7:283 build/C/man2/getrlimit.2:690 build/C/man2/getrlimit.2:693 build/C/man7/namespaces.7:212 build/C/man7/namespaces.7:215 build/C/man7/namespaces.7:228 build/C/man7/pid_namespaces.7:233 build/C/man7/pid_namespaces.7:241 build/C/man7/pid_namespaces.7:252 build/C/man7/user_namespaces.7:261 build/C/man7/user_namespaces.7:266 build/C/man7/user_namespaces.7:272 build/C/man7/user_namespaces.7:285 build/C/man7/user_namespaces.7:306 build/C/man7/user_namespaces.7:474 build/C/man7/user_namespaces.7:477 build/C/man7/user_namespaces.7:479 build/C/man7/user_namespaces.7:492 build/C/man7/user_namespaces.7:505 build/C/man7/user_namespaces.7:532 build/C/man7/user_namespaces.7:541 build/C/man2/seccomp.2:265 build/C/man2/seccomp.2:269 build/C/man2/seccomp.2:272 build/C/man2/seccomp.2:277 build/C/man2/seccomp.2:281 build/C/man2/seccomp.2:455 build/C/man2/seccomp.2:463 build/C/man2/seccomp.2:469
680 #, no-wrap
681 msgid "*"
682 msgstr ""
683
684 #. type: Plain text
685 #: build/C/man7/capabilities.7:106
686 msgid ""
687 "Bypass file read permission checks and directory read and execute permission "
688 "checks;"
689 msgstr ""
690
691 #. type: Plain text
692 #: build/C/man7/capabilities.7:109
693 msgid "Invoke B<open_by_handle_at>(2)."
694 msgstr ""
695
696 #. type: TP
697 #: build/C/man7/capabilities.7:112
698 #, no-wrap
699 msgid "B<CAP_FOWNER>"
700 msgstr ""
701
702 #. type: Plain text
703 #: build/C/man7/capabilities.7:126
704 msgid ""
705 "Bypass permission checks on operations that normally require the filesystem "
706 "UID of the process to match the UID of the file (e.g., B<chmod>(2), "
707 "B<utime>(2)), excluding those operations covered by B<CAP_DAC_OVERRIDE> and "
708 "B<CAP_DAC_READ_SEARCH>;"
709 msgstr ""
710
711 #. type: Plain text
712 #: build/C/man7/capabilities.7:130
713 msgid "set extended file attributes (see B<chattr>(1))  on arbitrary files;"
714 msgstr ""
715
716 #. type: Plain text
717 #: build/C/man7/capabilities.7:132
718 msgid "set Access Control Lists (ACLs) on arbitrary files;"
719 msgstr ""
720
721 #. type: Plain text
722 #: build/C/man7/capabilities.7:134
723 msgid "ignore directory sticky bit on file deletion;"
724 msgstr ""
725
726 #. type: Plain text
727 #: build/C/man7/capabilities.7:141
728 msgid "specify B<O_NOATIME> for arbitrary files in B<open>(2)  and B<fcntl>(2)."
729 msgstr ""
730
731 #. type: TP
732 #: build/C/man7/capabilities.7:143
733 #, no-wrap
734 msgid "B<CAP_FSETID>"
735 msgstr ""
736
737 #. type: Plain text
738 #: build/C/man7/capabilities.7:149
739 msgid ""
740 "Don't clear set-user-ID and set-group-ID permission bits when a file is "
741 "modified; set the set-group-ID bit for a file whose GID does not match the "
742 "filesystem or any of the supplementary GIDs of the calling process."
743 msgstr ""
744
745 #. type: TP
746 #: build/C/man7/capabilities.7:149
747 #, no-wrap
748 msgid "B<CAP_IPC_LOCK>"
749 msgstr ""
750
751 #.  FIXME . As at Linux 3.2, there are some strange uses of this capability
752 #.  in other places; they probably should be replaced with something else.
753 #. type: Plain text
754 #: build/C/man7/capabilities.7:158
755 msgid "Lock memory (B<mlock>(2), B<mlockall>(2), B<mmap>(2), B<shmctl>(2))."
756 msgstr ""
757
758 #. type: TP
759 #: build/C/man7/capabilities.7:158
760 #, no-wrap
761 msgid "B<CAP_IPC_OWNER>"
762 msgstr ""
763
764 #. type: Plain text
765 #: build/C/man7/capabilities.7:161
766 msgid "Bypass permission checks for operations on System V IPC objects."
767 msgstr ""
768
769 #. type: TP
770 #: build/C/man7/capabilities.7:161
771 #, no-wrap
772 msgid "B<CAP_KILL>"
773 msgstr ""
774
775 #.  FIXME . CAP_KILL also has an effect for threads + setting child
776 #.        termination signal to other than SIGCHLD: without this
777 #.        capability, the termination signal reverts to SIGCHLD
778 #.        if the child does an exec().  What is the rationale
779 #.        for this?
780 #. type: Plain text
781 #: build/C/man7/capabilities.7:174
782 msgid ""
783 "Bypass permission checks for sending signals (see B<kill>(2)).  This "
784 "includes use of the B<ioctl>(2)  B<KDSIGACCEPT> operation."
785 msgstr ""
786
787 #. type: TP
788 #: build/C/man7/capabilities.7:174
789 #, no-wrap
790 msgid "B<CAP_LEASE> (since Linux 2.4)"
791 msgstr ""
792
793 #. type: Plain text
794 #: build/C/man7/capabilities.7:178
795 msgid "Establish leases on arbitrary files (see B<fcntl>(2))."
796 msgstr ""
797
798 #. type: TP
799 #: build/C/man7/capabilities.7:178
800 #, no-wrap
801 msgid "B<CAP_LINUX_IMMUTABLE>"
802 msgstr ""
803
804 #.  These attributes are now available on ext2, ext3, Reiserfs, XFS, JFS
805 #. type: Plain text
806 #: build/C/man7/capabilities.7:187
807 msgid ""
808 "Set the B<FS_APPEND_FL> and B<FS_IMMUTABLE_FL> inode flags (see "
809 "B<chattr>(1))."
810 msgstr ""
811
812 #. type: TP
813 #: build/C/man7/capabilities.7:187
814 #, no-wrap
815 msgid "B<CAP_MAC_ADMIN> (since Linux 2.6.25)"
816 msgstr ""
817
818 #. type: Plain text
819 #: build/C/man7/capabilities.7:191
820 msgid ""
821 "Override Mandatory Access Control (MAC).  Implemented for the Smack Linux "
822 "Security Module (LSM)."
823 msgstr ""
824
825 #. type: TP
826 #: build/C/man7/capabilities.7:191
827 #, no-wrap
828 msgid "B<CAP_MAC_OVERRIDE> (since Linux 2.6.25)"
829 msgstr ""
830
831 #. type: Plain text
832 #: build/C/man7/capabilities.7:195
833 msgid "Allow MAC configuration or state changes.  Implemented for the Smack LSM."
834 msgstr ""
835
836 #. type: TP
837 #: build/C/man7/capabilities.7:195
838 #, no-wrap
839 msgid "B<CAP_MKNOD> (since Linux 2.4)"
840 msgstr ""
841
842 #. type: Plain text
843 #: build/C/man7/capabilities.7:199
844 msgid "Create special files using B<mknod>(2)."
845 msgstr ""
846
847 #. type: TP
848 #: build/C/man7/capabilities.7:199
849 #, no-wrap
850 msgid "B<CAP_NET_ADMIN>"
851 msgstr ""
852
853 #. type: Plain text
854 #: build/C/man7/capabilities.7:202
855 msgid "Perform various network-related operations:"
856 msgstr ""
857
858 #. type: Plain text
859 #: build/C/man7/capabilities.7:206
860 msgid "interface configuration;"
861 msgstr ""
862
863 #. type: Plain text
864 #: build/C/man7/capabilities.7:208
865 msgid "administration of IP firewall, masquerading, and accounting;"
866 msgstr ""
867
868 #. type: Plain text
869 #: build/C/man7/capabilities.7:210
870 msgid "modify routing tables;"
871 msgstr ""
872
873 #. type: Plain text
874 #: build/C/man7/capabilities.7:212
875 msgid "bind to any address for transparent proxying;"
876 msgstr ""
877
878 #. type: Plain text
879 #: build/C/man7/capabilities.7:214
880 msgid "set type-of-service (TOS)"
881 msgstr ""
882
883 #. type: Plain text
884 #: build/C/man7/capabilities.7:216
885 msgid "clear driver statistics;"
886 msgstr ""
887
888 #. type: Plain text
889 #: build/C/man7/capabilities.7:218
890 msgid "set promiscuous mode;"
891 msgstr ""
892
893 #. type: Plain text
894 #: build/C/man7/capabilities.7:220
895 msgid "enabling multicasting;"
896 msgstr ""
897
898 #. type: Plain text
899 #: build/C/man7/capabilities.7:231
900 msgid ""
901 "use B<setsockopt>(2)  to set the following socket options: B<SO_DEBUG>, "
902 "B<SO_MARK>, B<SO_PRIORITY> (for a priority outside the range 0 to 6), "
903 "B<SO_RCVBUFFORCE>, and B<SO_SNDBUFFORCE>."
904 msgstr ""
905
906 #. type: TP
907 #: build/C/man7/capabilities.7:233
908 #, no-wrap
909 msgid "B<CAP_NET_BIND_SERVICE>"
910 msgstr ""
911
912 #. type: Plain text
913 #: build/C/man7/capabilities.7:237
914 msgid ""
915 "Bind a socket to Internet domain privileged ports (port numbers less than "
916 "1024)."
917 msgstr ""
918
919 #. type: TP
920 #: build/C/man7/capabilities.7:237
921 #, no-wrap
922 msgid "B<CAP_NET_BROADCAST>"
923 msgstr ""
924
925 #. type: Plain text
926 #: build/C/man7/capabilities.7:240
927 msgid "(Unused)  Make socket broadcasts, and listen to multicasts."
928 msgstr ""
929
930 #. type: TP
931 #: build/C/man7/capabilities.7:240
932 #, no-wrap
933 msgid "B<CAP_NET_RAW>"
934 msgstr ""
935
936 #. type: Plain text
937 #: build/C/man7/capabilities.7:246
938 msgid "use RAW and PACKET sockets;"
939 msgstr ""
940
941 #. type: Plain text
942 #: build/C/man7/capabilities.7:248
943 msgid "bind to any address for transparent proxying."
944 msgstr ""
945
946 #. type: TP
947 #: build/C/man7/capabilities.7:251
948 #, no-wrap
949 msgid "B<CAP_SETGID>"
950 msgstr ""
951
952 #. type: Plain text
953 #: build/C/man7/capabilities.7:257
954 msgid ""
955 "Make arbitrary manipulations of process GIDs and supplementary GID list; "
956 "forge GID when passing socket credentials via UNIX domain sockets; write a "
957 "group ID mapping in a user namespace (see B<user_namespaces>(7))."
958 msgstr ""
959
960 #. type: TP
961 #: build/C/man7/capabilities.7:257
962 #, no-wrap
963 msgid "B<CAP_SETFCAP> (since Linux 2.6.24)"
964 msgstr ""
965
966 #. type: Plain text
967 #: build/C/man7/capabilities.7:260
968 msgid "Set file capabilities."
969 msgstr ""
970
971 #. type: TP
972 #: build/C/man7/capabilities.7:260
973 #, no-wrap
974 msgid "B<CAP_SETPCAP>"
975 msgstr ""
976
977 #. type: Plain text
978 #: build/C/man7/capabilities.7:271
979 msgid ""
980 "If file capabilities are not supported: grant or remove any capability in "
981 "the caller's permitted capability set to or from any other process.  (This "
982 "property of B<CAP_SETPCAP> is not available when the kernel is configured to "
983 "support file capabilities, since B<CAP_SETPCAP> has entirely different "
984 "semantics for such kernels.)"
985 msgstr ""
986
987 #. type: Plain text
988 #: build/C/man7/capabilities.7:281
989 msgid ""
990 "If file capabilities are supported: add any capability from the calling "
991 "thread's bounding set to its inheritable set; drop capabilities from the "
992 "bounding set (via B<prctl>(2)  B<PR_CAPBSET_DROP>); make changes to the "
993 "I<securebits> flags."
994 msgstr ""
995
996 #. type: TP
997 #: build/C/man7/capabilities.7:281
998 #, no-wrap
999 msgid "B<CAP_SETUID>"
1000 msgstr ""
1001
1002 #.  FIXME CAP_SETUID also an effect in exec(); document this.
1003 #. type: Plain text
1004 #: build/C/man7/capabilities.7:292
1005 msgid ""
1006 "Make arbitrary manipulations of process UIDs (B<setuid>(2), B<setreuid>(2), "
1007 "B<setresuid>(2), B<setfsuid>(2)); forge UID when passing socket credentials "
1008 "via UNIX domain sockets; write a user ID mapping in a user namespace (see "
1009 "B<user_namespaces>(7))."
1010 msgstr ""
1011
1012 #. type: TP
1013 #: build/C/man7/capabilities.7:292
1014 #, no-wrap
1015 msgid "B<CAP_SYS_ADMIN>"
1016 msgstr ""
1017
1018 #. type: Plain text
1019 #: build/C/man7/capabilities.7:306
1020 msgid ""
1021 "Perform a range of system administration operations including: "
1022 "B<quotactl>(2), B<mount>(2), B<umount>(2), B<swapon>(2), B<swapoff>(2), "
1023 "B<sethostname>(2), and B<setdomainname>(2);"
1024 msgstr ""
1025
1026 #. type: Plain text
1027 #: build/C/man7/capabilities.7:312
1028 msgid ""
1029 "perform privileged B<syslog>(2)  operations (since Linux 2.6.37, "
1030 "B<CAP_SYSLOG> should be used to permit such operations);"
1031 msgstr ""
1032
1033 #. type: Plain text
1034 #: build/C/man7/capabilities.7:317
1035 msgid "perform B<VM86_REQUEST_IRQ> B<vm86>(2)  command;"
1036 msgstr ""
1037
1038 #. type: Plain text
1039 #: build/C/man7/capabilities.7:323
1040 msgid ""
1041 "perform B<IPC_SET> and B<IPC_RMID> operations on arbitrary System V IPC "
1042 "objects;"
1043 msgstr ""
1044
1045 #. type: Plain text
1046 #: build/C/man7/capabilities.7:327 build/C/man7/capabilities.7:574
1047 msgid "override B<RLIMIT_NPROC> resource limit;"
1048 msgstr ""
1049
1050 #. type: Plain text
1051 #: build/C/man7/capabilities.7:334
1052 msgid ""
1053 "perform operations on I<trusted> and I<security> Extended Attributes (see "
1054 "B<attr>(5));"
1055 msgstr ""
1056
1057 #. type: Plain text
1058 #: build/C/man7/capabilities.7:337
1059 msgid "use B<lookup_dcookie>(2);"
1060 msgstr ""
1061
1062 #. type: Plain text
1063 #: build/C/man7/capabilities.7:345
1064 msgid ""
1065 "use B<ioprio_set>(2)  to assign B<IOPRIO_CLASS_RT> and (before Linux 2.6.25)  "
1066 "B<IOPRIO_CLASS_IDLE> I/O scheduling classes;"
1067 msgstr ""
1068
1069 #. type: Plain text
1070 #: build/C/man7/capabilities.7:347
1071 msgid "forge PID when passing socket credentials via UNIX domain sockets;"
1072 msgstr ""
1073
1074 #. type: Plain text
1075 #: build/C/man7/capabilities.7:356
1076 msgid ""
1077 "exceed I</proc/sys/fs/file-max>, the system-wide limit on the number of open "
1078 "files, in system calls that open files (e.g., B<accept>(2), B<execve>(2), "
1079 "B<open>(2), B<pipe>(2));"
1080 msgstr ""
1081
1082 #. type: Plain text
1083 #: build/C/man7/capabilities.7:365
1084 msgid ""
1085 "employ B<CLONE_*> flags that create new namespaces with B<clone>(2)  and "
1086 "B<unshare>(2)  (but, since Linux 3.8, creating user namespaces does not "
1087 "require any capability);"
1088 msgstr ""
1089
1090 #. type: Plain text
1091 #: build/C/man7/capabilities.7:368
1092 msgid "call B<perf_event_open>(2);"
1093 msgstr ""
1094
1095 #. type: Plain text
1096 #: build/C/man7/capabilities.7:372
1097 msgid "access privileged I<perf> event information;"
1098 msgstr ""
1099
1100 #. type: Plain text
1101 #: build/C/man7/capabilities.7:380
1102 msgid "call B<setns>(2)  (requires B<CAP_SYS_ADMIN> in the I<target> namespace);"
1103 msgstr ""
1104
1105 #. type: Plain text
1106 #: build/C/man7/capabilities.7:383
1107 msgid "call B<fanotify_init>(2);"
1108 msgstr ""
1109
1110 #. type: Plain text
1111 #: build/C/man7/capabilities.7:390
1112 msgid "perform B<KEYCTL_CHOWN> and B<KEYCTL_SETPERM> B<keyctl>(2)  operations;"
1113 msgstr ""
1114
1115 #. type: Plain text
1116 #: build/C/man7/capabilities.7:395
1117 msgid "perform B<madvise>(2)  B<MADV_HWPOISON> operation;"
1118 msgstr ""
1119
1120 #. type: Plain text
1121 #: build/C/man7/capabilities.7:401
1122 msgid ""
1123 "employ the B<TIOCSTI> B<ioctl>(2)  to insert characters into the input queue "
1124 "of a terminal other than the caller's controlling terminal;"
1125 msgstr ""
1126
1127 #. type: Plain text
1128 #: build/C/man7/capabilities.7:405
1129 msgid "employ the obsolete B<nfsservctl>(2)  system call;"
1130 msgstr ""
1131
1132 #. type: Plain text
1133 #: build/C/man7/capabilities.7:409
1134 msgid "employ the obsolete B<bdflush>(2)  system call;"
1135 msgstr ""
1136
1137 #. type: Plain text
1138 #: build/C/man7/capabilities.7:413
1139 msgid "perform various privileged block-device B<ioctl>(2)  operations;"
1140 msgstr ""
1141
1142 #. type: Plain text
1143 #: build/C/man7/capabilities.7:417
1144 msgid "perform various privileged filesystem B<ioctl>(2)  operations;"
1145 msgstr ""
1146
1147 #. type: Plain text
1148 #: build/C/man7/capabilities.7:419
1149 msgid "perform administrative operations on many device drivers."
1150 msgstr ""
1151
1152 #. type: TP
1153 #: build/C/man7/capabilities.7:421
1154 #, no-wrap
1155 msgid "B<CAP_SYS_BOOT>"
1156 msgstr ""
1157
1158 #. type: Plain text
1159 #: build/C/man7/capabilities.7:427
1160 msgid "Use B<reboot>(2)  and B<kexec_load>(2)."
1161 msgstr ""
1162
1163 #. type: TP
1164 #: build/C/man7/capabilities.7:427
1165 #, no-wrap
1166 msgid "B<CAP_SYS_CHROOT>"
1167 msgstr ""
1168
1169 #. type: Plain text
1170 #: build/C/man7/capabilities.7:431
1171 msgid "Use B<chroot>(2)."
1172 msgstr ""
1173
1174 #. type: TP
1175 #: build/C/man7/capabilities.7:431
1176 #, no-wrap
1177 msgid "B<CAP_SYS_MODULE>"
1178 msgstr ""
1179
1180 #. type: Plain text
1181 #: build/C/man7/capabilities.7:440
1182 msgid ""
1183 "Load and unload kernel modules (see B<init_module>(2)  and "
1184 "B<delete_module>(2)); in kernels before 2.6.25: drop capabilities from the "
1185 "system-wide capability bounding set."
1186 msgstr ""
1187
1188 #. type: TP
1189 #: build/C/man7/capabilities.7:440
1190 #, no-wrap
1191 msgid "B<CAP_SYS_NICE>"
1192 msgstr ""
1193
1194 #. type: Plain text
1195 #: build/C/man7/capabilities.7:449
1196 msgid ""
1197 "Raise process nice value (B<nice>(2), B<setpriority>(2))  and change the "
1198 "nice value for arbitrary processes;"
1199 msgstr ""
1200
1201 #. type: Plain text
1202 #: build/C/man7/capabilities.7:455
1203 msgid ""
1204 "set real-time scheduling policies for calling process, and set scheduling "
1205 "policies and priorities for arbitrary processes (B<sched_setscheduler>(2), "
1206 "B<sched_setparam>(2), B<shed_setattr>(2));"
1207 msgstr ""
1208
1209 #. type: Plain text
1210 #: build/C/man7/capabilities.7:458
1211 msgid "set CPU affinity for arbitrary processes (B<sched_setaffinity>(2));"
1212 msgstr ""
1213
1214 #. type: Plain text
1215 #: build/C/man7/capabilities.7:461
1216 msgid ""
1217 "set I/O scheduling class and priority for arbitrary processes "
1218 "(B<ioprio_set>(2));"
1219 msgstr ""
1220
1221 #.  FIXME CAP_SYS_NICE also has the following effect for
1222 #.  migrate_pages(2):
1223 #.      do_migrate_pages(mm, &old, &new,
1224 #.          capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
1225 #.  Document this.
1226 #. type: Plain text
1227 #: build/C/man7/capabilities.7:471
1228 msgid ""
1229 "apply B<migrate_pages>(2)  to arbitrary processes and allow processes to be "
1230 "migrated to arbitrary nodes;"
1231 msgstr ""
1232
1233 #. type: Plain text
1234 #: build/C/man7/capabilities.7:475
1235 msgid "apply B<move_pages>(2)  to arbitrary processes;"
1236 msgstr ""
1237
1238 #. type: Plain text
1239 #: build/C/man7/capabilities.7:482
1240 msgid "use the B<MPOL_MF_MOVE_ALL> flag with B<mbind>(2)  and B<move_pages>(2)."
1241 msgstr ""
1242
1243 #. type: TP
1244 #: build/C/man7/capabilities.7:484
1245 #, no-wrap
1246 msgid "B<CAP_SYS_PACCT>"
1247 msgstr ""
1248
1249 #. type: Plain text
1250 #: build/C/man7/capabilities.7:488
1251 msgid "Use B<acct>(2)."
1252 msgstr ""
1253
1254 #. type: TP
1255 #: build/C/man7/capabilities.7:488
1256 #, no-wrap
1257 msgid "B<CAP_SYS_PTRACE>"
1258 msgstr ""
1259
1260 #. type: Plain text
1261 #: build/C/man7/capabilities.7:495
1262 msgid "Trace arbitrary processes using B<ptrace>(2);"
1263 msgstr ""
1264
1265 #. type: Plain text
1266 #: build/C/man7/capabilities.7:499
1267 msgid "apply B<get_robust_list>(2)  to arbitrary processes;"
1268 msgstr ""
1269
1270 #. type: Plain text
1271 #: build/C/man7/capabilities.7:504
1272 msgid ""
1273 "transfer data to or from the memory of arbitrary processes using "
1274 "B<process_vm_readv>(2)  and B<process_vm_writev>(2)."
1275 msgstr ""
1276
1277 #. type: Plain text
1278 #: build/C/man7/capabilities.7:507
1279 msgid "inspect processes using B<kcmp>(2)."
1280 msgstr ""
1281
1282 #. type: TP
1283 #: build/C/man7/capabilities.7:509
1284 #, no-wrap
1285 msgid "B<CAP_SYS_RAWIO>"
1286 msgstr ""
1287
1288 #. type: Plain text
1289 #: build/C/man7/capabilities.7:518
1290 msgid "Perform I/O port operations (B<iopl>(2)  and B<ioperm>(2));"
1291 msgstr ""
1292
1293 #. type: Plain text
1294 #: build/C/man7/capabilities.7:521
1295 msgid "access I</proc/kcore>;"
1296 msgstr ""
1297
1298 #. type: Plain text
1299 #: build/C/man7/capabilities.7:526
1300 msgid "employ the B<FIBMAP> B<ioctl>(2)  operation;"
1301 msgstr ""
1302
1303 #. type: Plain text
1304 #: build/C/man7/capabilities.7:529
1305 msgid ""
1306 "open devices for accessing x86 model-specific registers (MSRs, see "
1307 "B<msr>(4))"
1308 msgstr ""
1309
1310 #. type: Plain text
1311 #: build/C/man7/capabilities.7:532
1312 msgid "update I</proc/sys/vm/mmap_min_addr>;"
1313 msgstr ""
1314
1315 #. type: Plain text
1316 #: build/C/man7/capabilities.7:535
1317 msgid ""
1318 "create memory mappings at addresses below the value specified by "
1319 "I</proc/sys/vm/mmap_min_addr>;"
1320 msgstr ""
1321
1322 #. type: Plain text
1323 #: build/C/man7/capabilities.7:538
1324 msgid "map files in I</proc/bus/pci>;"
1325 msgstr ""
1326
1327 #. type: Plain text
1328 #: build/C/man7/capabilities.7:543
1329 msgid "open I</dev/mem> and I</dev/kmem>;"
1330 msgstr ""
1331
1332 #. type: Plain text
1333 #: build/C/man7/capabilities.7:545
1334 msgid "perform various SCSI device commands;"
1335 msgstr ""
1336
1337 #. type: Plain text
1338 #: build/C/man7/capabilities.7:551
1339 msgid "perform certain operations on B<hpsa>(4)  and B<cciss>(4)  devices;"
1340 msgstr ""
1341
1342 #. type: Plain text
1343 #: build/C/man7/capabilities.7:553
1344 msgid "perform a range of device-specific operations on other devices."
1345 msgstr ""
1346
1347 #. type: TP
1348 #: build/C/man7/capabilities.7:555
1349 #, no-wrap
1350 msgid "B<CAP_SYS_RESOURCE>"
1351 msgstr ""
1352
1353 #. type: Plain text
1354 #: build/C/man7/capabilities.7:561
1355 msgid "Use reserved space on ext2 filesystems;"
1356 msgstr ""
1357
1358 #. type: Plain text
1359 #: build/C/man7/capabilities.7:565
1360 msgid "make B<ioctl>(2)  calls controlling ext3 journaling;"
1361 msgstr ""
1362
1363 #. type: Plain text
1364 #: build/C/man7/capabilities.7:567
1365 msgid "override disk quota limits;"
1366 msgstr ""
1367
1368 #. type: Plain text
1369 #: build/C/man7/capabilities.7:570
1370 msgid "increase resource limits (see B<setrlimit>(2));"
1371 msgstr ""
1372
1373 #. type: Plain text
1374 #: build/C/man7/capabilities.7:576
1375 msgid "override maximum number of consoles on console allocation;"
1376 msgstr ""
1377
1378 #. type: Plain text
1379 #: build/C/man7/capabilities.7:578
1380 msgid "override maximum number of keymaps;"
1381 msgstr ""
1382
1383 #. type: Plain text
1384 #: build/C/man7/capabilities.7:580
1385 msgid "allow more than 64hz interrupts from the real-time clock;"
1386 msgstr ""
1387
1388 #. type: Plain text
1389 #: build/C/man7/capabilities.7:589
1390 msgid ""
1391 "raise I<msg_qbytes> limit for a System V message queue above the limit in "
1392 "I</proc/sys/kernel/msgmnb> (see B<msgop>(2)  and B<msgctl>(2));"
1393 msgstr ""
1394
1395 #. type: Plain text
1396 #: build/C/man7/capabilities.7:596
1397 msgid ""
1398 "override the I</proc/sys/fs/pipe-size-max> limit when setting the capacity "
1399 "of a pipe using the B<F_SETPIPE_SZ> B<fcntl>(2)  command."
1400 msgstr ""
1401
1402 #. type: Plain text
1403 #: build/C/man7/capabilities.7:601
1404 msgid ""
1405 "use B<F_SETPIPE_SZ> to increase the capacity of a pipe above the limit "
1406 "specified by I</proc/sys/fs/pipe-max-size>;"
1407 msgstr ""
1408
1409 #. type: Plain text
1410 #: build/C/man7/capabilities.7:606
1411 msgid ""
1412 "override I</proc/sys/fs/mqueue/queues_max> limit when creating POSIX message "
1413 "queues (see B<mq_overview>(7));"
1414 msgstr ""
1415
1416 #. type: Plain text
1417 #: build/C/man7/capabilities.7:611
1418 msgid "employ B<prctl>(2)  B<PR_SET_MM> operation;"
1419 msgstr ""
1420
1421 #. type: Plain text
1422 #: build/C/man7/capabilities.7:616
1423 msgid ""
1424 "set I</proc/PID/oom_score_adj> to a value lower than the value last set by a "
1425 "process with B<CAP_SYS_RESOURCE>."
1426 msgstr ""
1427
1428 #. type: TP
1429 #: build/C/man7/capabilities.7:618
1430 #, no-wrap
1431 msgid "B<CAP_SYS_TIME>"
1432 msgstr ""
1433
1434 #. type: Plain text
1435 #: build/C/man7/capabilities.7:625
1436 msgid ""
1437 "Set system clock (B<settimeofday>(2), B<stime>(2), B<adjtimex>(2)); set "
1438 "real-time (hardware) clock."
1439 msgstr ""
1440
1441 #. type: TP
1442 #: build/C/man7/capabilities.7:625
1443 #, no-wrap
1444 msgid "B<CAP_SYS_TTY_CONFIG>"
1445 msgstr ""
1446
1447 #. type: Plain text
1448 #: build/C/man7/capabilities.7:632
1449 msgid ""
1450 "Use B<vhangup>(2); employ various privileged B<ioctl>(2)  operations on "
1451 "virtual terminals."
1452 msgstr ""
1453
1454 #. type: TP
1455 #: build/C/man7/capabilities.7:632
1456 #, no-wrap
1457 msgid "B<CAP_SYSLOG> (since Linux 2.6.37)"
1458 msgstr ""
1459
1460 #. type: Plain text
1461 #: build/C/man7/capabilities.7:643
1462 msgid ""
1463 "Perform privileged B<syslog>(2)  operations.  See B<syslog>(2)  for "
1464 "information on which operations require privilege."
1465 msgstr ""
1466
1467 #. type: Plain text
1468 #: build/C/man7/capabilities.7:653
1469 msgid ""
1470 "View kernel addresses exposed via I</proc> and other interfaces when "
1471 "I</proc/sys/kernel/kptr_restrict> has the value 1.  (See the discussion of "
1472 "the I<kptr_restrict> in B<proc>(5).)"
1473 msgstr ""
1474
1475 #. type: TP
1476 #: build/C/man7/capabilities.7:655
1477 #, no-wrap
1478 msgid "B<CAP_WAKE_ALARM> (since Linux 3.0)"
1479 msgstr ""
1480
1481 #. type: Plain text
1482 #: build/C/man7/capabilities.7:663
1483 msgid ""
1484 "Trigger something that will wake up the system (set B<CLOCK_REALTIME_ALARM> "
1485 "and B<CLOCK_BOOTTIME_ALARM> timers)."
1486 msgstr ""
1487
1488 #. type: SS
1489 #: build/C/man7/capabilities.7:663
1490 #, no-wrap
1491 msgid "Past and current implementation"
1492 msgstr ""
1493
1494 #. type: Plain text
1495 #: build/C/man7/capabilities.7:665
1496 msgid "A full implementation of capabilities requires that:"
1497 msgstr ""
1498
1499 #. type: IP
1500 #: build/C/man7/capabilities.7:665 build/C/man7/capabilities.7:816 build/C/man7/capabilities.7:963 build/C/man7/capabilities.7:1016 build/C/man7/user_namespaces.7:173 build/C/man7/user_namespaces.7:515
1501 #, no-wrap
1502 msgid "1."
1503 msgstr ""
1504
1505 #. type: Plain text
1506 #: build/C/man7/capabilities.7:669
1507 msgid ""
1508 "For all privileged operations, the kernel must check whether the thread has "
1509 "the required capability in its effective set."
1510 msgstr ""
1511
1512 #. type: IP
1513 #: build/C/man7/capabilities.7:669 build/C/man7/capabilities.7:821 build/C/man7/capabilities.7:969 build/C/man7/capabilities.7:1022 build/C/man7/user_namespaces.7:189 build/C/man7/user_namespaces.7:521
1514 #, no-wrap
1515 msgid "2."
1516 msgstr ""
1517
1518 #. type: Plain text
1519 #: build/C/man7/capabilities.7:672
1520 msgid ""
1521 "The kernel must provide system calls allowing a thread's capability sets to "
1522 "be changed and retrieved."
1523 msgstr ""
1524
1525 #. type: IP
1526 #: build/C/man7/capabilities.7:672 build/C/man7/capabilities.7:972 build/C/man7/capabilities.7:1026 build/C/man7/user_namespaces.7:193 build/C/man7/user_namespaces.7:526
1527 #, no-wrap
1528 msgid "3."
1529 msgstr ""
1530
1531 #. type: Plain text
1532 #: build/C/man7/capabilities.7:675
1533 msgid ""
1534 "The filesystem must support attaching capabilities to an executable file, so "
1535 "that a process gains those capabilities when the file is executed."
1536 msgstr ""
1537
1538 #. type: Plain text
1539 #: build/C/man7/capabilities.7:679
1540 msgid ""
1541 "Before kernel 2.6.24, only the first two of these requirements are met; "
1542 "since kernel 2.6.24, all three requirements are met."
1543 msgstr ""
1544
1545 #. type: SS
1546 #: build/C/man7/capabilities.7:679
1547 #, no-wrap
1548 msgid "Thread capability sets"
1549 msgstr ""
1550
1551 #. type: Plain text
1552 #: build/C/man7/capabilities.7:682
1553 msgid ""
1554 "Each thread has three capability sets containing zero or more of the above "
1555 "capabilities:"
1556 msgstr ""
1557
1558 #. type: TP
1559 #: build/C/man7/capabilities.7:682
1560 #, no-wrap
1561 msgid "I<Permitted>:"
1562 msgstr ""
1563
1564 #. type: Plain text
1565 #: build/C/man7/capabilities.7:690
1566 msgid ""
1567 "This is a limiting superset for the effective capabilities that the thread "
1568 "may assume.  It is also a limiting superset for the capabilities that may be "
1569 "added to the inheritable set by a thread that does not have the "
1570 "B<CAP_SETPCAP> capability in its effective set."
1571 msgstr ""
1572
1573 #. type: Plain text
1574 #: build/C/man7/capabilities.7:696
1575 msgid ""
1576 "If a thread drops a capability from its permitted set, it can never "
1577 "reacquire that capability (unless it B<execve>(2)s either a set-user-ID-root "
1578 "program, or a program whose associated file capabilities grant that "
1579 "capability)."
1580 msgstr ""
1581
1582 #. type: TP
1583 #: build/C/man7/capabilities.7:696
1584 #, no-wrap
1585 msgid "I<Inheritable>:"
1586 msgstr ""
1587
1588 #. type: Plain text
1589 #: build/C/man7/capabilities.7:703
1590 msgid ""
1591 "This is a set of capabilities preserved across an B<execve>(2).  It provides "
1592 "a mechanism for a process to assign capabilities to the permitted set of the "
1593 "new program during an B<execve>(2)."
1594 msgstr ""
1595
1596 #. type: TP
1597 #: build/C/man7/capabilities.7:703 build/C/man7/capabilities.7:753
1598 #, no-wrap
1599 msgid "I<Effective>:"
1600 msgstr ""
1601
1602 #. type: Plain text
1603 #: build/C/man7/capabilities.7:707
1604 msgid ""
1605 "This is the set of capabilities used by the kernel to perform permission "
1606 "checks for the thread."
1607 msgstr ""
1608
1609 #. type: Plain text
1610 #: build/C/man7/capabilities.7:713
1611 msgid ""
1612 "A child created via B<fork>(2)  inherits copies of its parent's capability "
1613 "sets.  See below for a discussion of the treatment of capabilities during "
1614 "B<execve>(2)."
1615 msgstr ""
1616
1617 #. type: Plain text
1618 #: build/C/man7/capabilities.7:717
1619 msgid ""
1620 "Using B<capset>(2), a thread may manipulate its own capability sets (see "
1621 "below)."
1622 msgstr ""
1623
1624 #.  commit 73efc0394e148d0e15583e13712637831f926720
1625 #. type: Plain text
1626 #: build/C/man7/capabilities.7:726
1627 msgid ""
1628 "Since Linux 3.2, the file I</proc/sys/kernel/cap_last_cap> exposes the "
1629 "numerical value of the highest capability supported by the running kernel; "
1630 "this can be used to determine the highest bit that may be set in a "
1631 "capability set."
1632 msgstr ""
1633
1634 #. type: SS
1635 #: build/C/man7/capabilities.7:726
1636 #, no-wrap
1637 msgid "File capabilities"
1638 msgstr ""
1639
1640 #. type: Plain text
1641 #: build/C/man7/capabilities.7:741
1642 msgid ""
1643 "Since kernel 2.6.24, the kernel supports associating capability sets with an "
1644 "executable file using B<setcap>(8).  The file capability sets are stored in "
1645 "an extended attribute (see B<setxattr>(2))  named I<security.capability>.  "
1646 "Writing to this extended attribute requires the B<CAP_SETFCAP> capability.  "
1647 "The file capability sets, in conjunction with the capability sets of the "
1648 "thread, determine the capabilities of a thread after an B<execve>(2)."
1649 msgstr ""
1650
1651 #. type: Plain text
1652 #: build/C/man7/capabilities.7:743
1653 msgid "The three file capability sets are:"
1654 msgstr ""
1655
1656 #. type: TP
1657 #: build/C/man7/capabilities.7:743
1658 #, no-wrap
1659 msgid "I<Permitted> (formerly known as I<forced>):"
1660 msgstr ""
1661
1662 #. type: Plain text
1663 #: build/C/man7/capabilities.7:747
1664 msgid ""
1665 "These capabilities are automatically permitted to the thread, regardless of "
1666 "the thread's inheritable capabilities."
1667 msgstr ""
1668
1669 #. type: TP
1670 #: build/C/man7/capabilities.7:747
1671 #, no-wrap
1672 msgid "I<Inheritable> (formerly known as I<allowed>):"
1673 msgstr ""
1674
1675 #. type: Plain text
1676 #: build/C/man7/capabilities.7:753
1677 msgid ""
1678 "This set is ANDed with the thread's inheritable set to determine which "
1679 "inheritable capabilities are enabled in the permitted set of the thread "
1680 "after the B<execve>(2)."
1681 msgstr ""
1682
1683 #. type: Plain text
1684 #: build/C/man7/capabilities.7:763
1685 msgid ""
1686 "This is not a set, but rather just a single bit.  If this bit is set, then "
1687 "during an B<execve>(2)  all of the new permitted capabilities for the thread "
1688 "are also raised in the effective set.  If this bit is not set, then after an "
1689 "B<execve>(2), none of the new permitted capabilities is in the new effective "
1690 "set."
1691 msgstr ""
1692
1693 #. type: Plain text
1694 #: build/C/man7/capabilities.7:779
1695 msgid ""
1696 "Enabling the file effective capability bit implies that any file permitted "
1697 "or inheritable capability that causes a thread to acquire the corresponding "
1698 "permitted capability during an B<execve>(2)  (see the transformation rules "
1699 "described below) will also acquire that capability in its effective set.  "
1700 "Therefore, when assigning capabilities to a file (B<setcap>(8), "
1701 "B<cap_set_file>(3), B<cap_set_fd>(3)), if we specify the effective flag as "
1702 "being enabled for any capability, then the effective flag must also be "
1703 "specified as enabled for all other capabilities for which the corresponding "
1704 "permitted or inheritable flags is enabled."
1705 msgstr ""
1706
1707 #. type: SS
1708 #: build/C/man7/capabilities.7:779
1709 #, no-wrap
1710 msgid "Transformation of capabilities during execve()"
1711 msgstr ""
1712
1713 #. type: Plain text
1714 #: build/C/man7/capabilities.7:785
1715 msgid ""
1716 "During an B<execve>(2), the kernel calculates the new capabilities of the "
1717 "process using the following algorithm:"
1718 msgstr ""
1719
1720 #. type: Plain text
1721 #: build/C/man7/capabilities.7:790
1722 #, no-wrap
1723 msgid ""
1724 "P'(permitted) = (P(inheritable) & F(inheritable)) |\n"
1725 "                (F(permitted) & cap_bset)\n"
1726 msgstr ""
1727
1728 #. type: Plain text
1729 #: build/C/man7/capabilities.7:792
1730 #, no-wrap
1731 msgid "P'(effective) = F(effective) ? P'(permitted) : 0\n"
1732 msgstr ""
1733
1734 #. type: Plain text
1735 #: build/C/man7/capabilities.7:794
1736 #, no-wrap
1737 msgid "P'(inheritable) = P(inheritable)    [i.e., unchanged]\n"
1738 msgstr ""
1739
1740 #. type: Plain text
1741 #: build/C/man7/capabilities.7:798
1742 msgid "where:"
1743 msgstr ""
1744
1745 #. type: IP
1746 #: build/C/man7/capabilities.7:799
1747 #, no-wrap
1748 msgid "P"
1749 msgstr ""
1750
1751 #. type: Plain text
1752 #: build/C/man7/capabilities.7:802
1753 msgid "denotes the value of a thread capability set before the B<execve>(2)"
1754 msgstr ""
1755
1756 #. type: IP
1757 #: build/C/man7/capabilities.7:802
1758 #, no-wrap
1759 msgid "P'"
1760 msgstr ""
1761
1762 #. type: Plain text
1763 #: build/C/man7/capabilities.7:805
1764 msgid "denotes the value of a capability set after the B<execve>(2)"
1765 msgstr ""
1766
1767 #. type: IP
1768 #: build/C/man7/capabilities.7:805
1769 #, no-wrap
1770 msgid "F"
1771 msgstr ""
1772
1773 #. type: Plain text
1774 #: build/C/man7/capabilities.7:807
1775 msgid "denotes a file capability set"
1776 msgstr ""
1777
1778 #. type: IP
1779 #: build/C/man7/capabilities.7:807
1780 #, no-wrap
1781 msgid "cap_bset"
1782 msgstr ""
1783
1784 #. type: Plain text
1785 #: build/C/man7/capabilities.7:809
1786 msgid "is the value of the capability bounding set (described below)."
1787 msgstr ""
1788
1789 #. type: SS
1790 #: build/C/man7/capabilities.7:811
1791 #, no-wrap
1792 msgid "Capabilities and execution of programs by root"
1793 msgstr ""
1794
1795 #. type: Plain text
1796 #: build/C/man7/capabilities.7:816
1797 msgid ""
1798 "In order to provide an all-powerful I<root> using capability sets, during an "
1799 "B<execve>(2):"
1800 msgstr ""
1801
1802 #. type: Plain text
1803 #: build/C/man7/capabilities.7:821
1804 msgid ""
1805 "If a set-user-ID-root program is being executed, or the real user ID of the "
1806 "process is 0 (root)  then the file inheritable and permitted sets are "
1807 "defined to be all ones (i.e., all capabilities enabled)."
1808 msgstr ""
1809
1810 #. type: Plain text
1811 #: build/C/man7/capabilities.7:824
1812 msgid ""
1813 "If a set-user-ID-root program is being executed, then the file effective bit "
1814 "is defined to be one (enabled)."
1815 msgstr ""
1816
1817 #.  If a process with real UID 0, and nonzero effective UID does an
1818 #.  exec(), then it gets all capabilities in its
1819 #.  permitted set, and no effective capabilities
1820 #. type: Plain text
1821 #: build/C/man7/capabilities.7:839
1822 msgid ""
1823 "The upshot of the above rules, combined with the capabilities "
1824 "transformations described above, is that when a process B<execve>(2)s a "
1825 "set-user-ID-root program, or when a process with an effective UID of 0 "
1826 "B<execve>(2)s a program, it gains all capabilities in its permitted and "
1827 "effective capability sets, except those masked out by the capability "
1828 "bounding set.  This provides semantics that are the same as those provided "
1829 "by traditional UNIX systems."
1830 msgstr ""
1831
1832 #. type: SS
1833 #: build/C/man7/capabilities.7:839
1834 #, no-wrap
1835 msgid "Capability bounding set"
1836 msgstr ""
1837
1838 #. type: Plain text
1839 #: build/C/man7/capabilities.7:844
1840 msgid ""
1841 "The capability bounding set is a security mechanism that can be used to "
1842 "limit the capabilities that can be gained during an B<execve>(2).  The "
1843 "bounding set is used in the following ways:"
1844 msgstr ""
1845
1846 #. type: Plain text
1847 #: build/C/man7/capabilities.7:852
1848 msgid ""
1849 "During an B<execve>(2), the capability bounding set is ANDed with the file "
1850 "permitted capability set, and the result of this operation is assigned to "
1851 "the thread's permitted capability set.  The capability bounding set thus "
1852 "places a limit on the permitted capabilities that may be granted by an "
1853 "executable file."
1854 msgstr ""
1855
1856 #. type: Plain text
1857 #: build/C/man7/capabilities.7:864
1858 msgid ""
1859 "(Since Linux 2.6.25)  The capability bounding set acts as a limiting "
1860 "superset for the capabilities that a thread can add to its inheritable set "
1861 "using B<capset>(2).  This means that if a capability is not in the bounding "
1862 "set, then a thread can't add this capability to its inheritable set, even if "
1863 "it was in its permitted capabilities, and thereby cannot have this "
1864 "capability preserved in its permitted set when it B<execve>(2)s a file that "
1865 "has the capability in its inheritable set."
1866 msgstr ""
1867
1868 #. type: Plain text
1869 #: build/C/man7/capabilities.7:871
1870 msgid ""
1871 "Note that the bounding set masks the file permitted capabilities, but not "
1872 "the inherited capabilities.  If a thread maintains a capability in its "
1873 "inherited set that is not in its bounding set, then it can still gain that "
1874 "capability in its permitted set by executing a file that has the capability "
1875 "in its inherited set."
1876 msgstr ""
1877
1878 #. type: Plain text
1879 #: build/C/man7/capabilities.7:874
1880 msgid ""
1881 "Depending on the kernel version, the capability bounding set is either a "
1882 "system-wide attribute, or a per-process attribute."
1883 msgstr ""
1884
1885 #. type: Plain text
1886 #: build/C/man7/capabilities.7:876
1887 msgid "B<Capability bounding set prior to Linux 2.6.25>"
1888 msgstr ""
1889
1890 #. type: Plain text
1891 #: build/C/man7/capabilities.7:884
1892 msgid ""
1893 "In kernels before 2.6.25, the capability bounding set is a system-wide "
1894 "attribute that affects all threads on the system.  The bounding set is "
1895 "accessible via the file I</proc/sys/kernel/cap-bound>.  (Confusingly, this "
1896 "bit mask parameter is expressed as a signed decimal number in "
1897 "I</proc/sys/kernel/cap-bound>.)"
1898 msgstr ""
1899
1900 #. type: Plain text
1901 #: build/C/man7/capabilities.7:891
1902 msgid ""
1903 "Only the B<init> process may set capabilities in the capability bounding "
1904 "set; other than that, the superuser (more precisely: programs with the "
1905 "B<CAP_SYS_MODULE> capability) may only clear capabilities from this set."
1906 msgstr ""
1907
1908 #. type: Plain text
1909 #: build/C/man7/capabilities.7:900
1910 msgid ""
1911 "On a standard system the capability bounding set always masks out the "
1912 "B<CAP_SETPCAP> capability.  To remove this restriction (dangerous!), modify "
1913 "the definition of B<CAP_INIT_EFF_SET> in I<include/linux/capability.h> and "
1914 "rebuild the kernel."
1915 msgstr ""
1916
1917 #. type: Plain text
1918 #: build/C/man7/capabilities.7:904
1919 msgid ""
1920 "The system-wide capability bounding set feature was added to Linux starting "
1921 "with kernel version 2.2.11."
1922 msgstr ""
1923
1924 #. type: Plain text
1925 #: build/C/man7/capabilities.7:906
1926 msgid "B<Capability bounding set from Linux 2.6.25 onward>"
1927 msgstr ""
1928
1929 #. type: Plain text
1930 #: build/C/man7/capabilities.7:911
1931 msgid ""
1932 "From Linux 2.6.25, the I<capability bounding set> is a per-thread "
1933 "attribute.  (There is no longer a system-wide capability bounding set.)"
1934 msgstr ""
1935
1936 #. type: Plain text
1937 #: build/C/man7/capabilities.7:916
1938 msgid ""
1939 "The bounding set is inherited at B<fork>(2)  from the thread's parent, and "
1940 "is preserved across an B<execve>(2)."
1941 msgstr ""
1942
1943 #. type: Plain text
1944 #: build/C/man7/capabilities.7:929
1945 msgid ""
1946 "A thread may remove capabilities from its capability bounding set using the "
1947 "B<prctl>(2)  B<PR_CAPBSET_DROP> operation, provided it has the "
1948 "B<CAP_SETPCAP> capability.  Once a capability has been dropped from the "
1949 "bounding set, it cannot be restored to that set.  A thread can determine if "
1950 "a capability is in its bounding set using the B<prctl>(2)  "
1951 "B<PR_CAPBSET_READ> operation."
1952 msgstr ""
1953
1954 #. type: Plain text
1955 #: build/C/man7/capabilities.7:947
1956 msgid ""
1957 "Removing capabilities from the bounding set is supported only if file "
1958 "capabilities are compiled into the kernel.  In kernels before Linux 2.6.33, "
1959 "file capabilities were an optional feature configurable via the "
1960 "B<CONFIG_SECURITY_FILE_CAPABILITIES> option.  Since Linux 2.6.33, the "
1961 "configuration option has been removed and file capabilities are always part "
1962 "of the kernel.  When file capabilities are compiled into the kernel, the "
1963 "B<init> process (the ancestor of all processes) begins with a full bounding "
1964 "set.  If file capabilities are not compiled into the kernel, then B<init> "
1965 "begins with a full bounding set minus B<CAP_SETPCAP>, because this "
1966 "capability has a different meaning when there are no file capabilities."
1967 msgstr ""
1968
1969 #. type: Plain text
1970 #: build/C/man7/capabilities.7:954
1971 msgid ""
1972 "Removing a capability from the bounding set does not remove it from the "
1973 "thread's inherited set.  However it does prevent the capability from being "
1974 "added back into the thread's inherited set in the future."
1975 msgstr ""
1976
1977 #. type: SS
1978 #: build/C/man7/capabilities.7:954
1979 #, no-wrap
1980 msgid "Effect of user ID changes on capabilities"
1981 msgstr ""
1982
1983 #. type: Plain text
1984 #: build/C/man7/capabilities.7:963
1985 msgid ""
1986 "To preserve the traditional semantics for transitions between 0 and nonzero "
1987 "user IDs, the kernel makes the following changes to a thread's capability "
1988 "sets on changes to the thread's real, effective, saved set, and filesystem "
1989 "user IDs (using B<setuid>(2), B<setresuid>(2), or similar):"
1990 msgstr ""
1991
1992 #. type: Plain text
1993 #: build/C/man7/capabilities.7:969
1994 msgid ""
1995 "If one or more of the real, effective or saved set user IDs was previously "
1996 "0, and as a result of the UID changes all of these IDs have a nonzero value, "
1997 "then all capabilities are cleared from the permitted and effective "
1998 "capability sets."
1999 msgstr ""
2000
2001 #. type: Plain text
2002 #: build/C/man7/capabilities.7:972
2003 msgid ""
2004 "If the effective user ID is changed from 0 to nonzero, then all capabilities "
2005 "are cleared from the effective set."
2006 msgstr ""
2007
2008 #. type: Plain text
2009 #: build/C/man7/capabilities.7:975
2010 msgid ""
2011 "If the effective user ID is changed from nonzero to 0, then the permitted "
2012 "set is copied to the effective set."
2013 msgstr ""
2014
2015 #. type: IP
2016 #: build/C/man7/capabilities.7:975 build/C/man7/capabilities.7:1030 build/C/man7/user_namespaces.7:529
2017 #, no-wrap
2018 msgid "4."
2019 msgstr ""
2020
2021 #. type: Plain text
2022 #: build/C/man7/capabilities.7:993
2023 msgid ""
2024 "If the filesystem user ID is changed from 0 to nonzero (see B<setfsuid>(2)), "
2025 "then the following capabilities are cleared from the effective set: "
2026 "B<CAP_CHOWN>, B<CAP_DAC_OVERRIDE>, B<CAP_DAC_READ_SEARCH>, B<CAP_FOWNER>, "
2027 "B<CAP_FSETID>, B<CAP_LINUX_IMMUTABLE> (since Linux 2.6.30), "
2028 "B<CAP_MAC_OVERRIDE>, and B<CAP_MKNOD> (since Linux 2.6.30).  If the "
2029 "filesystem UID is changed from nonzero to 0, then any of these capabilities "
2030 "that are enabled in the permitted set are enabled in the effective set."
2031 msgstr ""
2032
2033 #. type: Plain text
2034 #: build/C/man7/capabilities.7:1001
2035 msgid ""
2036 "If a thread that has a 0 value for one or more of its user IDs wants to "
2037 "prevent its permitted capability set being cleared when it resets all of its "
2038 "user IDs to nonzero values, it can do so using the B<prctl>(2)  "
2039 "B<PR_SET_KEEPCAPS> operation."
2040 msgstr ""
2041
2042 #. type: SS
2043 #: build/C/man7/capabilities.7:1001
2044 #, no-wrap
2045 msgid "Programmatically adjusting capability sets"
2046 msgstr ""
2047
2048 #. type: Plain text
2049 #: build/C/man7/capabilities.7:1016
2050 msgid ""
2051 "A thread can retrieve and change its capability sets using the B<capget>(2)  "
2052 "and B<capset>(2)  system calls.  However, the use of B<cap_get_proc>(3)  and "
2053 "B<cap_set_proc>(3), both provided in the I<libcap> package, is preferred for "
2054 "this purpose.  The following rules govern changes to the thread capability "
2055 "sets:"
2056 msgstr ""
2057
2058 #. type: Plain text
2059 #: build/C/man7/capabilities.7:1022
2060 msgid ""
2061 "If the caller does not have the B<CAP_SETPCAP> capability, the new "
2062 "inheritable set must be a subset of the combination of the existing "
2063 "inheritable and permitted sets."
2064 msgstr ""
2065
2066 #. type: Plain text
2067 #: build/C/man7/capabilities.7:1026
2068 msgid ""
2069 "(Since Linux 2.6.25)  The new inheritable set must be a subset of the "
2070 "combination of the existing inheritable set and the capability bounding set."
2071 msgstr ""
2072
2073 #. type: Plain text
2074 #: build/C/man7/capabilities.7:1030
2075 msgid ""
2076 "The new permitted set must be a subset of the existing permitted set (i.e., "
2077 "it is not possible to acquire permitted capabilities that the thread does "
2078 "not currently have)."
2079 msgstr ""
2080
2081 #. type: Plain text
2082 #: build/C/man7/capabilities.7:1032
2083 msgid "The new effective set must be a subset of the new permitted set."
2084 msgstr ""
2085
2086 #. type: SS
2087 #: build/C/man7/capabilities.7:1032
2088 #, no-wrap
2089 msgid "The securebits flags: establishing a capabilities-only environment"
2090 msgstr ""
2091
2092 #.  For some background:
2093 #.        see http://lwn.net/Articles/280279/ and
2094 #.        http://article.gmane.org/gmane.linux.kernel.lsm/5476/
2095 #. type: Plain text
2096 #: build/C/man7/capabilities.7:1043
2097 msgid ""
2098 "Starting with kernel 2.6.26, and with a kernel in which file capabilities "
2099 "are enabled, Linux implements a set of per-thread I<securebits> flags that "
2100 "can be used to disable special handling of capabilities for UID 0 "
2101 "(I<root>).  These flags are as follows:"
2102 msgstr ""
2103
2104 #. type: TP
2105 #: build/C/man7/capabilities.7:1043
2106 #, no-wrap
2107 msgid "B<SECBIT_KEEP_CAPS>"
2108 msgstr ""
2109
2110 #. type: Plain text
2111 #: build/C/man7/capabilities.7:1055
2112 msgid ""
2113 "Setting this flag allows a thread that has one or more 0 UIDs to retain its "
2114 "capabilities when it switches all of its UIDs to a nonzero value.  If this "
2115 "flag is not set, then such a UID switch causes the thread to lose all "
2116 "capabilities.  This flag is always cleared on an B<execve>(2).  (This flag "
2117 "provides the same functionality as the older B<prctl>(2)  B<PR_SET_KEEPCAPS> "
2118 "operation.)"
2119 msgstr ""
2120
2121 #. type: TP
2122 #: build/C/man7/capabilities.7:1055
2123 #, no-wrap
2124 msgid "B<SECBIT_NO_SETUID_FIXUP>"
2125 msgstr ""
2126
2127 #. type: Plain text
2128 #: build/C/man7/capabilities.7:1062
2129 msgid ""
2130 "Setting this flag stops the kernel from adjusting capability sets when the "
2131 "threads's effective and filesystem UIDs are switched between zero and "
2132 "nonzero values.  (See the subsection I<Effect of User ID Changes on "
2133 "Capabilities>.)"
2134 msgstr ""
2135
2136 #. type: TP
2137 #: build/C/man7/capabilities.7:1062
2138 #, no-wrap
2139 msgid "B<SECBIT_NOROOT>"
2140 msgstr ""
2141
2142 #. type: Plain text
2143 #: build/C/man7/capabilities.7:1070
2144 msgid ""
2145 "If this bit is set, then the kernel does not grant capabilities when a "
2146 "set-user-ID-root program is executed, or when a process with an effective or "
2147 "real UID of 0 calls B<execve>(2).  (See the subsection I<Capabilities and "
2148 "execution of programs by root>.)"
2149 msgstr ""
2150
2151 #. type: Plain text
2152 #: build/C/man7/capabilities.7:1080
2153 msgid ""
2154 "Each of the above \"base\" flags has a companion \"locked\" flag.  Setting "
2155 "any of the \"locked\" flags is irreversible, and has the effect of "
2156 "preventing further changes to the corresponding \"base\" flag.  The locked "
2157 "flags are: B<SECBIT_KEEP_CAPS_LOCKED>, B<SECBIT_NO_SETUID_FIXUP_LOCKED>, and "
2158 "B<SECBIT_NOROOT_LOCKED>."
2159 msgstr ""
2160
2161 #. type: Plain text
2162 #: build/C/man7/capabilities.7:1092
2163 msgid ""
2164 "The I<securebits> flags can be modified and retrieved using the B<prctl>(2)  "
2165 "B<PR_SET_SECUREBITS> and B<PR_GET_SECUREBITS> operations.  The "
2166 "B<CAP_SETPCAP> capability is required to modify the flags."
2167 msgstr ""
2168
2169 #. type: Plain text
2170 #: build/C/man7/capabilities.7:1101
2171 msgid ""
2172 "The I<securebits> flags are inherited by child processes.  During an "
2173 "B<execve>(2), all of the flags are preserved, except B<SECBIT_KEEP_CAPS> "
2174 "which is always cleared."
2175 msgstr ""
2176
2177 #. type: Plain text
2178 #: build/C/man7/capabilities.7:1106
2179 msgid ""
2180 "An application can use the following call to lock itself, and all of its "
2181 "descendants, into an environment where the only way of gaining capabilities "
2182 "is by executing a program with associated file capabilities:"
2183 msgstr ""
2184
2185 #. type: Plain text
2186 #: build/C/man7/capabilities.7:1115
2187 #, no-wrap
2188 msgid ""
2189 "prctl(PR_SET_SECUREBITS,\n"
2190 "        SECBIT_KEEP_CAPS_LOCKED |\n"
2191 "        SECBIT_NO_SETUID_FIXUP |\n"
2192 "        SECBIT_NO_SETUID_FIXUP_LOCKED |\n"
2193 "        SECBIT_NOROOT |\n"
2194 "        SECBIT_NOROOT_LOCKED);\n"
2195 msgstr ""
2196
2197 #. type: SS
2198 #: build/C/man7/capabilities.7:1117
2199 #, no-wrap
2200 msgid "Interaction with user namespaces"
2201 msgstr ""
2202
2203 #. type: Plain text
2204 #: build/C/man7/capabilities.7:1120
2205 msgid ""
2206 "For a discussion of the interaction of capabilities and user namespaces, see "
2207 "B<user_namespaces>(7)."
2208 msgstr ""
2209
2210 #. type: Plain text
2211 #: build/C/man7/capabilities.7:1126
2212 msgid ""
2213 "No standards govern capabilities, but the Linux capability implementation is "
2214 "based on the withdrawn POSIX.1e draft standard; see E<.UR "
2215 "http://wt.tuxomania.net\\:/publications\\:/posix.1e/> E<.UE .>"
2216 msgstr ""
2217
2218 #. type: Plain text
2219 #: build/C/man7/capabilities.7:1131
2220 msgid ""
2221 "Since kernel 2.5.27, capabilities are an optional kernel component, and can "
2222 "be enabled/disabled via the B<CONFIG_SECURITY_CAPABILITIES> kernel "
2223 "configuration option."
2224 msgstr ""
2225
2226 #.  7b9a7ec565505699f503b4fcf61500dceb36e744
2227 #. type: Plain text
2228 #: build/C/man7/capabilities.7:1145
2229 msgid ""
2230 "The I</proc/PID/task/TID/status> file can be used to view the capability "
2231 "sets of a thread.  The I</proc/PID/status> file shows the capability sets of "
2232 "a process's main thread.  Before Linux 3.8, nonexistent capabilities were "
2233 "shown as being enabled (1) in these sets.  Since Linux 3.8, all nonexistent "
2234 "capabilities (above B<CAP_LAST_CAP>)  are shown as disabled (0)."
2235 msgstr ""
2236
2237 #. type: Plain text
2238 #: build/C/man7/capabilities.7:1160
2239 msgid ""
2240 "The I<libcap> package provides a suite of routines for setting and getting "
2241 "capabilities that is more comfortable and less likely to change than the "
2242 "interface provided by B<capset>(2)  and B<capget>(2).  This package also "
2243 "provides the B<setcap>(8)  and B<getcap>(8)  programs.  It can be found at"
2244 msgstr ""
2245
2246 #. type: Plain text
2247 #: build/C/man7/capabilities.7:1163
2248 msgid ""
2249 "E<.UR "
2250 "http://www.kernel.org\\:/pub\\:/linux\\:/libs\\:/security\\:/linux-privs> "
2251 "E<.UE .>"
2252 msgstr ""
2253
2254 #. type: Plain text
2255 #: build/C/man7/capabilities.7:1172
2256 msgid ""
2257 "Before kernel 2.6.24, and since kernel 2.6.24 if file capabilities are not "
2258 "enabled, a thread with the B<CAP_SETPCAP> capability can manipulate the "
2259 "capabilities of threads other than itself.  However, this is only "
2260 "theoretically possible, since no thread ever has B<CAP_SETPCAP> in either of "
2261 "these cases:"
2262 msgstr ""
2263
2264 #. type: Plain text
2265 #: build/C/man7/capabilities.7:1177
2266 msgid ""
2267 "In the pre-2.6.25 implementation the system-wide capability bounding set, "
2268 "I</proc/sys/kernel/cap-bound>, always masks out this capability, and this "
2269 "can not be changed without modifying the kernel source and rebuilding."
2270 msgstr ""
2271
2272 #. type: Plain text
2273 #: build/C/man7/capabilities.7:1183
2274 msgid ""
2275 "If file capabilities are disabled in the current implementation, then "
2276 "B<init> starts out with this capability removed from its per-process "
2277 "bounding set, and that bounding set is inherited by all other processes "
2278 "created on the system."
2279 msgstr ""
2280
2281 #. type: Plain text
2282 #: build/C/man7/capabilities.7:1202
2283 msgid ""
2284 "B<capsh>(1), B<capget>(2), B<prctl>(2), B<setfsuid>(2), B<cap_clear>(3), "
2285 "B<cap_copy_ext>(3), B<cap_from_text>(3), B<cap_get_file>(3), "
2286 "B<cap_get_proc>(3), B<cap_init>(3), B<capgetp>(3), B<capsetp>(3), "
2287 "B<libcap>(3), B<credentials>(7), B<user_namespaces>(7), B<pthreads>(7), "
2288 "B<getcap>(8), B<setcap>(8)"
2289 msgstr ""
2290
2291 #. type: Plain text
2292 #: build/C/man7/capabilities.7:1205
2293 msgid "I<include/linux/capability.h> in the Linux kernel source tree"
2294 msgstr ""
2295
2296 #. type: TH
2297 #: build/C/man2/capget.2:15
2298 #, no-wrap
2299 msgid "CAPGET"
2300 msgstr ""
2301
2302 #. type: TH
2303 #: build/C/man2/capget.2:15
2304 #, no-wrap
2305 msgid "2013-03-11"
2306 msgstr ""
2307
2308 #. type: Plain text
2309 #: build/C/man2/capget.2:18
2310 msgid "capget, capset - set/get capabilities of thread(s)"
2311 msgstr ""
2312
2313 #. type: Plain text
2314 #: build/C/man2/capget.2:20
2315 msgid "B<#include E<lt>sys/capability.hE<gt>>"
2316 msgstr ""
2317
2318 #. type: Plain text
2319 #: build/C/man2/capget.2:22
2320 msgid "B<int capget(cap_user_header_t >I<hdrp>B<, cap_user_data_t >I<datap>B<);>"
2321 msgstr ""
2322
2323 #. type: Plain text
2324 #: build/C/man2/capget.2:24
2325 msgid ""
2326 "B<int capset(cap_user_header_t >I<hdrp>B<, const cap_user_data_t "
2327 ">I<datap>B<);>"
2328 msgstr ""
2329
2330 #. type: Plain text
2331 #: build/C/man2/capget.2:35
2332 msgid ""
2333 "As of Linux 2.2, the power of the superuser (root) has been partitioned into "
2334 "a set of discrete capabilities.  Each thread has a set of effective "
2335 "capabilities identifying which capabilities (if any) it may currently "
2336 "exercise.  Each thread also has a set of inheritable capabilities that may "
2337 "be passed through an B<execve>(2)  call, and a set of permitted capabilities "
2338 "that it can make effective or inheritable."
2339 msgstr ""
2340
2341 #. type: Plain text
2342 #: build/C/man2/capget.2:44
2343 msgid ""
2344 "These two system calls are the raw kernel interface for getting and setting "
2345 "thread capabilities.  Not only are these system calls specific to Linux, but "
2346 "the kernel API is likely to change and use of these system calls (in "
2347 "particular the format of the I<cap_user_*_t> types) is subject to extension "
2348 "with each kernel revision, but old programs will keep working."
2349 msgstr ""
2350
2351 #. type: Plain text
2352 #: build/C/man2/capget.2:55
2353 msgid ""
2354 "The portable interfaces are B<cap_set_proc>(3)  and B<cap_get_proc>(3); if "
2355 "possible, you should use those interfaces in applications.  If you wish to "
2356 "use the Linux extensions in applications, you should use the easier-to-use "
2357 "interfaces B<capsetp>(3)  and B<capgetp>(3)."
2358 msgstr ""
2359
2360 #. type: SS
2361 #: build/C/man2/capget.2:55
2362 #, no-wrap
2363 msgid "Current details"
2364 msgstr ""
2365
2366 #. type: Plain text
2367 #: build/C/man2/capget.2:58
2368 msgid ""
2369 "Now that you have been warned, some current kernel details.  The structures "
2370 "are defined as follows."
2371 msgstr ""
2372
2373 #. type: Plain text
2374 #: build/C/man2/capget.2:63
2375 #, no-wrap
2376 msgid ""
2377 "#define _LINUX_CAPABILITY_VERSION_1  0x19980330\n"
2378 "#define _LINUX_CAPABILITY_U32S_1     1\n"
2379 msgstr ""
2380
2381 #. type: Plain text
2382 #: build/C/man2/capget.2:66
2383 #, no-wrap
2384 msgid ""
2385 "#define _LINUX_CAPABILITY_VERSION_2  0x20071026\n"
2386 "#define _LINUX_CAPABILITY_U32S_2     2\n"
2387 msgstr ""
2388
2389 #. type: Plain text
2390 #: build/C/man2/capget.2:71
2391 #, no-wrap
2392 msgid ""
2393 "typedef struct __user_cap_header_struct {\n"
2394 "   __u32 version;\n"
2395 "   int pid;\n"
2396 "} *cap_user_header_t;\n"
2397 msgstr ""
2398
2399 #. type: Plain text
2400 #: build/C/man2/capget.2:77
2401 #, no-wrap
2402 msgid ""
2403 "typedef struct __user_cap_data_struct {\n"
2404 "   __u32 effective;\n"
2405 "   __u32 permitted;\n"
2406 "   __u32 inheritable;\n"
2407 "} *cap_user_data_t;\n"
2408 msgstr ""
2409
2410 #. type: Plain text
2411 #: build/C/man2/capget.2:96
2412 msgid ""
2413 "The I<effective>, I<permitted>, and I<inheritable> fields are bit masks of "
2414 "the capabilities defined in B<capabilities>(7).  Note the B<CAP_*> values "
2415 "are bit indexes and need to be bit-shifted before ORing into the bit "
2416 "fields.  To define the structures for passing to the system call you have to "
2417 "use the I<struct __user_cap_header_struct> and I<struct "
2418 "__user_cap_data_struct> names because the typedefs are only pointers."
2419 msgstr ""
2420
2421 #. type: Plain text
2422 #: build/C/man2/capget.2:108
2423 msgid ""
2424 "Kernels prior to 2.6.25 prefer 32-bit capabilities with version "
2425 "B<_LINUX_CAPABILITY_VERSION_1>, and kernels 2.6.25+ prefer 64-bit "
2426 "capabilities with version B<_LINUX_CAPABILITY_VERSION_2>.  Note, 64-bit "
2427 "capabilities use I<datap>[0] and I<datap>[1], whereas 32-bit capabilities "
2428 "use only I<datap>[0]."
2429 msgstr ""
2430
2431 #. type: Plain text
2432 #: build/C/man2/capget.2:112
2433 msgid ""
2434 "Another change affecting the behavior of these system calls is kernel "
2435 "support for file capabilities (VFS capability support).  This support is "
2436 "currently a compile time option (added in kernel 2.6.24)."
2437 msgstr ""
2438
2439 #. type: Plain text
2440 #: build/C/man2/capget.2:119
2441 msgid ""
2442 "For B<capget>()  calls, one can probe the capabilities of any process by "
2443 "specifying its process ID with the I<hdrp-E<gt>pid> field value."
2444 msgstr ""
2445
2446 #. type: SS
2447 #: build/C/man2/capget.2:119
2448 #, no-wrap
2449 msgid "With VFS capability support"
2450 msgstr ""
2451
2452 #. type: Plain text
2453 #: build/C/man2/capget.2:131
2454 msgid ""
2455 "VFS Capability support creates a file-attribute method for adding "
2456 "capabilities to privileged executables.  This privilege model obsoletes "
2457 "kernel support for one process asynchronously setting the capabilities of "
2458 "another.  That is, with VFS support, for B<capset>()  calls the only "
2459 "permitted values for I<hdrp-E<gt>pid> are 0 or B<getpid>(2), which are "
2460 "equivalent."
2461 msgstr ""
2462
2463 #. type: SS
2464 #: build/C/man2/capget.2:131
2465 #, no-wrap
2466 msgid "Without VFS capability support"
2467 msgstr ""
2468
2469 #. type: Plain text
2470 #: build/C/man2/capget.2:157
2471 msgid ""
2472 "When the kernel does not support VFS capabilities, B<capset>()  calls can "
2473 "operate on the capabilities of the thread specified by the I<pid> field of "
2474 "I<hdrp> when that is nonzero, or on the capabilities of the calling thread "
2475 "if I<pid> is 0.  If I<pid> refers to a single-threaded process, then I<pid> "
2476 "can be specified as a traditional process ID; operating on a thread of a "
2477 "multithreaded process requires a thread ID of the type returned by "
2478 "B<gettid>(2).  For B<capset>(), I<pid> can also be: -1, meaning perform the "
2479 "change on all threads except the caller and B<init>(1); or a value less than "
2480 "-1, in which case the change is applied to all members of the process group "
2481 "whose ID is -I<pid>."
2482 msgstr ""
2483
2484 #. type: Plain text
2485 #: build/C/man2/capget.2:160
2486 msgid "For details on the data, see B<capabilities>(7)."
2487 msgstr ""
2488
2489 #. type: Plain text
2490 #: build/C/man2/capget.2:179
2491 msgid ""
2492 "The calls will fail with the error B<EINVAL>, and set the I<version> field "
2493 "of I<hdrp> to the kernel preferred value of B<_LINUX_CAPABILITY_VERSION_?> "
2494 "when an unsupported I<version> value is specified.  In this way, one can "
2495 "probe what the current preferred capability revision is."
2496 msgstr ""
2497
2498 #. type: Plain text
2499 #: build/C/man2/capget.2:188
2500 msgid ""
2501 "Bad memory address.  I<hdrp> must not be NULL.  I<datap> may be NULL only "
2502 "when the user is trying to determine the preferred capability version format "
2503 "supported by the kernel."
2504 msgstr ""
2505
2506 #. type: TP
2507 #: build/C/man2/capget.2:188 build/C/man7/cpuset.7:1180 build/C/man7/cpuset.7:1189 build/C/man7/cpuset.7:1198 build/C/man7/cpuset.7:1208 build/C/man7/cpuset.7:1217 build/C/man7/cpuset.7:1224 build/C/man7/cpuset.7:1231 build/C/man2/getgroups.2:114 build/C/man2/getgroups.2:121 build/C/man2/getpriority.2:118 build/C/man2/getrlimit.2:471 build/C/man2/getrusage.2:198 build/C/man2/iopl.2:72 build/C/man2/ioprio_set.2:170 build/C/man2/seteuid.2:80 build/C/man2/setgid.2:59 build/C/man2/setpgid.2:225 build/C/man2/setresuid.2:99 build/C/man2/setreuid.2:128 build/C/man2/setuid.2:105 build/C/man2/seccomp.2:373 build/C/man2/seccomp.2:380 build/C/man2/seccomp.2:387 build/C/man2/seccomp.2:393 build/C/man2/seccomp.2:402
2508 #, no-wrap
2509 msgid "B<EINVAL>"
2510 msgstr ""
2511
2512 #. type: Plain text
2513 #: build/C/man2/capget.2:191
2514 msgid "One of the arguments was invalid."
2515 msgstr ""
2516
2517 #. type: Plain text
2518 #: build/C/man2/capget.2:196
2519 msgid ""
2520 "An attempt was made to add a capability to the Permitted set, or to set a "
2521 "capability in the Effective or Inheritable sets that is not in the Permitted "
2522 "set."
2523 msgstr ""
2524
2525 #. type: Plain text
2526 #: build/C/man2/capget.2:215
2527 msgid ""
2528 "The caller attempted to use B<capset>()  to modify the capabilities of a "
2529 "thread other than itself, but lacked sufficient privilege.  For kernels "
2530 "supporting VFS capabilities, this is never permitted.  For kernels lacking "
2531 "VFS support, the B<CAP_SETPCAP> capability is required.  (A bug in kernels "
2532 "before 2.6.11 meant that this error could also occur if a thread without "
2533 "this capability tried to change its own capabilities by specifying the "
2534 "I<pid> field as a nonzero value (i.e., the value returned by B<getpid>(2))  "
2535 "instead of 0.)"
2536 msgstr ""
2537
2538 #. type: TP
2539 #: build/C/man2/capget.2:215 build/C/man7/cpuset.7:1330 build/C/man2/getpriority.2:126 build/C/man2/getrlimit.2:502 build/C/man2/getsid.2:70 build/C/man2/ioprio_set.2:187 build/C/man2/setpgid.2:240 build/C/man2/seccomp.2:426
2540 #, no-wrap
2541 msgid "B<ESRCH>"
2542 msgstr ""
2543
2544 #. type: Plain text
2545 #: build/C/man2/capget.2:218
2546 msgid "No such thread."
2547 msgstr ""
2548
2549 #. type: Plain text
2550 #: build/C/man2/capget.2:220 build/C/man2/ioprio_set.2:198
2551 msgid "These system calls are Linux-specific."
2552 msgstr ""
2553
2554 #. type: Plain text
2555 #: build/C/man2/capget.2:225
2556 msgid ""
2557 "The portable interface to the capability querying and setting functions is "
2558 "provided by the I<libcap> library and is available here:"
2559 msgstr ""
2560
2561 #. type: Plain text
2562 #: build/C/man2/capget.2:228
2563 msgid ""
2564 "E<.UR "
2565 "http://git.kernel.org/cgit\\:/linux\\:/kernel\\:/git\\:/morgan\\:\\:/libcap.git> "
2566 "E<.UE>"
2567 msgstr ""
2568
2569 #. type: Plain text
2570 #: build/C/man2/capget.2:232
2571 msgid "B<clone>(2), B<gettid>(2), B<capabilities>(7)"
2572 msgstr ""
2573
2574 #. type: TH
2575 #: build/C/man7/cpuset.7:25
2576 #, no-wrap
2577 msgid "CPUSET"
2578 msgstr ""
2579
2580 #. type: TH
2581 #: build/C/man7/cpuset.7:25
2582 #, no-wrap
2583 msgid "2014-05-21"
2584 msgstr ""
2585
2586 #. type: Plain text
2587 #: build/C/man7/cpuset.7:28
2588 msgid "cpuset - confine processes to processor and memory node subsets"
2589 msgstr ""
2590
2591 #. type: Plain text
2592 #: build/C/man7/cpuset.7:35
2593 msgid ""
2594 "The cpuset filesystem is a pseudo-filesystem interface to the kernel cpuset "
2595 "mechanism, which is used to control the processor placement and memory "
2596 "placement of processes.  It is commonly mounted at I</dev/cpuset>."
2597 msgstr ""
2598
2599 #. type: Plain text
2600 #: build/C/man7/cpuset.7:52
2601 msgid ""
2602 "On systems with kernels compiled with built in support for cpusets, all "
2603 "processes are attached to a cpuset, and cpusets are always present.  If a "
2604 "system supports cpusets, then it will have the entry B<nodev cpuset> in the "
2605 "file I</proc/filesystems>.  By mounting the cpuset filesystem (see the "
2606 "B<EXAMPLE> section below), the administrator can configure the cpusets on a "
2607 "system to control the processor and memory placement of processes on that "
2608 "system.  By default, if the cpuset configuration on a system is not modified "
2609 "or if the cpuset filesystem is not even mounted, then the cpuset mechanism, "
2610 "though present, has no affect on the system's behavior."
2611 msgstr ""
2612
2613 #. type: Plain text
2614 #: build/C/man7/cpuset.7:54
2615 msgid "A cpuset defines a list of CPUs and memory nodes."
2616 msgstr ""
2617
2618 #. type: Plain text
2619 #: build/C/man7/cpuset.7:63
2620 msgid ""
2621 "The CPUs of a system include all the logical processing units on which a "
2622 "process can execute, including, if present, multiple processor cores within "
2623 "a package and Hyper-Threads within a processor core.  Memory nodes include "
2624 "all distinct banks of main memory; small and SMP systems typically have just "
2625 "one memory node that contains all the system's main memory, while NUMA "
2626 "(non-uniform memory access) systems have multiple memory nodes."
2627 msgstr ""
2628
2629 #. type: Plain text
2630 #: build/C/man7/cpuset.7:73
2631 msgid ""
2632 "Cpusets are represented as directories in a hierarchical pseudo-filesystem, "
2633 "where the top directory in the hierarchy (I</dev/cpuset>)  represents the "
2634 "entire system (all online CPUs and memory nodes)  and any cpuset that is the "
2635 "child (descendant) of another parent cpuset contains a subset of that "
2636 "parent's CPUs and memory nodes.  The directories and files representing "
2637 "cpusets have normal filesystem permissions."
2638 msgstr ""
2639
2640 #. type: Plain text
2641 #: build/C/man7/cpuset.7:84
2642 msgid ""
2643 "Every process in the system belongs to exactly one cpuset.  A process is "
2644 "confined to run only on the CPUs in the cpuset it belongs to, and to "
2645 "allocate memory only on the memory nodes in that cpuset.  When a process "
2646 "B<fork>(2)s, the child process is placed in the same cpuset as its parent.  "
2647 "With sufficient privilege, a process may be moved from one cpuset to another "
2648 "and the allowed CPUs and memory nodes of an existing cpuset may be changed."
2649 msgstr ""
2650
2651 #. type: Plain text
2652 #: build/C/man7/cpuset.7:92
2653 msgid ""
2654 "When the system begins booting, a single cpuset is defined that includes all "
2655 "CPUs and memory nodes on the system, and all processes are in that cpuset.  "
2656 "During the boot process, or later during normal system operation, other "
2657 "cpusets may be created, as subdirectories of this top cpuset, under the "
2658 "control of the system administrator, and processes may be placed in these "
2659 "other cpusets."
2660 msgstr ""
2661
2662 #. type: Plain text
2663 #: build/C/man7/cpuset.7:114
2664 msgid ""
2665 "Cpusets are integrated with the B<sched_setaffinity>(2)  scheduling affinity "
2666 "mechanism and the B<mbind>(2)  and B<set_mempolicy>(2)  memory-placement "
2667 "mechanisms in the kernel.  Neither of these mechanisms let a process make "
2668 "use of a CPU or memory node that is not allowed by that process's cpuset.  "
2669 "If changes to a process's cpuset placement conflict with these other "
2670 "mechanisms, then cpuset placement is enforced even if it means overriding "
2671 "these other mechanisms.  The kernel accomplishes this overriding by silently "
2672 "restricting the CPUs and memory nodes requested by these other mechanisms to "
2673 "those allowed by the invoking process's cpuset.  This can result in these "
2674 "other calls returning an error, if for example, such a call ends up "
2675 "requesting an empty set of CPUs or memory nodes, after that request is "
2676 "restricted to the invoking process's cpuset."
2677 msgstr ""
2678
2679 #. type: Plain text
2680 #: build/C/man7/cpuset.7:120
2681 msgid ""
2682 "Typically, a cpuset is used to manage the CPU and memory-node confinement "
2683 "for a set of cooperating processes such as a batch scheduler job, and these "
2684 "other mechanisms are used to manage the placement of individual processes or "
2685 "memory regions within that set or job."
2686 msgstr ""
2687
2688 #. type: SH
2689 #: build/C/man7/cpuset.7:120
2690 #, no-wrap
2691 msgid "FILES"
2692 msgstr ""
2693
2694 #. type: Plain text
2695 #: build/C/man7/cpuset.7:125
2696 msgid ""
2697 "Each directory below I</dev/cpuset> represents a cpuset and contains a fixed "
2698 "set of pseudo-files describing the state of that cpuset."
2699 msgstr ""
2700
2701 #. type: Plain text
2702 #: build/C/man7/cpuset.7:135
2703 msgid ""
2704 "New cpusets are created using the B<mkdir>(2)  system call or the "
2705 "B<mkdir>(1)  command.  The properties of a cpuset, such as its flags, "
2706 "allowed CPUs and memory nodes, and attached processes, are queried and "
2707 "modified by reading or writing to the appropriate file in that cpuset's "
2708 "directory, as listed below."
2709 msgstr ""
2710
2711 #. type: Plain text
2712 #: build/C/man7/cpuset.7:141
2713 msgid ""
2714 "The pseudo-files in each cpuset directory are automatically created when the "
2715 "cpuset is created, as a result of the B<mkdir>(2)  invocation.  It is not "
2716 "possible to directly add or remove these pseudo-files."
2717 msgstr ""
2718
2719 #. type: Plain text
2720 #: build/C/man7/cpuset.7:149
2721 msgid ""
2722 "A cpuset directory that contains no child cpuset directories, and has no "
2723 "attached processes, can be removed using B<rmdir>(2)  or B<rmdir>(1).  It is "
2724 "not necessary, or possible, to remove the pseudo-files inside the directory "
2725 "before removing it."
2726 msgstr ""
2727
2728 #. type: Plain text
2729 #: build/C/man7/cpuset.7:163
2730 msgid ""
2731 "The pseudo-files in each cpuset directory are small text files that may be "
2732 "read and written using traditional shell utilities such as B<cat>(1), and "
2733 "B<echo>(1), or from a program by using file I/O library functions or system "
2734 "calls, such as B<open>(2), B<read>(2), B<write>(2), and B<close>(2)."
2735 msgstr ""
2736
2737 #.  ====================== tasks ======================
2738 #. type: Plain text
2739 #: build/C/man7/cpuset.7:168
2740 msgid ""
2741 "The pseudo-files in a cpuset directory represent internal kernel state and "
2742 "do not have any persistent image on disk.  Each of these per-cpuset files is "
2743 "listed and described below."
2744 msgstr ""
2745
2746 #. type: TP
2747 #: build/C/man7/cpuset.7:168
2748 #, no-wrap
2749 msgid "I<tasks>"
2750 msgstr ""
2751
2752 #. type: Plain text
2753 #: build/C/man7/cpuset.7:178
2754 msgid ""
2755 "List of the process IDs (PIDs) of the processes in that cpuset.  The list is "
2756 "formatted as a series of ASCII decimal numbers, each followed by a newline.  "
2757 "A process may be added to a cpuset (automatically removing it from the "
2758 "cpuset that previously contained it) by writing its PID to that cpuset's "
2759 "I<tasks> file (with or without a trailing newline)."
2760 msgstr ""
2761
2762 #.  =================== notify_on_release ===================
2763 #. type: Plain text
2764 #: build/C/man7/cpuset.7:186
2765 msgid ""
2766 "B<Warning:> only one PID may be written to the I<tasks> file at a time.  If "
2767 "a string is written that contains more than one PID, only the first one will "
2768 "be used."
2769 msgstr ""
2770
2771 #. type: TP
2772 #: build/C/man7/cpuset.7:186
2773 #, no-wrap
2774 msgid "I<notify_on_release>"
2775 msgstr ""
2776
2777 #.  ====================== cpus ======================
2778 #. type: Plain text
2779 #: build/C/man7/cpuset.7:195
2780 msgid ""
2781 "Flag (0 or 1).  If set (1), that cpuset will receive special handling after "
2782 "it is released, that is, after all processes cease using it (i.e., terminate "
2783 "or are moved to a different cpuset)  and all child cpuset directories have "
2784 "been removed.  See the B<Notify On Release> section, below."
2785 msgstr ""
2786
2787 #. type: TP
2788 #: build/C/man7/cpuset.7:195
2789 #, no-wrap
2790 msgid "I<cpuset.cpus>"
2791 msgstr ""
2792
2793 #. type: Plain text
2794 #: build/C/man7/cpuset.7:202
2795 msgid ""
2796 "List of the physical numbers of the CPUs on which processes in that cpuset "
2797 "are allowed to execute.  See B<List Format> below for a description of the "
2798 "format of I<cpus>."
2799 msgstr ""
2800
2801 #.  ==================== cpu_exclusive ====================
2802 #. type: Plain text
2803 #: build/C/man7/cpuset.7:208
2804 msgid ""
2805 "The CPUs allowed to a cpuset may be changed by writing a new list to its "
2806 "I<cpus> file."
2807 msgstr ""
2808
2809 #. type: TP
2810 #: build/C/man7/cpuset.7:208
2811 #, no-wrap
2812 msgid "I<cpuset.cpu_exclusive>"
2813 msgstr ""
2814
2815 #. type: Plain text
2816 #: build/C/man7/cpuset.7:215
2817 msgid ""
2818 "Flag (0 or 1).  If set (1), the cpuset has exclusive use of its CPUs (no "
2819 "sibling or cousin cpuset may overlap CPUs).  By default this is off (0).  "
2820 "Newly created cpusets also initially default this to off (0)."
2821 msgstr ""
2822
2823 #.  ====================== mems ======================
2824 #. type: Plain text
2825 #: build/C/man7/cpuset.7:237
2826 msgid ""
2827 "Two cpusets are I<sibling> cpusets if they share the same parent cpuset in "
2828 "the I</dev/cpuset> hierarchy.  Two cpusets are I<cousin> cpusets if neither "
2829 "is the ancestor of the other.  Regardless of the I<cpu_exclusive> setting, "
2830 "if one cpuset is the ancestor of another, and if both of these cpusets have "
2831 "nonempty I<cpus>, then their I<cpus> must overlap, because the I<cpus> of "
2832 "any cpuset are always a subset of the I<cpus> of its parent cpuset."
2833 msgstr ""
2834
2835 #. type: TP
2836 #: build/C/man7/cpuset.7:237
2837 #, no-wrap
2838 msgid "I<cpuset.mems>"
2839 msgstr ""
2840
2841 #.  ==================== mem_exclusive ====================
2842 #. type: Plain text
2843 #: build/C/man7/cpuset.7:245
2844 msgid ""
2845 "List of memory nodes on which processes in this cpuset are allowed to "
2846 "allocate memory.  See B<List Format> below for a description of the format "
2847 "of I<mems>."
2848 msgstr ""
2849
2850 #. type: TP
2851 #: build/C/man7/cpuset.7:245
2852 #, no-wrap
2853 msgid "I<cpuset.mem_exclusive>"
2854 msgstr ""
2855
2856 #. type: Plain text
2857 #: build/C/man7/cpuset.7:253
2858 msgid ""
2859 "Flag (0 or 1).  If set (1), the cpuset has exclusive use of its memory nodes "
2860 "(no sibling or cousin may overlap).  Also if set (1), the cpuset is a "
2861 "B<Hardwall> cpuset (see below).  By default this is off (0).  Newly created "
2862 "cpusets also initially default this to off (0)."
2863 msgstr ""
2864
2865 #.  ==================== mem_hardwall ====================
2866 #. type: Plain text
2867 #: build/C/man7/cpuset.7:261
2868 msgid ""
2869 "Regardless of the I<mem_exclusive> setting, if one cpuset is the ancestor of "
2870 "another, then their memory nodes must overlap, because the memory nodes of "
2871 "any cpuset are always a subset of the memory nodes of that cpuset's parent "
2872 "cpuset."
2873 msgstr ""
2874
2875 #. type: TP
2876 #: build/C/man7/cpuset.7:261
2877 #, no-wrap
2878 msgid "I<cpuset.mem_hardwall> (since Linux 2.6.26)"
2879 msgstr ""
2880
2881 #.  ==================== memory_migrate ====================
2882 #. type: Plain text
2883 #: build/C/man7/cpuset.7:272
2884 msgid ""
2885 "Flag (0 or 1).  If set (1), the cpuset is a B<Hardwall> cpuset (see below).  "
2886 "Unlike B<mem_exclusive>, there is no constraint on whether cpusets marked "
2887 "B<mem_hardwall> may have overlapping memory nodes with sibling or cousin "
2888 "cpusets.  By default this is off (0).  Newly created cpusets also initially "
2889 "default this to off (0)."
2890 msgstr ""
2891
2892 #. type: TP
2893 #: build/C/man7/cpuset.7:272
2894 #, no-wrap
2895 msgid "I<cpuset.memory_migrate> (since Linux 2.6.16)"
2896 msgstr ""
2897
2898 #.  ==================== memory_pressure ====================
2899 #. type: Plain text
2900 #: build/C/man7/cpuset.7:279
2901 msgid ""
2902 "Flag (0 or 1).  If set (1), then memory migration is enabled.  By default "
2903 "this is off (0).  See the B<Memory Migration> section, below."
2904 msgstr ""
2905
2906 #. type: TP
2907 #: build/C/man7/cpuset.7:279
2908 #, no-wrap
2909 msgid "I<cpuset.memory_pressure> (since Linux 2.6.16)"
2910 msgstr ""
2911
2912 #.  ================= memory_pressure_enabled =================
2913 #. type: Plain text
2914 #: build/C/man7/cpuset.7:292
2915 msgid ""
2916 "A measure of how much memory pressure the processes in this cpuset are "
2917 "causing.  See the B<Memory Pressure> section, below.  Unless "
2918 "I<memory_pressure_enabled> is enabled, always has value zero (0).  This file "
2919 "is read-only.  See the B<WARNINGS> section, below."
2920 msgstr ""
2921
2922 #. type: TP
2923 #: build/C/man7/cpuset.7:292
2924 #, no-wrap
2925 msgid "I<cpuset.memory_pressure_enabled> (since Linux 2.6.16)"
2926 msgstr ""
2927
2928 #.  ================== memory_spread_page ==================
2929 #. type: Plain text
2930 #: build/C/man7/cpuset.7:304
2931 msgid ""
2932 "Flag (0 or 1).  This file is present only in the root cpuset, normally "
2933 "I</dev/cpuset>.  If set (1), the I<memory_pressure> calculations are enabled "
2934 "for all cpusets in the system.  By default this is off (0).  See the "
2935 "B<Memory Pressure> section, below."
2936 msgstr ""
2937
2938 #. type: TP
2939 #: build/C/man7/cpuset.7:304
2940 #, no-wrap
2941 msgid "I<cpuset.memory_spread_page> (since Linux 2.6.17)"
2942 msgstr ""
2943
2944 #.  ================== memory_spread_slab ==================
2945 #. type: Plain text
2946 #: build/C/man7/cpuset.7:314
2947 msgid ""
2948 "Flag (0 or 1).  If set (1), pages in the kernel page cache (filesystem "
2949 "buffers) are uniformly spread across the cpuset.  By default this is off (0) "
2950 "in the top cpuset, and inherited from the parent cpuset in newly created "
2951 "cpusets.  See the B<Memory Spread> section, below."
2952 msgstr ""
2953
2954 #. type: TP
2955 #: build/C/man7/cpuset.7:314
2956 #, no-wrap
2957 msgid "I<cpuset.memory_spread_slab> (since Linux 2.6.17)"
2958 msgstr ""
2959
2960 #.  ================== sched_load_balance ==================
2961 #. type: Plain text
2962 #: build/C/man7/cpuset.7:325
2963 msgid ""
2964 "Flag (0 or 1).  If set (1), the kernel slab caches for file I/O (directory "
2965 "and inode structures) are uniformly spread across the cpuset.  By default "
2966 "this is off (0) in the top cpuset, and inherited from the parent cpuset in "
2967 "newly created cpusets.  See the B<Memory Spread> section, below."
2968 msgstr ""
2969
2970 #. type: TP
2971 #: build/C/man7/cpuset.7:325
2972 #, no-wrap
2973 msgid "I<cpuset.sched_load_balance> (since Linux 2.6.24)"
2974 msgstr ""
2975
2976 #.  ================== sched_relax_domain_level ==================
2977 #. type: Plain text
2978 #: build/C/man7/cpuset.7:339
2979 msgid ""
2980 "Flag (0 or 1).  If set (1, the default) the kernel will automatically load "
2981 "balance processes in that cpuset over the allowed CPUs in that cpuset.  If "
2982 "cleared (0) the kernel will avoid load balancing processes in this cpuset, "
2983 "I<unless> some other cpuset with overlapping CPUs has its "
2984 "I<sched_load_balance> flag set.  See B<Scheduler Load Balancing>, below, for "
2985 "further details."
2986 msgstr ""
2987
2988 #. type: TP
2989 #: build/C/man7/cpuset.7:339
2990 #, no-wrap
2991 msgid "I<cpuset.sched_relax_domain_level> (since Linux 2.6.26)"
2992 msgstr ""
2993
2994 #.  ================== proc cpuset ==================
2995 #. type: Plain text
2996 #: build/C/man7/cpuset.7:359
2997 msgid ""
2998 "Integer, between -1 and a small positive value.  The "
2999 "I<sched_relax_domain_level> controls the width of the range of CPUs over "
3000 "which the kernel scheduler performs immediate rebalancing of runnable tasks "
3001 "across CPUs.  If I<sched_load_balance> is disabled, then the setting of "
3002 "I<sched_relax_domain_level> does not matter, as no such load balancing is "
3003 "done.  If I<sched_load_balance> is enabled, then the higher the value of the "
3004 "I<sched_relax_domain_level>, the wider the range of CPUs over which "
3005 "immediate load balancing is attempted.  See B<Scheduler Relax Domain Level>, "
3006 "below, for further details."
3007 msgstr ""
3008
3009 #.  ================== proc status ==================
3010 #. type: Plain text
3011 #: build/C/man7/cpuset.7:367
3012 msgid ""
3013 "In addition to the above pseudo-files in each directory below "
3014 "I</dev/cpuset>, each process has a pseudo-file, "
3015 "I</proc/E<lt>pidE<gt>/cpuset>, that displays the path of the process's "
3016 "cpuset directory relative to the root of the cpuset filesystem."
3017 msgstr ""
3018
3019 #. type: Plain text
3020 #: build/C/man7/cpuset.7:378
3021 msgid ""
3022 "Also the I</proc/E<lt>pidE<gt>/status> file for each process has four added "
3023 "lines, displaying the process's I<Cpus_allowed> (on which CPUs it may be "
3024 "scheduled) and I<Mems_allowed> (on which memory nodes it may obtain memory), "
3025 "in the two formats B<Mask Format> and B<List Format> (see below)  as shown "
3026 "in the following example:"
3027 msgstr ""
3028
3029 #. type: Plain text
3030 #: build/C/man7/cpuset.7:385
3031 #, no-wrap
3032 msgid ""
3033 "Cpus_allowed:   ffffffff,ffffffff,ffffffff,ffffffff\n"
3034 "Cpus_allowed_list:     0-127\n"
3035 "Mems_allowed:   ffffffff,ffffffff\n"
3036 "Mems_allowed_list:     0-63\n"
3037 msgstr ""
3038
3039 #.  ================== EXTENDED CAPABILITIES ==================
3040 #. type: Plain text
3041 #: build/C/man7/cpuset.7:391
3042 msgid ""
3043 "The \"allowed\" fields were added in Linux 2.6.24; the \"allowed_list\" "
3044 "fields were added in Linux 2.6.26."
3045 msgstr ""
3046
3047 #. type: SH
3048 #: build/C/man7/cpuset.7:391
3049 #, no-wrap
3050 msgid "EXTENDED CAPABILITIES"
3051 msgstr ""
3052
3053 #.  ================== Exclusive Cpusets ==================
3054 #. type: Plain text
3055 #: build/C/man7/cpuset.7:399
3056 msgid ""
3057 "In addition to controlling which I<cpus> and I<mems> a process is allowed to "
3058 "use, cpusets provide the following extended capabilities."
3059 msgstr ""
3060
3061 #. type: SS
3062 #: build/C/man7/cpuset.7:399
3063 #, no-wrap
3064 msgid "Exclusive cpusets"
3065 msgstr ""
3066
3067 #. type: Plain text
3068 #: build/C/man7/cpuset.7:406
3069 msgid ""
3070 "If a cpuset is marked I<cpu_exclusive> or I<mem_exclusive>, no other cpuset, "
3071 "other than a direct ancestor or descendant, may share any of the same CPUs "
3072 "or memory nodes."
3073 msgstr ""
3074
3075 #.  ================== Hardwall ==================
3076 #. type: Plain text
3077 #: build/C/man7/cpuset.7:432
3078 msgid ""
3079 "A cpuset that is I<mem_exclusive> restricts kernel allocations for buffer "
3080 "cache pages and other internal kernel data pages commonly shared by the "
3081 "kernel across multiple users.  All cpusets, whether I<mem_exclusive> or not, "
3082 "restrict allocations of memory for user space.  This enables configuring a "
3083 "system so that several independent jobs can share common kernel data, while "
3084 "isolating each job's user allocation in its own cpuset.  To do this, "
3085 "construct a large I<mem_exclusive> cpuset to hold all the jobs, and "
3086 "construct child, non-I<mem_exclusive> cpusets for each individual job.  Only "
3087 "a small amount of kernel memory, such as requests from interrupt handlers, "
3088 "is allowed to be placed on memory nodes outside even a I<mem_exclusive> "
3089 "cpuset."
3090 msgstr ""
3091
3092 #. type: SS
3093 #: build/C/man7/cpuset.7:432
3094 #, no-wrap
3095 msgid "Hardwall"
3096 msgstr ""
3097
3098 #. type: Plain text
3099 #: build/C/man7/cpuset.7:447
3100 msgid ""
3101 "A cpuset that has I<mem_exclusive> or I<mem_hardwall> set is a I<hardwall> "
3102 "cpuset.  A I<hardwall> cpuset restricts kernel allocations for page, buffer, "
3103 "and other data commonly shared by the kernel across multiple users.  All "
3104 "cpusets, whether I<hardwall> or not, restrict allocations of memory for user "
3105 "space."
3106 msgstr ""
3107
3108 #. type: Plain text
3109 #: build/C/man7/cpuset.7:458
3110 msgid ""
3111 "This enables configuring a system so that several independent jobs can share "
3112 "common kernel data, such as filesystem pages, while isolating each job's "
3113 "user allocation in its own cpuset.  To do this, construct a large "
3114 "I<hardwall> cpuset to hold all the jobs, and construct child cpusets for "
3115 "each individual job which are not I<hardwall> cpusets."
3116 msgstr ""
3117
3118 #.  ================== Notify On Release ==================
3119 #. type: Plain text
3120 #: build/C/man7/cpuset.7:464
3121 msgid ""
3122 "Only a small amount of kernel memory, such as requests from interrupt "
3123 "handlers, is allowed to be taken outside even a I<hardwall> cpuset."
3124 msgstr ""
3125
3126 #. type: SS
3127 #: build/C/man7/cpuset.7:464
3128 #, no-wrap
3129 msgid "Notify on release"
3130 msgstr ""
3131
3132 #. type: Plain text
3133 #: build/C/man7/cpuset.7:476
3134 msgid ""
3135 "If the I<notify_on_release> flag is enabled (1) in a cpuset, then whenever "
3136 "the last process in the cpuset leaves (exits or attaches to some other "
3137 "cpuset)  and the last child cpuset of that cpuset is removed, the kernel "
3138 "will run the command I</sbin/cpuset_release_agent>, supplying the pathname "
3139 "(relative to the mount point of the cpuset filesystem) of the abandoned "
3140 "cpuset.  This enables automatic removal of abandoned cpusets."
3141 msgstr ""
3142
3143 #. type: Plain text
3144 #: build/C/man7/cpuset.7:484
3145 msgid ""
3146 "The default value of I<notify_on_release> in the root cpuset at system boot "
3147 "is disabled (0).  The default value of other cpusets at creation is the "
3148 "current value of their parent's I<notify_on_release> setting."
3149 msgstr ""
3150
3151 #. type: Plain text
3152 #: build/C/man7/cpuset.7:492
3153 msgid ""
3154 "The command I</sbin/cpuset_release_agent> is invoked, with the name "
3155 "(I</dev/cpuset> relative path)  of the to-be-released cpuset in I<argv[1]>."
3156 msgstr ""
3157
3158 #. type: Plain text
3159 #: build/C/man7/cpuset.7:496
3160 msgid ""
3161 "The usual contents of the command I</sbin/cpuset_release_agent> is simply "
3162 "the shell script:"
3163 msgstr ""
3164
3165 #. type: Plain text
3166 #: build/C/man7/cpuset.7:501
3167 #, no-wrap
3168 msgid ""
3169 "#!/bin/sh\n"
3170 "rmdir /dev/cpuset/$1\n"
3171 msgstr ""
3172
3173 #.  ================== Memory Pressure ==================
3174 #. type: Plain text
3175 #: build/C/man7/cpuset.7:509
3176 msgid ""
3177 "As with other flag values below, this flag can be changed by writing an "
3178 "ASCII number 0 or 1 (with optional trailing newline)  into the file, to "
3179 "clear or set the flag, respectively."
3180 msgstr ""
3181
3182 #. type: SS
3183 #: build/C/man7/cpuset.7:509
3184 #, no-wrap
3185 msgid "Memory pressure"
3186 msgstr ""
3187
3188 #. type: Plain text
3189 #: build/C/man7/cpuset.7:515
3190 msgid ""
3191 "The I<memory_pressure> of a cpuset provides a simple per-cpuset running "
3192 "average of the rate that the processes in a cpuset are attempting to free up "
3193 "in-use memory on the nodes of the cpuset to satisfy additional memory "
3194 "requests."
3195 msgstr ""
3196
3197 #. type: Plain text
3198 #: build/C/man7/cpuset.7:519
3199 msgid ""
3200 "This enables batch managers that are monitoring jobs running in dedicated "
3201 "cpusets to efficiently detect what level of memory pressure that job is "
3202 "causing."
3203 msgstr ""
3204
3205 #. type: Plain text
3206 #: build/C/man7/cpuset.7:526
3207 msgid ""
3208 "This is useful both on tightly managed systems running a wide mix of "
3209 "submitted jobs, which may choose to terminate or reprioritize jobs that are "
3210 "trying to use more memory than allowed on the nodes assigned them, and with "
3211 "tightly coupled, long-running, massively parallel scientific computing jobs "
3212 "that will dramatically fail to meet required performance goals if they start "
3213 "to use more memory than allowed to them."
3214 msgstr ""
3215
3216 #. type: Plain text
3217 #: build/C/man7/cpuset.7:531
3218 msgid ""
3219 "This mechanism provides a very economical way for the batch manager to "
3220 "monitor a cpuset for signs of memory pressure.  It's up to the batch manager "
3221 "or other user code to decide what action to take if it detects signs of "
3222 "memory pressure."
3223 msgstr ""
3224
3225 #. type: Plain text
3226 #: build/C/man7/cpuset.7:538
3227 msgid ""
3228 "Unless memory pressure calculation is enabled by setting the pseudo-file "
3229 "I</dev/cpuset/cpuset.memory_pressure_enabled>, it is not computed for any "
3230 "cpuset, and reads from any I<memory_pressure> always return zero, as "
3231 "represented by the ASCII string \"0\\en\".  See the B<WARNINGS> section, "
3232 "below."
3233 msgstr ""
3234
3235 #. type: Plain text
3236 #: build/C/man7/cpuset.7:540
3237 msgid "A per-cpuset, running average is employed for the following reasons:"
3238 msgstr ""
3239
3240 #. type: Plain text
3241 #: build/C/man7/cpuset.7:545
3242 msgid ""
3243 "Because this meter is per-cpuset rather than per-process or per virtual "
3244 "memory region, the system load imposed by a batch scheduler monitoring this "
3245 "metric is sharply reduced on large systems, because a scan of the tasklist "
3246 "can be avoided on each set of queries."
3247 msgstr ""
3248
3249 #. type: Plain text
3250 #: build/C/man7/cpuset.7:550
3251 msgid ""
3252 "Because this meter is a running average rather than an accumulating counter, "
3253 "a batch scheduler can detect memory pressure with a single read, instead of "
3254 "having to read and accumulate results for a period of time."
3255 msgstr ""
3256
3257 #. type: Plain text
3258 #: build/C/man7/cpuset.7:556
3259 msgid ""
3260 "Because this meter is per-cpuset rather than per-process, the batch "
3261 "scheduler can obtain the key information\\(emmemory pressure in a "
3262 "cpuset\\(emwith a single read, rather than having to query and accumulate "
3263 "results over all the (dynamically changing)  set of processes in the cpuset."
3264 msgstr ""
3265
3266 #. type: Plain text
3267 #: build/C/man7/cpuset.7:564
3268 msgid ""
3269 "The I<memory_pressure> of a cpuset is calculated using a per-cpuset simple "
3270 "digital filter that is kept within the kernel.  For each cpuset, this filter "
3271 "tracks the recent rate at which processes attached to that cpuset enter the "
3272 "kernel direct reclaim code."
3273 msgstr ""
3274
3275 #. type: Plain text
3276 #: build/C/man7/cpuset.7:573
3277 msgid ""
3278 "The kernel direct reclaim code is entered whenever a process has to satisfy "
3279 "a memory page request by first finding some other page to repurpose, due to "
3280 "lack of any readily available already free pages.  Dirty filesystem pages "
3281 "are repurposed by first writing them to disk.  Unmodified filesystem buffer "
3282 "pages are repurposed by simply dropping them, though if that page is needed "
3283 "again, it will have to be reread from disk."
3284 msgstr ""
3285
3286 #.  ================== Memory Spread ==================
3287 #. type: Plain text
3288 #: build/C/man7/cpuset.7:581
3289 msgid ""
3290 "The I<cpuset.memory_pressure> file provides an integer number representing "
3291 "the recent (half-life of 10 seconds) rate of entries to the direct reclaim "
3292 "code caused by any process in the cpuset, in units of reclaims attempted per "
3293 "second, times 1000."
3294 msgstr ""
3295
3296 #. type: SS
3297 #: build/C/man7/cpuset.7:581
3298 #, no-wrap
3299 msgid "Memory spread"
3300 msgstr ""
3301
3302 #. type: Plain text
3303 #: build/C/man7/cpuset.7:589
3304 msgid ""
3305 "There are two Boolean flag files per cpuset that control where the kernel "
3306 "allocates pages for the filesystem buffers and related in-kernel data "
3307 "structures.  They are called I<cpuset.memory_spread_page> and "
3308 "I<cpuset.memory_spread_slab>."
3309 msgstr ""
3310
3311 #. type: Plain text
3312 #: build/C/man7/cpuset.7:596
3313 msgid ""
3314 "If the per-cpuset Boolean flag file I<cpuset.memory_spread_page> is set, "
3315 "then the kernel will spread the filesystem buffers (page cache) evenly over "
3316 "all the nodes that the faulting process is allowed to use, instead of "
3317 "preferring to put those pages on the node where the process is running."
3318 msgstr ""
3319
3320 #. type: Plain text
3321 #: build/C/man7/cpuset.7:604
3322 msgid ""
3323 "If the per-cpuset Boolean flag file I<cpuset.memory_spread_slab> is set, "
3324 "then the kernel will spread some filesystem-related slab caches, such as "
3325 "those for inodes and directory entries, evenly over all the nodes that the "
3326 "faulting process is allowed to use, instead of preferring to put those pages "
3327 "on the node where the process is running."
3328 msgstr ""
3329
3330 #. type: Plain text
3331 #: build/C/man7/cpuset.7:609
3332 msgid ""
3333 "The setting of these flags does not affect the data segment (see B<brk>(2))  "
3334 "or stack segment pages of a process."
3335 msgstr ""
3336
3337 #. type: Plain text
3338 #: build/C/man7/cpuset.7:617
3339 msgid ""
3340 "By default, both kinds of memory spreading are off and the kernel prefers to "
3341 "allocate memory pages on the node local to where the requesting process is "
3342 "running.  If that node is not allowed by the process's NUMA memory policy or "
3343 "cpuset configuration or if there are insufficient free memory pages on that "
3344 "node, then the kernel looks for the nearest node that is allowed and has "
3345 "sufficient free memory."
3346 msgstr ""
3347
3348 #. type: Plain text
3349 #: build/C/man7/cpuset.7:620
3350 msgid ""
3351 "When new cpusets are created, they inherit the memory spread settings of "
3352 "their parent."
3353 msgstr ""
3354
3355 #. type: Plain text
3356 #: build/C/man7/cpuset.7:635
3357 msgid ""
3358 "Setting memory spreading causes allocations for the affected page or slab "
3359 "caches to ignore the process's NUMA memory policy and be spread instead.  "
3360 "However, the effect of these changes in memory placement caused by "
3361 "cpuset-specified memory spreading is hidden from the B<mbind>(2)  or "
3362 "B<set_mempolicy>(2)  calls.  These two NUMA memory policy calls always "
3363 "appear to behave as if no cpuset-specified memory spreading is in effect, "
3364 "even if it is.  If cpuset memory spreading is subsequently turned off, the "
3365 "NUMA memory policy most recently specified by these calls is automatically "
3366 "reapplied."
3367 msgstr ""
3368
3369 #. type: Plain text
3370 #: build/C/man7/cpuset.7:644
3371 msgid ""
3372 "Both I<cpuset.memory_spread_page> and I<cpuset.memory_spread_slab> are "
3373 "Boolean flag files.  By default they contain \"0\", meaning that the feature "
3374 "is off for that cpuset.  If a \"1\" is written to that file, that turns the "
3375 "named feature on."
3376 msgstr ""
3377
3378 #. type: Plain text
3379 #: build/C/man7/cpuset.7:647
3380 msgid ""
3381 "Cpuset-specified memory spreading behaves similarly to what is known (in "
3382 "other contexts) as round-robin or interleave memory placement."
3383 msgstr ""
3384
3385 #. type: Plain text
3386 #: build/C/man7/cpuset.7:650
3387 msgid ""
3388 "Cpuset-specified memory spreading can provide substantial performance "
3389 "improvements for jobs that:"
3390 msgstr ""
3391
3392 #. type: IP
3393 #: build/C/man7/cpuset.7:650 build/C/man7/user_namespaces.7:384
3394 #, no-wrap
3395 msgid "a)"
3396 msgstr ""
3397
3398 #. type: Plain text
3399 #: build/C/man7/cpuset.7:654
3400 msgid ""
3401 "need to place thread-local data on memory nodes close to the CPUs which are "
3402 "running the threads that most frequently access that data; but also"
3403 msgstr ""
3404
3405 #. type: IP
3406 #: build/C/man7/cpuset.7:654 build/C/man7/user_namespaces.7:389
3407 #, no-wrap
3408 msgid "b)"
3409 msgstr ""
3410
3411 #. type: Plain text
3412 #: build/C/man7/cpuset.7:657
3413 msgid ""
3414 "need to access large filesystem data sets that must to be spread across the "
3415 "several nodes in the job's cpuset in order to fit."
3416 msgstr ""
3417
3418 #.  ================== Memory Migration ==================
3419 #. type: Plain text
3420 #: build/C/man7/cpuset.7:664
3421 msgid ""
3422 "Without this policy, the memory allocation across the nodes in the job's "
3423 "cpuset can become very uneven, especially for jobs that might have just a "
3424 "single thread initializing or reading in the data set."
3425 msgstr ""
3426
3427 #. type: SS
3428 #: build/C/man7/cpuset.7:664
3429 #, no-wrap
3430 msgid "Memory migration"
3431 msgstr ""
3432
3433 #. type: Plain text
3434 #: build/C/man7/cpuset.7:673
3435 msgid ""
3436 "Normally, under the default setting (disabled) of I<cpuset.memory_migrate>, "
3437 "once a page is allocated (given a physical page of main memory), then that "
3438 "page stays on whatever node it was allocated, so long as it remains "
3439 "allocated, even if the cpuset's memory-placement policy I<mems> subsequently "
3440 "changes."
3441 msgstr ""
3442
3443 #. type: Plain text
3444 #: build/C/man7/cpuset.7:679
3445 msgid ""
3446 "When memory migration is enabled in a cpuset, if the I<mems> setting of the "
3447 "cpuset is changed, then any memory page in use by any process in the cpuset "
3448 "that is on a memory node that is no longer allowed will be migrated to a "
3449 "memory node that is allowed."
3450 msgstr ""
3451
3452 #. type: Plain text
3453 #: build/C/man7/cpuset.7:685
3454 msgid ""
3455 "Furthermore, if a process is moved into a cpuset with I<memory_migrate> "
3456 "enabled, any memory pages it uses that were on memory nodes allowed in its "
3457 "previous cpuset, but which are not allowed in its new cpuset, will be "
3458 "migrated to a memory node allowed in the new cpuset."
3459 msgstr ""
3460
3461 #.  ================== Scheduler Load Balancing ==================
3462 #. type: Plain text
3463 #: build/C/man7/cpuset.7:693
3464 msgid ""
3465 "The relative placement of a migrated page within the cpuset is preserved "
3466 "during these migration operations if possible.  For example, if the page was "
3467 "on the second valid node of the prior cpuset, then the page will be placed "
3468 "on the second valid node of the new cpuset, if possible."
3469 msgstr ""
3470
3471 #. type: SS
3472 #: build/C/man7/cpuset.7:693
3473 #, no-wrap
3474 msgid "Scheduler load balancing"
3475 msgstr ""
3476
3477 #. type: Plain text
3478 #: build/C/man7/cpuset.7:700
3479 msgid ""
3480 "The kernel scheduler automatically load balances processes.  If one CPU is "
3481 "underutilized, the kernel will look for processes on other more overloaded "
3482 "CPUs and move those processes to the underutilized CPU, within the "
3483 "constraints of such placement mechanisms as cpusets and "
3484 "B<sched_setaffinity>(2)."
3485 msgstr ""
3486
3487 #. type: Plain text
3488 #: build/C/man7/cpuset.7:713
3489 msgid ""
3490 "The algorithmic cost of load balancing and its impact on key shared kernel "
3491 "data structures such as the process list increases more than linearly with "
3492 "the number of CPUs being balanced.  For example, it costs more to load "
3493 "balance across one large set of CPUs than it does to balance across two "
3494 "smaller sets of CPUs, each of half the size of the larger set.  (The precise "
3495 "relationship between the number of CPUs being balanced and the cost of load "
3496 "balancing depends on implementation details of the kernel process scheduler, "
3497 "which is subject to change over time, as improved kernel scheduler "
3498 "algorithms are implemented.)"
3499 msgstr ""
3500
3501 #. type: Plain text
3502 #: build/C/man7/cpuset.7:719
3503 msgid ""
3504 "The per-cpuset flag I<sched_load_balance> provides a mechanism to suppress "
3505 "this automatic scheduler load balancing in cases where it is not needed and "
3506 "suppressing it would have worthwhile performance benefits."
3507 msgstr ""
3508
3509 #. type: Plain text
3510 #: build/C/man7/cpuset.7:723
3511 msgid ""
3512 "By default, load balancing is done across all CPUs, except those marked "
3513 "isolated using the kernel boot time \"isolcpus=\" argument.  (See "
3514 "B<Scheduler Relax Domain Level>, below, to change this default.)"
3515 msgstr ""
3516
3517 #. type: Plain text
3518 #: build/C/man7/cpuset.7:726
3519 msgid ""
3520 "This default load balancing across all CPUs is not well suited to the "
3521 "following two situations:"
3522 msgstr ""
3523
3524 #. type: Plain text
3525 #: build/C/man7/cpuset.7:730
3526 msgid ""
3527 "On large systems, load balancing across many CPUs is expensive.  If the "
3528 "system is managed using cpusets to place independent jobs on separate sets "
3529 "of CPUs, full load balancing is unnecessary."
3530 msgstr ""
3531
3532 #. type: Plain text
3533 #: build/C/man7/cpuset.7:734
3534 msgid ""
3535 "Systems supporting real-time on some CPUs need to minimize system overhead "
3536 "on those CPUs, including avoiding process load balancing if that is not "
3537 "needed."
3538 msgstr ""
3539
3540 #. type: Plain text
3541 #: build/C/man7/cpuset.7:744
3542 msgid ""
3543 "When the per-cpuset flag I<sched_load_balance> is enabled (the default "
3544 "setting), it requests load balancing across all the CPUs in that cpuset's "
3545 "allowed CPUs, ensuring that load balancing can move a process (not otherwise "
3546 "pinned, as by B<sched_setaffinity>(2))  from any CPU in that cpuset to any "
3547 "other."
3548 msgstr ""
3549
3550 #. type: Plain text
3551 #: build/C/man7/cpuset.7:753
3552 msgid ""
3553 "When the per-cpuset flag I<sched_load_balance> is disabled, then the "
3554 "scheduler will avoid load balancing across the CPUs in that cpuset, "
3555 "I<except> in so far as is necessary because some overlapping cpuset has "
3556 "I<sched_load_balance> enabled."
3557 msgstr ""
3558
3559 #. type: Plain text
3560 #: build/C/man7/cpuset.7:761
3561 msgid ""
3562 "So, for example, if the top cpuset has the flag I<sched_load_balance> "
3563 "enabled, then the scheduler will load balance across all CPUs, and the "
3564 "setting of the I<sched_load_balance> flag in other cpusets has no effect, as "
3565 "we're already fully load balancing."
3566 msgstr ""
3567
3568 #. type: Plain text
3569 #: build/C/man7/cpuset.7:766
3570 msgid ""
3571 "Therefore in the above two situations, the flag I<sched_load_balance> should "
3572 "be disabled in the top cpuset, and only some of the smaller, child cpusets "
3573 "would have this flag enabled."
3574 msgstr ""
3575
3576 #. type: Plain text
3577 #: build/C/man7/cpuset.7:774
3578 msgid ""
3579 "When doing this, you don't usually want to leave any unpinned processes in "
3580 "the top cpuset that might use nontrivial amounts of CPU, as such processes "
3581 "may be artificially constrained to some subset of CPUs, depending on the "
3582 "particulars of this flag setting in descendant cpusets.  Even if such a "
3583 "process could use spare CPU cycles in some other CPUs, the kernel scheduler "
3584 "might not consider the possibility of load balancing that process to the "
3585 "underused CPU."
3586 msgstr ""
3587
3588 #.  ================== Scheduler Relax Domain Level ==================
3589 #. type: Plain text
3590 #: build/C/man7/cpuset.7:780
3591 msgid ""
3592 "Of course, processes pinned to a particular CPU can be left in a cpuset that "
3593 "disables I<sched_load_balance> as those processes aren't going anywhere else "
3594 "anyway."
3595 msgstr ""
3596
3597 #. type: SS
3598 #: build/C/man7/cpuset.7:780
3599 #, no-wrap
3600 msgid "Scheduler relax domain level"
3601 msgstr ""
3602
3603 #. type: Plain text
3604 #: build/C/man7/cpuset.7:801
3605 msgid ""
3606 "The kernel scheduler performs immediate load balancing whenever a CPU "
3607 "becomes free or another task becomes runnable.  This load balancing works to "
3608 "ensure that as many CPUs as possible are usefully employed running tasks.  "
3609 "The kernel also performs periodic load balancing off the software clock "
3610 "described in B<time>(7).  The setting of I<sched_relax_domain_level> applies "
3611 "only to immediate load balancing.  Regardless of the "
3612 "I<sched_relax_domain_level> setting, periodic load balancing is attempted "
3613 "over all CPUs (unless disabled by turning off I<sched_load_balance>.)  In "
3614 "any case, of course, tasks will be scheduled to run only on CPUs allowed by "
3615 "their cpuset, as modified by B<sched_setaffinity>(2)  system calls."
3616 msgstr ""
3617
3618 #. type: Plain text
3619 #: build/C/man7/cpuset.7:809
3620 msgid ""
3621 "On small systems, such as those with just a few CPUs, immediate load "
3622 "balancing is useful to improve system interactivity and to minimize wasteful "
3623 "idle CPU cycles.  But on large systems, attempting immediate load balancing "
3624 "across a large number of CPUs can be more costly than it is worth, depending "
3625 "on the particular performance characteristics of the job mix and the "
3626 "hardware."
3627 msgstr ""
3628
3629 #. type: Plain text
3630 #: build/C/man7/cpuset.7:817
3631 msgid ""
3632 "The exact meaning of the small integer values of I<sched_relax_domain_level> "
3633 "will depend on internal implementation details of the kernel scheduler code "
3634 "and on the non-uniform architecture of the hardware.  Both of these will "
3635 "evolve over time and vary by system architecture and kernel version."
3636 msgstr ""
3637
3638 #. type: Plain text
3639 #: build/C/man7/cpuset.7:822
3640 msgid ""
3641 "As of this writing, when this capability was introduced in Linux 2.6.26, on "
3642 "certain popular architectures, the positive values of "
3643 "I<sched_relax_domain_level> have the following meanings."
3644 msgstr ""
3645
3646 #. type: IP
3647 #: build/C/man7/cpuset.7:824
3648 #, no-wrap
3649 msgid "B<(1)>"
3650 msgstr ""
3651
3652 #. type: Plain text
3653 #: build/C/man7/cpuset.7:827
3654 msgid ""
3655 "Perform immediate load balancing across Hyper-Thread siblings on the same "
3656 "core."
3657 msgstr ""
3658
3659 #. type: IP
3660 #: build/C/man7/cpuset.7:827
3661 #, no-wrap
3662 msgid "B<(2)>"
3663 msgstr ""
3664
3665 #. type: Plain text
3666 #: build/C/man7/cpuset.7:829
3667 msgid "Perform immediate load balancing across other cores in the same package."
3668 msgstr ""
3669
3670 #. type: IP
3671 #: build/C/man7/cpuset.7:829
3672 #, no-wrap
3673 msgid "B<(3)>"
3674 msgstr ""
3675
3676 #. type: Plain text
3677 #: build/C/man7/cpuset.7:832
3678 msgid ""
3679 "Perform immediate load balancing across other CPUs on the same node or "
3680 "blade."
3681 msgstr ""
3682
3683 #. type: IP
3684 #: build/C/man7/cpuset.7:832
3685 #, no-wrap
3686 msgid "B<(4)>"
3687 msgstr ""
3688
3689 #. type: Plain text
3690 #: build/C/man7/cpuset.7:835
3691 msgid ""
3692 "Perform immediate load balancing across over several (implementation detail) "
3693 "nodes [On NUMA systems]."
3694 msgstr ""
3695
3696 #. type: IP
3697 #: build/C/man7/cpuset.7:835
3698 #, no-wrap
3699 msgid "B<(5)>"
3700 msgstr ""
3701
3702 #. type: Plain text
3703 #: build/C/man7/cpuset.7:838
3704 msgid ""
3705 "Perform immediate load balancing across over all CPUs in system [On NUMA "
3706 "systems]."
3707 msgstr ""
3708
3709 #. type: Plain text
3710 #: build/C/man7/cpuset.7:847
3711 msgid ""
3712 "The I<sched_relax_domain_level> value of zero (0) always means don't perform "
3713 "immediate load balancing, hence that load balancing is done only "
3714 "periodically, not immediately when a CPU becomes available or another task "
3715 "becomes runnable."
3716 msgstr ""
3717
3718 #. type: Plain text
3719 #: build/C/man7/cpuset.7:855
3720 msgid ""
3721 "The I<sched_relax_domain_level> value of minus one (-1)  always means use "
3722 "the system default value.  The system default value can vary by architecture "
3723 "and kernel version.  This system default value can be changed by kernel "
3724 "boot-time \"relax_domain_level=\" argument."
3725 msgstr ""
3726
3727 #. type: Plain text
3728 #: build/C/man7/cpuset.7:863
3729 msgid ""
3730 "In the case of multiple overlapping cpusets which have conflicting "
3731 "I<sched_relax_domain_level> values, then the highest such value applies to "
3732 "all CPUs in any of the overlapping cpusets.  In such cases, the value "
3733 "B<minus one (-1)> is the lowest value, overridden by any other value, and "
3734 "the value B<zero (0)> is the next lowest value."
3735 msgstr ""
3736
3737 #. type: SH
3738 #: build/C/man7/cpuset.7:863
3739 #, no-wrap
3740 msgid "FORMATS"
3741 msgstr ""
3742
3743 #.  ================== Mask Format ==================
3744 #. type: Plain text
3745 #: build/C/man7/cpuset.7:867
3746 msgid "The following formats are used to represent sets of CPUs and memory nodes."
3747 msgstr ""
3748
3749 #. type: SS
3750 #: build/C/man7/cpuset.7:867
3751 #, no-wrap
3752 msgid "Mask format"
3753 msgstr ""
3754
3755 #. type: Plain text
3756 #: build/C/man7/cpuset.7:872
3757 msgid ""
3758 "The B<Mask Format> is used to represent CPU and memory-node bit masks in the "
3759 "I</proc/E<lt>pidE<gt>/status> file."
3760 msgstr ""
3761
3762 #. type: Plain text
3763 #: build/C/man7/cpuset.7:880
3764 msgid ""
3765 "This format displays each 32-bit word in hexadecimal (using ASCII characters "
3766 "\"0\" - \"9\" and \"a\" - \"f\"); words are filled with leading zeros, if "
3767 "required.  For masks longer than one word, a comma separator is used between "
3768 "words.  Words are displayed in big-endian order, which has the most "
3769 "significant bit first.  The hex digits within a word are also in big-endian "
3770 "order."
3771 msgstr ""
3772
3773 #. type: Plain text
3774 #: build/C/man7/cpuset.7:883
3775 msgid ""
3776 "The number of 32-bit words displayed is the minimum number needed to display "
3777 "all bits of the bit mask, based on the size of the bit mask."
3778 msgstr ""
3779
3780 #. type: Plain text
3781 #: build/C/man7/cpuset.7:885
3782 msgid "Examples of the B<Mask Format>:"
3783 msgstr ""
3784
3785 #. type: Plain text
3786 #: build/C/man7/cpuset.7:893
3787 #, no-wrap
3788 msgid ""
3789 "00000001                        # just bit 0 set\n"
3790 "40000000,00000000,00000000      # just bit 94 set\n"
3791 "00000001,00000000,00000000      # just bit 64 set\n"
3792 "000000ff,00000000               # bits 32-39 set\n"
3793 "00000000,000e3862               # 1,5,6,11-13,17-19 set\n"
3794 msgstr ""
3795
3796 #. type: Plain text
3797 #: build/C/man7/cpuset.7:897
3798 msgid "A mask with bits 0, 1, 2, 4, 8, 16, 32, and 64 set displays as:"
3799 msgstr ""
3800
3801 #. type: Plain text
3802 #: build/C/man7/cpuset.7:901
3803 #, no-wrap
3804 msgid "00000001,00000001,00010117\n"
3805 msgstr ""
3806
3807 #.  ================== List Format ==================
3808 #. type: Plain text
3809 #: build/C/man7/cpuset.7:908
3810 msgid ""
3811 "The first \"1\" is for bit 64, the second for bit 32, the third for bit 16, "
3812 "the fourth for bit 8, the fifth for bit 4, and the \"7\" is for bits 2, 1, "
3813 "and 0."
3814 msgstr ""
3815
3816 #. type: SS
3817 #: build/C/man7/cpuset.7:908
3818 #, no-wrap
3819 msgid "List format"
3820 msgstr ""
3821
3822 #. type: Plain text
3823 #: build/C/man7/cpuset.7:915
3824 msgid ""
3825 "The B<List Format> for I<cpus> and I<mems> is a comma-separated list of CPU "
3826 "or memory-node numbers and ranges of numbers, in ASCII decimal."
3827 msgstr ""
3828
3829 #. type: Plain text
3830 #: build/C/man7/cpuset.7:917
3831 msgid "Examples of the B<List Format>:"
3832 msgstr ""
3833
3834 #. type: Plain text
3835 #: build/C/man7/cpuset.7:922
3836 #, no-wrap
3837 msgid ""
3838 "0-4,9           # bits 0, 1, 2, 3, 4, and 9 set\n"
3839 "0-2,7,12-14     # bits 0, 1, 2, 7, 12, 13, and 14 set\n"
3840 msgstr ""
3841
3842 #.  ================== RULES ==================
3843 #. type: SH
3844 #: build/C/man7/cpuset.7:925
3845 #, no-wrap
3846 msgid "RULES"
3847 msgstr ""
3848
3849 #. type: Plain text
3850 #: build/C/man7/cpuset.7:927
3851 msgid "The following rules apply to each cpuset:"
3852 msgstr ""
3853
3854 #. type: Plain text
3855 #: build/C/man7/cpuset.7:930
3856 msgid ""
3857 "Its CPUs and memory nodes must be a (possibly equal)  subset of its "
3858 "parent's."
3859 msgstr ""
3860
3861 #. type: Plain text
3862 #: build/C/man7/cpuset.7:934
3863 msgid "It can be marked I<cpu_exclusive> only if its parent is."
3864 msgstr ""
3865
3866 #. type: Plain text
3867 #: build/C/man7/cpuset.7:938
3868 msgid "It can be marked I<mem_exclusive> only if its parent is."
3869 msgstr ""
3870
3871 #. type: Plain text
3872 #: build/C/man7/cpuset.7:942
3873 msgid "If it is I<cpu_exclusive>, its CPUs may not overlap any sibling."
3874 msgstr ""
3875
3876 #.  ================== PERMISSIONS ==================
3877 #. type: Plain text
3878 #: build/C/man7/cpuset.7:947
3879 msgid "If it is I<memory_exclusive>, its memory nodes may not overlap any sibling."
3880 msgstr ""
3881
3882 #. type: SH
3883 #: build/C/man7/cpuset.7:947
3884 #, no-wrap
3885 msgid "PERMISSIONS"
3886 msgstr ""
3887
3888 #. type: Plain text
3889 #: build/C/man7/cpuset.7:952
3890 msgid ""
3891 "The permissions of a cpuset are determined by the permissions of the "
3892 "directories and pseudo-files in the cpuset filesystem, normally mounted at "
3893 "I</dev/cpuset>."
3894 msgstr ""
3895
3896 #. type: Plain text
3897 #: build/C/man7/cpuset.7:961
3898 msgid ""
3899 "For instance, a process can put itself in some other cpuset (than its "
3900 "current one) if it can write the I<tasks> file for that cpuset.  This "
3901 "requires execute permission on the encompassing directories and write "
3902 "permission on the I<tasks> file."
3903 msgstr ""
3904
3905 #. type: Plain text
3906 #: build/C/man7/cpuset.7:968
3907 msgid ""
3908 "An additional constraint is applied to requests to place some other process "
3909 "in a cpuset.  One process may not attach another to a cpuset unless it would "
3910 "have permission to send that process a signal (see B<kill>(2))."
3911 msgstr ""
3912
3913 #. type: Plain text
3914 #: build/C/man7/cpuset.7:979
3915 msgid ""
3916 "A process may create a child cpuset if it can access and write the parent "
3917 "cpuset directory.  It can modify the CPUs or memory nodes in a cpuset if it "
3918 "can access that cpuset's directory (execute permissions on the each of the "
3919 "parent directories) and write the corresponding I<cpus> or I<mems> file."
3920 msgstr ""
3921
3922 #. type: Plain text
3923 #: build/C/man7/cpuset.7:1000
3924 msgid ""
3925 "There is one minor difference between the manner in which these permissions "
3926 "are evaluated and the manner in which normal filesystem operation "
3927 "permissions are evaluated.  The kernel interprets relative pathnames "
3928 "starting at a process's current working directory.  Even if one is operating "
3929 "on a cpuset file, relative pathnames are interpreted relative to the "
3930 "process's current working directory, not relative to the process's current "
3931 "cpuset.  The only ways that cpuset paths relative to a process's current "
3932 "cpuset can be used are if either the process's current working directory is "
3933 "its cpuset (it first did a B<cd> or B<chdir>(2)  to its cpuset directory "
3934 "beneath I</dev/cpuset>, which is a bit unusual)  or if some user code "
3935 "converts the relative cpuset path to a full filesystem path."
3936 msgstr ""
3937
3938 #.  ================== WARNINGS ==================
3939 #. type: Plain text
3940 #: build/C/man7/cpuset.7:1015
3941 msgid ""
3942 "In theory, this means that user code should specify cpusets using absolute "
3943 "pathnames, which requires knowing the mount point of the cpuset filesystem "
3944 "(usually, but not necessarily, I</dev/cpuset>).  In practice, all user level "
3945 "code that this author is aware of simply assumes that if the cpuset "
3946 "filesystem is mounted, then it is mounted at I</dev/cpuset>.  Furthermore, "
3947 "it is common practice for carefully written user code to verify the presence "
3948 "of the pseudo-file I</dev/cpuset/tasks> in order to verify that the cpuset "
3949 "pseudo-filesystem is currently mounted."
3950 msgstr ""
3951
3952 #. type: SH
3953 #: build/C/man7/cpuset.7:1015
3954 #, no-wrap
3955 msgid "WARNINGS"
3956 msgstr ""
3957
3958 #. type: SS
3959 #: build/C/man7/cpuset.7:1016
3960 #, no-wrap
3961 msgid "Enabling memory_pressure"
3962 msgstr ""
3963
3964 #. type: Plain text
3965 #: build/C/man7/cpuset.7:1025
3966 msgid ""
3967 "By default, the per-cpuset file I<cpuset.memory_pressure> always contains "
3968 "zero (0).  Unless this feature is enabled by writing \"1\" to the "
3969 "pseudo-file I</dev/cpuset/cpuset.memory_pressure_enabled>, the kernel does "
3970 "not compute per-cpuset I<memory_pressure>."
3971 msgstr ""
3972
3973 #. type: SS
3974 #: build/C/man7/cpuset.7:1025
3975 #, no-wrap
3976 msgid "Using the echo command"
3977 msgstr ""
3978
3979 #.  Gack!  csh(1)'s echo does this
3980 #. type: Plain text
3981 #: build/C/man7/cpuset.7:1036
3982 msgid ""
3983 "When using the B<echo> command at the shell prompt to change the values of "
3984 "cpuset files, beware that the built-in B<echo> command in some shells does "
3985 "not display an error message if the B<write>(2)  system call fails.  For "
3986 "example, if the command:"
3987 msgstr ""
3988
3989 #. type: Plain text
3990 #: build/C/man7/cpuset.7:1040
3991 #, no-wrap
3992 msgid "echo 19 E<gt> cpuset.mems\n"
3993 msgstr ""
3994
3995 #. type: Plain text
3996 #: build/C/man7/cpuset.7:1053
3997 msgid ""
3998 "failed because memory node 19 was not allowed (perhaps the current system "
3999 "does not have a memory node 19), then the B<echo> command might not display "
4000 "any error.  It is better to use the B</bin/echo> external command to change "
4001 "cpuset file settings, as this command will display B<write>(2)  errors, as "
4002 "in the example:"
4003 msgstr ""
4004
4005 #. type: Plain text
4006 #: build/C/man7/cpuset.7:1058
4007 #, no-wrap
4008 msgid ""
4009 "/bin/echo 19 E<gt> cpuset.mems\n"
4010 "/bin/echo: write error: Invalid argument\n"
4011 msgstr ""
4012
4013 #.  ================== EXCEPTIONS ==================
4014 #. type: SH
4015 #: build/C/man7/cpuset.7:1061
4016 #, no-wrap
4017 msgid "EXCEPTIONS"
4018 msgstr ""
4019
4020 #. type: SS
4021 #: build/C/man7/cpuset.7:1062
4022 #, no-wrap
4023 msgid "Memory placement"
4024 msgstr ""
4025
4026 #. type: Plain text
4027 #: build/C/man7/cpuset.7:1065
4028 msgid ""
4029 "Not all allocations of system memory are constrained by cpusets, for the "
4030 "following reasons."
4031 msgstr ""
4032
4033 #. type: Plain text
4034 #: build/C/man7/cpuset.7:1080
4035 msgid ""
4036 "If hot-plug functionality is used to remove all the CPUs that are currently "
4037 "assigned to a cpuset, then the kernel will automatically update the "
4038 "I<cpus_allowed> of all processes attached to CPUs in that cpuset to allow "
4039 "all CPUs.  When memory hot-plug functionality for removing memory nodes is "
4040 "available, a similar exception is expected to apply there as well.  In "
4041 "general, the kernel prefers to violate cpuset placement, rather than "
4042 "starving a process that has had all its allowed CPUs or memory nodes taken "
4043 "offline.  User code should reconfigure cpusets to refer only to online CPUs "
4044 "and memory nodes when using hot-plug to add or remove such resources."
4045 msgstr ""
4046
4047 #. type: Plain text
4048 #: build/C/man7/cpuset.7:1088
4049 msgid ""
4050 "A few kernel-critical, internal memory-allocation requests, marked "
4051 "GFP_ATOMIC, must be satisfied immediately.  The kernel may drop some request "
4052 "or malfunction if one of these allocations fail.  If such a request cannot "
4053 "be satisfied within the current process's cpuset, then we relax the cpuset, "
4054 "and look for memory anywhere we can find it.  It's better to violate the "
4055 "cpuset than stress the kernel."
4056 msgstr ""
4057
4058 #. type: Plain text
4059 #: build/C/man7/cpuset.7:1092
4060 msgid ""
4061 "Allocations of memory requested by kernel drivers while processing an "
4062 "interrupt lack any relevant process context, and are not confined by "
4063 "cpusets."
4064 msgstr ""
4065
4066 #. type: SS
4067 #: build/C/man7/cpuset.7:1092
4068 #, no-wrap
4069 msgid "Renaming cpusets"
4070 msgstr ""
4071
4072 #.  ================== ERRORS ==================
4073 #. type: Plain text
4074 #: build/C/man7/cpuset.7:1100
4075 msgid ""
4076 "You can use the B<rename>(2)  system call to rename cpusets.  Only simple "
4077 "renaming is supported; that is, changing the name of a cpuset directory is "
4078 "permitted, but moving a directory into a different directory is not "
4079 "permitted."
4080 msgstr ""
4081
4082 #. type: Plain text
4083 #: build/C/man7/cpuset.7:1104
4084 msgid ""
4085 "The Linux kernel implementation of cpusets sets I<errno> to specify the "
4086 "reason for a failed system call affecting cpusets."
4087 msgstr ""
4088
4089 #. type: Plain text
4090 #: build/C/man7/cpuset.7:1109
4091 msgid ""
4092 "The possible I<errno> settings and their meaning when set on a failed cpuset "
4093 "call are as listed below."
4094 msgstr ""
4095
4096 #. type: TP
4097 #: build/C/man7/cpuset.7:1109
4098 #, no-wrap
4099 msgid "B<E2BIG>"
4100 msgstr ""
4101
4102 #. type: Plain text
4103 #: build/C/man7/cpuset.7:1116
4104 msgid ""
4105 "Attempted a B<write>(2)  on a special cpuset file with a length larger than "
4106 "some kernel-determined upper limit on the length of such writes."
4107 msgstr ""
4108
4109 #. type: Plain text
4110 #: build/C/man7/cpuset.7:1123
4111 msgid ""
4112 "Attempted to B<write>(2)  the process ID (PID) of a process to a cpuset "
4113 "I<tasks> file when one lacks permission to move that process."
4114 msgstr ""
4115
4116 #. type: Plain text
4117 #: build/C/man7/cpuset.7:1129
4118 msgid ""
4119 "Attempted to add, using B<write>(2), a CPU or memory node to a cpuset, when "
4120 "that CPU or memory node was not already in its parent."
4121 msgstr ""
4122
4123 #. type: Plain text
4124 #: build/C/man7/cpuset.7:1137
4125 msgid ""
4126 "Attempted to set, using B<write>(2), I<cpuset.cpu_exclusive> or "
4127 "I<cpuset.mem_exclusive> on a cpuset whose parent lacks the same setting."
4128 msgstr ""
4129
4130 #. type: Plain text
4131 #: build/C/man7/cpuset.7:1144
4132 msgid "Attempted to B<write>(2)  a I<cpuset.memory_pressure> file."
4133 msgstr ""
4134
4135 #. type: Plain text
4136 #: build/C/man7/cpuset.7:1147
4137 msgid "Attempted to create a file in a cpuset directory."
4138 msgstr ""
4139
4140 #. type: TP
4141 #: build/C/man7/cpuset.7:1147 build/C/man7/cpuset.7:1152 build/C/man7/cpuset.7:1157
4142 #, no-wrap
4143 msgid "B<EBUSY>"
4144 msgstr ""
4145
4146 #. type: Plain text
4147 #: build/C/man7/cpuset.7:1152
4148 msgid "Attempted to remove, using B<rmdir>(2), a cpuset with attached processes."
4149 msgstr ""
4150
4151 #. type: Plain text
4152 #: build/C/man7/cpuset.7:1157
4153 msgid "Attempted to remove, using B<rmdir>(2), a cpuset with child cpusets."
4154 msgstr ""
4155
4156 #. type: Plain text
4157 #: build/C/man7/cpuset.7:1162
4158 msgid ""
4159 "Attempted to remove a CPU or memory node from a cpuset that is also in a "
4160 "child of that cpuset."
4161 msgstr ""
4162
4163 #. type: TP
4164 #: build/C/man7/cpuset.7:1162 build/C/man7/cpuset.7:1167
4165 #, no-wrap
4166 msgid "B<EEXIST>"
4167 msgstr ""
4168
4169 #. type: Plain text
4170 #: build/C/man7/cpuset.7:1167
4171 msgid "Attempted to create, using B<mkdir>(2), a cpuset that already exists."
4172 msgstr ""
4173
4174 #. type: Plain text
4175 #: build/C/man7/cpuset.7:1172
4176 msgid "Attempted to B<rename>(2)  a cpuset to a name that already exists."
4177 msgstr ""
4178
4179 #. type: Plain text
4180 #: build/C/man7/cpuset.7:1180
4181 msgid ""
4182 "Attempted to B<read>(2)  or B<write>(2)  a cpuset file using a buffer that "
4183 "is outside the writing processes accessible address space."
4184 msgstr ""
4185
4186 #. type: Plain text
4187 #: build/C/man7/cpuset.7:1189
4188 msgid ""
4189 "Attempted to change a cpuset, using B<write>(2), in a way that would violate "
4190 "a I<cpu_exclusive> or I<mem_exclusive> attribute of that cpuset or any of "
4191 "its siblings."
4192 msgstr ""
4193
4194 #. type: Plain text
4195 #: build/C/man7/cpuset.7:1198
4196 msgid ""
4197 "Attempted to B<write>(2)  an empty I<cpuset.cpus> or I<cpuset.mems> list to "
4198 "a cpuset which has attached processes or child cpusets."
4199 msgstr ""
4200
4201 #. type: Plain text
4202 #: build/C/man7/cpuset.7:1208
4203 msgid ""
4204 "Attempted to B<write>(2)  a I<cpuset.cpus> or I<cpuset.mems> list which "
4205 "included a range with the second number smaller than the first number."
4206 msgstr ""
4207
4208 #. type: Plain text
4209 #: build/C/man7/cpuset.7:1217
4210 msgid ""
4211 "Attempted to B<write>(2)  a I<cpuset.cpus> or I<cpuset.mems> list which "
4212 "included an invalid character in the string."
4213 msgstr ""
4214
4215 #. type: Plain text
4216 #: build/C/man7/cpuset.7:1224
4217 msgid ""
4218 "Attempted to B<write>(2)  a list to a I<cpuset.cpus> file that did not "
4219 "include any online CPUs."
4220 msgstr ""
4221
4222 #. type: Plain text
4223 #: build/C/man7/cpuset.7:1231
4224 msgid ""
4225 "Attempted to B<write>(2)  a list to a I<cpuset.mems> file that did not "
4226 "include any online memory nodes."
4227 msgstr ""
4228
4229 #. type: Plain text
4230 #: build/C/man7/cpuset.7:1238
4231 msgid ""
4232 "Attempted to B<write>(2)  a list to a I<cpuset.mems> file that included a "
4233 "node that held no memory."
4234 msgstr ""
4235
4236 #. type: Plain text
4237 #: build/C/man7/cpuset.7:1246
4238 msgid ""
4239 "Attempted to B<write>(2)  a string to a cpuset I<tasks> file that does not "
4240 "begin with an ASCII decimal integer."
4241 msgstr ""
4242
4243 #. type: Plain text
4244 #: build/C/man7/cpuset.7:1251
4245 msgid "Attempted to B<rename>(2)  a cpuset into a different directory."
4246 msgstr ""
4247
4248 #. type: Plain text
4249 #: build/C/man7/cpuset.7:1258
4250 msgid ""
4251 "Attempted to B<read>(2)  a I</proc/E<lt>pidE<gt>/cpuset> file for a cpuset "
4252 "path that is longer than the kernel page size."
4253 msgstr ""
4254
4255 #. type: Plain text
4256 #: build/C/man7/cpuset.7:1263
4257 msgid ""
4258 "Attempted to create, using B<mkdir>(2), a cpuset whose base directory name "
4259 "is longer than 255 characters."
4260 msgstr ""
4261
4262 #. type: Plain text
4263 #: build/C/man7/cpuset.7:1270
4264 msgid ""
4265 "Attempted to create, using B<mkdir>(2), a cpuset whose full pathname, "
4266 "including the mount point (typically \"/dev/cpuset/\") prefix, is longer "
4267 "than 4095 characters."
4268 msgstr ""
4269
4270 #. type: TP
4271 #: build/C/man7/cpuset.7:1270
4272 #, no-wrap
4273 msgid "B<ENODEV>"
4274 msgstr ""
4275
4276 #. type: Plain text
4277 #: build/C/man7/cpuset.7:1275
4278 msgid ""
4279 "The cpuset was removed by another process at the same time as a B<write>(2)  "
4280 "was attempted on one of the pseudo-files in the cpuset directory."
4281 msgstr ""
4282
4283 #. type: Plain text
4284 #: build/C/man7/cpuset.7:1280
4285 msgid ""
4286 "Attempted to create, using B<mkdir>(2), a cpuset in a parent cpuset that "
4287 "doesn't exist."
4288 msgstr ""
4289
4290 #. type: Plain text
4291 #: build/C/man7/cpuset.7:1287
4292 msgid ""
4293 "Attempted to B<access>(2)  or B<open>(2)  a nonexistent file in a cpuset "
4294 "directory."
4295 msgstr ""
4296
4297 #. type: Plain text
4298 #: build/C/man7/cpuset.7:1292
4299 msgid ""
4300 "Insufficient memory is available within the kernel; can occur on a variety "
4301 "of system calls affecting cpusets, but only if the system is extremely short "
4302 "of memory."
4303 msgstr ""
4304
4305 #. type: TP
4306 #: build/C/man7/cpuset.7:1292 build/C/man7/cpuset.7:1304
4307 #, no-wrap
4308 msgid "B<ENOSPC>"
4309 msgstr ""
4310
4311 #. type: Plain text
4312 #: build/C/man7/cpuset.7:1304
4313 msgid ""
4314 "Attempted to B<write>(2)  the process ID (PID)  of a process to a cpuset "
4315 "I<tasks> file when the cpuset had an empty I<cpuset.cpus> or empty "
4316 "I<cpuset.mems> setting."
4317 msgstr ""
4318
4319 #. type: Plain text
4320 #: build/C/man7/cpuset.7:1314
4321 msgid ""
4322 "Attempted to B<write>(2)  an empty I<cpuset.cpus> or I<cpuset.mems> setting "
4323 "to a cpuset that has tasks attached."
4324 msgstr ""
4325
4326 #. type: Plain text
4327 #: build/C/man7/cpuset.7:1319
4328 msgid "Attempted to B<rename>(2)  a nonexistent cpuset."
4329 msgstr ""
4330
4331 #. type: Plain text
4332 #: build/C/man7/cpuset.7:1322
4333 msgid "Attempted to remove a file from a cpuset directory."
4334 msgstr ""
4335
4336 #. type: TP
4337 #: build/C/man7/cpuset.7:1322
4338 #, no-wrap
4339 msgid "B<ERANGE>"
4340 msgstr ""
4341
4342 #. type: Plain text
4343 #: build/C/man7/cpuset.7:1330
4344 msgid ""
4345 "Specified a I<cpuset.cpus> or I<cpuset.mems> list to the kernel which "
4346 "included a number too large for the kernel to set in its bit masks."
4347 msgstr ""
4348
4349 #.  ================== VERSIONS ==================
4350 #. type: Plain text
4351 #: build/C/man7/cpuset.7:1338
4352 msgid ""
4353 "Attempted to B<write>(2)  the process ID (PID) of a nonexistent process to a "
4354 "cpuset I<tasks> file."
4355 msgstr ""
4356
4357 #.  ================== NOTES ==================
4358 #. type: Plain text
4359 #: build/C/man7/cpuset.7:1341
4360 msgid "Cpusets appeared in version 2.6.12 of the Linux kernel."
4361 msgstr ""
4362
4363 #.  ================== BUGS ==================
4364 #. type: Plain text
4365 #: build/C/man7/cpuset.7:1352
4366 msgid ""
4367 "Despite its name, the I<pid> parameter is actually a thread ID, and each "
4368 "thread in a threaded group can be attached to a different cpuset.  The value "
4369 "returned from a call to B<gettid>(2)  can be passed in the argument I<pid>."
4370 msgstr ""
4371
4372 #. type: SH
4373 #: build/C/man7/cpuset.7:1352 build/C/man2/getpriority.2:225 build/C/man2/getrlimit.2:577 build/C/man2/ioprio_set.2:337 build/C/man2/setfsgid.2:106 build/C/man2/setfsuid.2:114
4374 #, no-wrap
4375 msgid "BUGS"
4376 msgstr ""
4377
4378 #.  ================== EXAMPLE ==================
4379 #. type: Plain text
4380 #: build/C/man7/cpuset.7:1365
4381 msgid ""
4382 "I<cpuset.memory_pressure> cpuset files can be opened for writing, creation, "
4383 "or truncation, but then the B<write>(2)  fails with I<errno> set to "
4384 "B<EACCES>, and the creation and truncation options on B<open>(2)  have no "
4385 "effect."
4386 msgstr ""
4387
4388 #. type: SH
4389 #: build/C/man7/cpuset.7:1365 build/C/man2/getrlimit.2:710 build/C/man7/namespaces.7:361 build/C/man7/pid_namespaces.7:353 build/C/man7/user_namespaces.7:677 build/C/man2/seccomp.2:476
4390 #, no-wrap
4391 msgid "EXAMPLE"
4392 msgstr ""
4393
4394 #. type: Plain text
4395 #: build/C/man7/cpuset.7:1368
4396 msgid ""
4397 "The following examples demonstrate querying and setting cpuset options using "
4398 "shell commands."
4399 msgstr ""
4400
4401 #. type: SS
4402 #: build/C/man7/cpuset.7:1368
4403 #, no-wrap
4404 msgid "Creating and attaching to a cpuset."
4405 msgstr ""
4406
4407 #. type: Plain text
4408 #: build/C/man7/cpuset.7:1371
4409 msgid ""
4410 "To create a new cpuset and attach the current command shell to it, the steps "
4411 "are:"
4412 msgstr ""
4413
4414 #. type: IP
4415 #: build/C/man7/cpuset.7:1373 build/C/man7/cpuset.7:1412
4416 #, no-wrap
4417 msgid "1)"
4418 msgstr ""
4419
4420 #. type: Plain text
4421 #: build/C/man7/cpuset.7:1375
4422 msgid "mkdir /dev/cpuset (if not already done)"
4423 msgstr ""
4424
4425 #. type: IP
4426 #: build/C/man7/cpuset.7:1375 build/C/man7/cpuset.7:1418
4427 #, no-wrap
4428 msgid "2)"
4429 msgstr ""
4430
4431 #. type: Plain text
4432 #: build/C/man7/cpuset.7:1377
4433 msgid "mount -t cpuset none /dev/cpuset (if not already done)"
4434 msgstr ""
4435
4436 #. type: IP
4437 #: build/C/man7/cpuset.7:1377 build/C/man7/cpuset.7:1421
4438 #, no-wrap
4439 msgid "3)"
4440 msgstr ""
4441
4442 #. type: Plain text
4443 #: build/C/man7/cpuset.7:1380
4444 msgid "Create the new cpuset using B<mkdir>(1)."
4445 msgstr ""
4446
4447 #. type: IP
4448 #: build/C/man7/cpuset.7:1380 build/C/man7/cpuset.7:1424
4449 #, no-wrap
4450 msgid "4)"
4451 msgstr ""
4452
4453 #. type: Plain text
4454 #: build/C/man7/cpuset.7:1382
4455 msgid "Assign CPUs and memory nodes to the new cpuset."
4456 msgstr ""
4457
4458 #. type: IP
4459 #: build/C/man7/cpuset.7:1382 build/C/man7/cpuset.7:1429
4460 #, no-wrap
4461 msgid "5)"
4462 msgstr ""
4463
4464 #. type: Plain text
4465 #: build/C/man7/cpuset.7:1384
4466 msgid "Attach the shell to the new cpuset."
4467 msgstr ""
4468
4469 #. type: Plain text
4470 #: build/C/man7/cpuset.7:1389
4471 msgid ""
4472 "For example, the following sequence of commands will set up a cpuset named "
4473 "\"Charlie\", containing just CPUs 2 and 3, and memory node 1, and then "
4474 "attach the current shell to that cpuset."
4475 msgstr ""
4476
4477 #. type: Plain text
4478 #: build/C/man7/cpuset.7:1403
4479 #, no-wrap
4480 msgid ""
4481 "$B< mkdir /dev/cpuset>\n"
4482 "$B< mount -t cpuset cpuset /dev/cpuset>\n"
4483 "$B< cd /dev/cpuset>\n"
4484 "$B< mkdir Charlie>\n"
4485 "$B< cd Charlie>\n"
4486 "$B< /bin/echo 2-3 E<gt> cpuset.cpus>\n"
4487 "$B< /bin/echo 1 E<gt> cpuset.mems>\n"
4488 "$B< /bin/echo $$ E<gt> tasks>\n"
4489 "# The current shell is now running in cpuset Charlie\n"
4490 "# The next line should display '/Charlie'\n"
4491 "$B< cat /proc/self/cpuset>\n"
4492 msgstr ""
4493
4494 #. type: SS
4495 #: build/C/man7/cpuset.7:1405
4496 #, no-wrap
4497 msgid "Migrating a job to different memory nodes."
4498 msgstr ""
4499
4500 #. type: Plain text
4501 #: build/C/man7/cpuset.7:1410
4502 msgid ""
4503 "To migrate a job (the set of processes attached to a cpuset)  to different "
4504 "CPUs and memory nodes in the system, including moving the memory pages "
4505 "currently allocated to that job, perform the following steps."
4506 msgstr ""
4507
4508 #. type: Plain text
4509 #: build/C/man7/cpuset.7:1418
4510 msgid ""
4511 "Let's say we want to move the job in cpuset I<alpha> (CPUs 4-7 and memory "
4512 "nodes 2-3) to a new cpuset I<beta> (CPUs 16-19 and memory nodes 8-9)."
4513 msgstr ""
4514
4515 #. type: Plain text
4516 #: build/C/man7/cpuset.7:1421
4517 msgid "First create the new cpuset I<beta>."
4518 msgstr ""
4519
4520 #. type: Plain text
4521 #: build/C/man7/cpuset.7:1424
4522 msgid "Then allow CPUs 16-19 and memory nodes 8-9 in I<beta>."
4523 msgstr ""
4524
4525 #. type: Plain text
4526 #: build/C/man7/cpuset.7:1429
4527 msgid "Then enable I<memory_migration> in I<beta>."
4528 msgstr ""
4529
4530 #. type: Plain text
4531 #: build/C/man7/cpuset.7:1434
4532 msgid "Then move each process from I<alpha> to I<beta>."
4533 msgstr ""
4534
4535 #. type: Plain text
4536 #: build/C/man7/cpuset.7:1437
4537 msgid "The following sequence of commands accomplishes this."
4538 msgstr ""
4539
4540 #. type: Plain text
4541 #: build/C/man7/cpuset.7:1447
4542 #, no-wrap
4543 msgid ""
4544 "$B< cd /dev/cpuset>\n"
4545 "$B< mkdir beta>\n"
4546 "$B< cd beta>\n"
4547 "$B< /bin/echo 16-19 E<gt> cpuset.cpus>\n"
4548 "$B< /bin/echo 8-9 E<gt> cpuset.mems>\n"
4549 "$B< /bin/echo 1 E<gt> cpuset.memory_migrate>\n"
4550 "$B< while read i; do /bin/echo $i; done E<lt> ../alpha/tasks E<gt> tasks>\n"
4551 msgstr ""
4552
4553 #. type: Plain text
4554 #: build/C/man7/cpuset.7:1456
4555 msgid ""
4556 "The above should move any processes in I<alpha> to I<beta>, and any memory "
4557 "held by these processes on memory nodes 2-3 to memory nodes 8-9, "
4558 "respectively."
4559 msgstr ""
4560
4561 #. type: Plain text
4562 #: build/C/man7/cpuset.7:1458
4563 msgid "Notice that the last step of the above sequence did not do:"
4564 msgstr ""
4565
4566 #. type: Plain text
4567 #: build/C/man7/cpuset.7:1462
4568 #, no-wrap
4569 msgid "$B< cp ../alpha/tasks tasks>\n"
4570 msgstr ""
4571
4572 #. type: Plain text
4573 #: build/C/man7/cpuset.7:1473
4574 msgid ""
4575 "The I<while> loop, rather than the seemingly easier use of the B<cp>(1)  "
4576 "command, was necessary because only one process PID at a time may be written "
4577 "to the I<tasks> file."
4578 msgstr ""
4579
4580 #. type: Plain text
4581 #: build/C/man7/cpuset.7:1481
4582 msgid ""
4583 "The same effect (writing one PID at a time) as the I<while> loop can be "
4584 "accomplished more efficiently, in fewer keystrokes and in syntax that works "
4585 "on any shell, but alas more obscurely, by using the B<-u> (unbuffered) "
4586 "option of B<sed>(1):"
4587 msgstr ""
4588
4589 #. type: Plain text
4590 #: build/C/man7/cpuset.7:1485
4591 #, no-wrap
4592 msgid "$B< sed -un p E<lt> ../alpha/tasks E<gt> tasks>\n"
4593 msgstr ""
4594
4595 #. type: Plain text
4596 #: build/C/man7/cpuset.7:1503
4597 msgid ""
4598 "B<taskset>(1), B<get_mempolicy>(2), B<getcpu>(2), B<mbind>(2), "
4599 "B<sched_getaffinity>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
4600 "B<set_mempolicy>(2), B<CPU_SET>(3), B<proc>(5), B<numa>(7), B<sched>(7), "
4601 "B<migratepages>(8), B<numactl>(8)"
4602 msgstr ""
4603
4604 #. type: Plain text
4605 #: build/C/man7/cpuset.7:1506
4606 msgid "I<Documentation/cpusets.txt> in the Linux kernel source tree"
4607 msgstr ""
4608
4609 #. type: TH
4610 #: build/C/man7/credentials.7:27
4611 #, no-wrap
4612 msgid "CREDENTIALS"
4613 msgstr ""
4614
4615 #. type: TH
4616 #: build/C/man7/credentials.7:27 build/C/man2/setsid.2:31
4617 #, no-wrap
4618 msgid "2014-12-31"
4619 msgstr ""
4620
4621 #. type: Plain text
4622 #: build/C/man7/credentials.7:30
4623 msgid "credentials - process identifiers"
4624 msgstr ""
4625
4626 #. type: SS
4627 #: build/C/man7/credentials.7:31
4628 #, no-wrap
4629 msgid "Process ID (PID)"
4630 msgstr ""
4631
4632 #. type: Plain text
4633 #: build/C/man7/credentials.7:41
4634 msgid ""
4635 "Each process has a unique nonnegative integer identifier that is assigned "
4636 "when the process is created using B<fork>(2).  A process can obtain its PID "
4637 "using B<getpid>(2).  A PID is represented using the type I<pid_t> (defined "
4638 "in I<E<lt>sys/types.hE<gt>>)."
4639 msgstr ""
4640
4641 #.  .BR sched_rr_get_interval (2),
4642 #.  .BR sched_getaffinity (2),
4643 #.  .BR sched_setaffinity (2),
4644 #.  .BR sched_getparam (2),
4645 #.  .BR sched_setparam (2),
4646 #.  .BR sched_setscheduler (2),
4647 #.  .BR sched_getscheduler (2),
4648 #.  .BR getsid (2),
4649 #.  .BR waitid (2),
4650 #.  .BR wait4 (2),
4651 #. type: Plain text
4652 #: build/C/man7/credentials.7:62
4653 msgid ""
4654 "PIDs are used in a range of system calls to identify the process affected by "
4655 "the call, for example: B<kill>(2), B<ptrace>(2), B<setpriority>(2)  "
4656 "B<setpgid>(2), B<setsid>(2), B<sigqueue>(3), and B<waitpid>(2)."
4657 msgstr ""
4658
4659 #. type: Plain text
4660 #: build/C/man7/credentials.7:65
4661 msgid "A process's PID is preserved across an B<execve>(2)."
4662 msgstr ""
4663
4664 #. type: SS
4665 #: build/C/man7/credentials.7:65
4666 #, no-wrap
4667 msgid "Parent process ID (PPID)"
4668 msgstr ""
4669
4670 #. type: Plain text
4671 #: build/C/man7/credentials.7:73
4672 msgid ""
4673 "A process's parent process ID identifies the process that created this "
4674 "process using B<fork>(2).  A process can obtain its PPID using "
4675 "B<getppid>(2).  A PPID is represented using the type I<pid_t>."
4676 msgstr ""
4677
4678 #. type: Plain text
4679 #: build/C/man7/credentials.7:76
4680 msgid "A process's PPID is preserved across an B<execve>(2)."
4681 msgstr ""
4682
4683 #. type: SS
4684 #: build/C/man7/credentials.7:76
4685 #, no-wrap
4686 msgid "Process group ID and session ID"
4687 msgstr ""
4688
4689 #. type: Plain text
4690 #: build/C/man7/credentials.7:84
4691 msgid ""
4692 "Each process has a session ID and a process group ID, both represented using "
4693 "the type I<pid_t>.  A process can obtain its session ID using B<getsid>(2), "
4694 "and its process group ID using B<getpgrp>(2)."
4695 msgstr ""
4696
4697 #. type: Plain text
4698 #: build/C/man7/credentials.7:90
4699 msgid ""
4700 "A child created by B<fork>(2)  inherits its parent's session ID and process "
4701 "group ID.  A process's session ID and process group ID are preserved across "
4702 "an B<execve>(2)."
4703 msgstr ""
4704
4705 #. type: Plain text
4706 #: build/C/man7/credentials.7:103
4707 msgid ""
4708 "Sessions and process groups are abstractions devised to support shell job "
4709 "control.  A process group (sometimes called a \"job\") is a collection of "
4710 "processes that share the same process group ID; the shell creates a new "
4711 "process group for the process(es) used to execute single command or pipeline "
4712 "(e.g., the two processes created to execute the command \"ls\\ |\\ wc\" are "
4713 "placed in the same process group).  A process's group membership can be set "
4714 "using B<setpgid>(2).  The process whose process ID is the same as its "
4715 "process group ID is the I<process group leader> for that group."
4716 msgstr ""
4717
4718 #. type: Plain text
4719 #: build/C/man7/credentials.7:115
4720 msgid ""
4721 "A session is a collection of processes that share the same session ID.  All "
4722 "of the members of a process group also have the same session ID (i.e., all "
4723 "of the members of a process group always belong to the same session, so that "
4724 "sessions and process groups form a strict two-level hierarchy of processes.)  "
4725 "A new session is created when a process calls B<setsid>(2), which creates a "
4726 "new session whose session ID is the same as the PID of the process that "
4727 "called B<setsid>(2).  The creator of the session is called the I<session "
4728 "leader>."
4729 msgstr ""
4730
4731 #. type: Plain text
4732 #: build/C/man7/credentials.7:124
4733 msgid ""
4734 "All of the processes in a session share a I<controlling terminal>.  The "
4735 "controlling terminal is established when the session leader first opens a "
4736 "terminal (unless the B<O_NOCTTY> flag is specified when calling "
4737 "B<open>(2)).  A terminal may be the controlling terminal of at most one "
4738 "session."
4739 msgstr ""
4740
4741 #. type: Plain text
4742 #: build/C/man7/credentials.7:146
4743 msgid ""
4744 "At most one of the jobs in a session may be the I<foreground job>; other "
4745 "jobs in the session are I<background jobs>.  Only the foreground job may "
4746 "read from the terminal; when a process in the background attempts to read "
4747 "from the terminal, its process group is sent a B<SIGTTIN> signal, which "
4748 "suspends the job.  If the B<TOSTOP> flag has been set for the terminal (see "
4749 "B<termios>(3)), then only the foreground job may write to the terminal; "
4750 "writes from background job cause a B<SIGTTOU> signal to be generated, which "
4751 "suspends the job.  When terminal keys that generate a signal (such as the "
4752 "I<interrupt> key, normally control-C)  are pressed, the signal is sent to "
4753 "the processes in the foreground job."
4754 msgstr ""
4755
4756 #. type: Plain text
4757 #: build/C/man7/credentials.7:167
4758 msgid ""
4759 "Various system calls and library functions may operate on all members of a "
4760 "process group, including B<kill>(2), B<killpg>(2), B<getpriority>(2), "
4761 "B<setpriority>(2), B<ioprio_get>(2), B<ioprio_set>(2), B<waitid>(2), and "
4762 "B<waitpid>(2).  See also the discussion of the B<F_GETOWN>, B<F_GETOWN_EX>, "
4763 "B<F_SETOWN>, and B<F_SETOWN_EX> operations in B<fcntl>(2)."
4764 msgstr ""
4765
4766 #. type: SS
4767 #: build/C/man7/credentials.7:167
4768 #, no-wrap
4769 msgid "User and group identifiers"
4770 msgstr ""
4771
4772 #. type: Plain text
4773 #: build/C/man7/credentials.7:175
4774 msgid ""
4775 "Each process has various associated user and groups IDs.  These IDs are "
4776 "integers, respectively represented using the types I<uid_t> and I<gid_t> "
4777 "(defined in I<E<lt>sys/types.hE<gt>>)."
4778 msgstr ""
4779
4780 #. type: Plain text
4781 #: build/C/man7/credentials.7:177
4782 msgid "On Linux, each process has the following user and group identifiers:"
4783 msgstr ""
4784
4785 #. type: Plain text
4786 #: build/C/man7/credentials.7:183
4787 msgid ""
4788 "Real user ID and real group ID.  These IDs determine who owns the process.  "
4789 "A process can obtain its real user (group) ID using B<getuid>(2)  "
4790 "(B<getgid>(2))."
4791 msgstr ""
4792
4793 #. type: Plain text
4794 #: build/C/man7/credentials.7:195
4795 msgid ""
4796 "Effective user ID and effective group ID.  These IDs are used by the kernel "
4797 "to determine the permissions that the process will have when accessing "
4798 "shared resources such as message queues, shared memory, and semaphores.  On "
4799 "most UNIX systems, these IDs also determine the permissions when accessing "
4800 "files.  However, Linux uses the filesystem IDs described below for this "
4801 "task.  A process can obtain its effective user (group) ID using "
4802 "B<geteuid>(2)  (B<getegid>(2))."
4803 msgstr ""
4804
4805 #. type: Plain text
4806 #: build/C/man7/credentials.7:217
4807 msgid ""
4808 "Saved set-user-ID and saved set-group-ID.  These IDs are used in set-user-ID "
4809 "and set-group-ID programs to save a copy of the corresponding effective IDs "
4810 "that were set when the program was executed (see B<execve>(2)).  A "
4811 "set-user-ID program can assume and drop privileges by switching its "
4812 "effective user ID back and forth between the values in its real user ID and "
4813 "saved set-user-ID.  This switching is done via calls to B<seteuid>(2), "
4814 "B<setreuid>(2), or B<setresuid>(2).  A set-group-ID program performs the "
4815 "analogous tasks using B<setegid>(2), B<setregid>(2), or B<setresgid>(2).  A "
4816 "process can obtain its saved set-user-ID (set-group-ID) using "
4817 "B<getresuid>(2)  (B<getresgid>(2))."
4818 msgstr ""
4819
4820 #. type: Plain text
4821 #: build/C/man7/credentials.7:234
4822 msgid ""
4823 "Filesystem user ID and filesystem group ID (Linux-specific).  These IDs, in "
4824 "conjunction with the supplementary group IDs described below, are used to "
4825 "determine permissions for accessing files; see B<path_resolution>(7)  for "
4826 "details.  Whenever a process's effective user (group) ID is changed, the "
4827 "kernel also automatically changes the filesystem user (group) ID to the same "
4828 "value.  Consequently, the filesystem IDs normally have the same values as "
4829 "the corresponding effective ID, and the semantics for file-permission checks "
4830 "are thus the same on Linux as on other UNIX systems.  The filesystem IDs can "
4831 "be made to differ from the effective IDs by calling B<setfsuid>(2)  and "
4832 "B<setfsgid>(2)."
4833 msgstr ""
4834
4835 #.  Since kernel 2.6.4, the limit is visible via the read-only file
4836 #.  /proc/sys/kernel/ngroups_max.
4837 #.  As at 2.6.22-rc2, this file is still read-only.
4838 #. type: Plain text
4839 #: build/C/man7/credentials.7:253
4840 msgid ""
4841 "Supplementary group IDs.  This is a set of additional group IDs that are "
4842 "used for permission checks when accessing files and other shared resources.  "
4843 "On Linux kernels before 2.6.4, a process can be a member of up to 32 "
4844 "supplementary groups; since kernel 2.6.4, a process can be a member of up to "
4845 "65536 supplementary groups.  The call I<sysconf(_SC_NGROUPS_MAX)> can be "
4846 "used to determine the number of supplementary groups of which a process may "
4847 "be a member.  A process can obtain its set of supplementary group IDs using "
4848 "B<getgroups>(2), and can modify the set using B<setgroups>(2)."
4849 msgstr ""
4850
4851 #. type: Plain text
4852 #: build/C/man7/credentials.7:263
4853 msgid ""
4854 "A child process created by B<fork>(2)  inherits copies of its parent's user "
4855 "and groups IDs.  During an B<execve>(2), a process's real user and group ID "
4856 "and supplementary group IDs are preserved; the effective and saved set IDs "
4857 "may be changed, as described in B<execve>(2)."
4858 msgstr ""
4859
4860 #. type: Plain text
4861 #: build/C/man7/credentials.7:266
4862 msgid ""
4863 "Aside from the purposes noted above, a process's user IDs are also employed "
4864 "in a number of other contexts:"
4865 msgstr ""
4866
4867 #. type: Plain text
4868 #: build/C/man7/credentials.7:269
4869 msgid "when determining the permissions for sending signals (see B<kill>(2));"
4870 msgstr ""
4871
4872 #. type: Plain text
4873 #: build/C/man7/credentials.7:280
4874 msgid ""
4875 "when determining the permissions for setting process-scheduling parameters "
4876 "(nice value, real time scheduling policy and priority, CPU affinity, I/O "
4877 "priority) using B<setpriority>(2), B<sched_setaffinity>(2), "
4878 "B<sched_setscheduler>(2), B<sched_setparam>(2), B<sched_setattr>(2), and "
4879 "B<ioprio_set>(2);"
4880 msgstr ""
4881
4882 #. type: Plain text
4883 #: build/C/man7/credentials.7:283
4884 msgid "when checking resource limits (see B<getrlimit>(2));"
4885 msgstr ""
4886
4887 #. type: Plain text
4888 #: build/C/man7/credentials.7:287
4889 msgid ""
4890 "when checking the limit on the number of inotify instances that the process "
4891 "may create (see B<inotify>(7))."
4892 msgstr ""
4893
4894 #. type: Plain text
4895 #: build/C/man7/credentials.7:293
4896 msgid ""
4897 "Process IDs, parent process IDs, process group IDs, and session IDs are "
4898 "specified in POSIX.1-2001.  The real, effective, and saved set user and "
4899 "groups IDs, and the supplementary group IDs, are specified in POSIX.1-2001.  "
4900 "The filesystem user and group IDs are a Linux extension."
4901 msgstr ""
4902
4903 #. type: Plain text
4904 #: build/C/man7/credentials.7:304
4905 msgid ""
4906 "The POSIX threads specification requires that credentials are shared by all "
4907 "of the threads in a process.  However, at the kernel level, Linux maintains "
4908 "separate user and group credentials for each thread.  The NPTL threading "
4909 "implementation does some work to ensure that any change to user or group "
4910 "credentials (e.g., calls to B<setuid>(2), B<setresuid>(2))  is carried "
4911 "through to all of the POSIX threads in a process."
4912 msgstr ""
4913
4914 #. type: Plain text
4915 #: build/C/man7/credentials.7:340
4916 msgid ""
4917 "B<bash>(1), B<csh>(1), B<ps>(1), B<access>(2), B<execve>(2), "
4918 "B<faccessat>(2), B<fork>(2), B<getgroups>(2), B<getpgrp>(2), B<getpid>(2), "
4919 "B<getppid>(2), B<getsid>(2), B<kill>(2), B<killpg>(2), B<setegid>(2), "
4920 "B<seteuid>(2), B<setfsgid>(2), B<setfsuid>(2), B<setgid>(2), "
4921 "B<setgroups>(2), B<setresgid>(2), B<setresuid>(2), B<setuid>(2), "
4922 "B<waitpid>(2), B<euidaccess>(3), B<initgroups>(3), B<tcgetpgrp>(3), "
4923 "B<tcsetpgrp>(3), B<capabilities>(7), B<namespaces>(7), "
4924 "B<path_resolution>(7), B<pid_namespaces>(7), B<signal>(7), "
4925 "B<user_namespaces>(7), B<unix>(7)"
4926 msgstr ""
4927
4928 #. type: TH
4929 #: build/C/man2/getgid.2:25
4930 #, no-wrap
4931 msgid "GETGID"
4932 msgstr ""
4933
4934 #. type: TH
4935 #: build/C/man2/getgid.2:25 build/C/man2/getresuid.2:28 build/C/man2/getuid.2:26
4936 #, no-wrap
4937 msgid "2010-11-22"
4938 msgstr ""
4939
4940 #. type: Plain text
4941 #: build/C/man2/getgid.2:28
4942 msgid "getgid, getegid - get group identity"
4943 msgstr ""
4944
4945 #. type: Plain text
4946 #: build/C/man2/getgid.2:30 build/C/man2/getgroups.2:38 build/C/man2/getpid.2:32 build/C/man2/getresuid.2:35 build/C/man2/getsid.2:31 build/C/man2/getuid.2:31 build/C/man3/group_member.3:30 build/C/man2/seteuid.2:36 build/C/man2/setgid.2:36 build/C/man2/setpgid.2:53 build/C/man2/setresuid.2:33 build/C/man2/setreuid.2:52 build/C/man2/setsid.2:37 build/C/man2/setuid.2:37
4947 msgid "B<#include E<lt>unistd.hE<gt>>"
4948 msgstr ""
4949
4950 #. type: Plain text
4951 #: build/C/man2/getgid.2:32 build/C/man2/getgroups.2:36 build/C/man2/getpid.2:30 build/C/man2/getuid.2:33 build/C/man2/seteuid.2:34 build/C/man2/setgid.2:34 build/C/man2/setreuid.2:50 build/C/man2/setuid.2:35
4952 msgid "B<#include E<lt>sys/types.hE<gt>>"
4953 msgstr ""
4954
4955 #. type: Plain text
4956 #: build/C/man2/getgid.2:34
4957 msgid "B<gid_t getgid(void);>"
4958 msgstr ""
4959
4960 #. type: Plain text
4961 #: build/C/man2/getgid.2:36
4962 msgid "B<gid_t getegid(void);>"
4963 msgstr ""
4964
4965 #. type: Plain text
4966 #: build/C/man2/getgid.2:39
4967 msgid "B<getgid>()  returns the real group ID of the calling process."
4968 msgstr ""
4969
4970 #. type: Plain text
4971 #: build/C/man2/getgid.2:42
4972 msgid "B<getegid>()  returns the effective group ID of the calling process."
4973 msgstr ""
4974
4975 #. type: Plain text
4976 #: build/C/man2/getgid.2:44 build/C/man2/getpid.2:46 build/C/man2/getuid.2:45
4977 msgid "These functions are always successful."
4978 msgstr ""
4979
4980 #. type: Plain text
4981 #: build/C/man2/getgid.2:46 build/C/man2/getuid.2:47
4982 msgid "POSIX.1-2001, 4.3BSD."
4983 msgstr ""
4984
4985 #. type: Plain text
4986 #: build/C/man2/getgid.2:62
4987 msgid ""
4988 "The original Linux B<getgid>()  and B<getegid>()  system calls supported "
4989 "only 16-bit group IDs.  Subsequently, Linux 2.4 added B<getgid32>()  and "
4990 "B<getegid32>(), supporting 32-bit IDs.  The glibc B<getgid>()  and "
4991 "B<getegid>()  wrapper functions transparently deal with the variations "
4992 "across kernel versions."
4993 msgstr ""
4994
4995 #. type: Plain text
4996 #: build/C/man2/getgid.2:67
4997 msgid "B<getresgid>(2), B<setgid>(2), B<setregid>(2), B<credentials>(7)"
4998 msgstr ""
4999
5000 #. type: TH
5001 #: build/C/man2/getgroups.2:31
5002 #, no-wrap
5003 msgid "GETGROUPS"
5004 msgstr ""
5005
5006 #. type: TH
5007 #: build/C/man2/getgroups.2:31 build/C/man2/getpriority.2:45
5008 #, no-wrap
5009 msgid "2014-08-19"
5010 msgstr ""
5011
5012 #. type: Plain text
5013 #: build/C/man2/getgroups.2:34
5014 msgid "getgroups, setgroups - get/set list of supplementary group IDs"
5015 msgstr ""
5016
5017 #. type: Plain text
5018 #: build/C/man2/getgroups.2:40
5019 msgid "B<int getgroups(int >I<size>B<, gid_t >I<list>B<[]);>"
5020 msgstr ""
5021
5022 #. type: Plain text
5023 #: build/C/man2/getgroups.2:42
5024 msgid "B<#include E<lt>grp.hE<gt>>"
5025 msgstr ""
5026
5027 #. type: Plain text
5028 #: build/C/man2/getgroups.2:44
5029 msgid "B<int setgroups(size_t >I<size>B<, const gid_t *>I<list>B<);>"
5030 msgstr ""
5031
5032 #. type: Plain text
5033 #: build/C/man2/getgroups.2:52
5034 msgid "B<setgroups>(): _BSD_SOURCE"
5035 msgstr ""
5036
5037 #. type: Plain text
5038 #: build/C/man2/getgroups.2:70
5039 msgid ""
5040 "B<getgroups>()  returns the supplementary group IDs of the calling process "
5041 "in I<list>.  The argument I<size> should be set to the maximum number of "
5042 "items that can be stored in the buffer pointed to by I<list>.  If the "
5043 "calling process is a member of more than I<size> supplementary groups, then "
5044 "an error results.  It is unspecified whether the effective group ID of the "
5045 "calling process is included in the returned list.  (Thus, an application "
5046 "should also call B<getegid>(2)  and add or remove the resulting value.)"
5047 msgstr ""
5048
5049 #. type: Plain text
5050 #: build/C/man2/getgroups.2:81
5051 msgid ""
5052 "If I<size> is zero, I<list> is not modified, but the total number of "
5053 "supplementary group IDs for the process is returned.  This allows the caller "
5054 "to determine the size of a dynamically allocated I<list> to be used in a "
5055 "further call to B<getgroups>()."
5056 msgstr ""
5057
5058 #. type: Plain text
5059 #: build/C/man2/getgroups.2:92
5060 msgid ""
5061 "B<setgroups>()  sets the supplementary group IDs for the calling process.  "
5062 "Appropriate privileges (Linux: the B<CAP_SETGID> capability) are required.  "
5063 "The I<size> argument specifies the number of supplementary group IDs in the "
5064 "buffer pointed to by I<list>."
5065 msgstr ""
5066
5067 #. type: Plain text
5068 #: build/C/man2/getgroups.2:99
5069 msgid ""
5070 "On success, B<getgroups>()  returns the number of supplementary group IDs.  "
5071 "On error, -1 is returned, and I<errno> is set appropriately."
5072 msgstr ""
5073
5074 #. type: Plain text
5075 #: build/C/man2/getgroups.2:106
5076 msgid ""
5077 "On success, B<setgroups>()  returns 0.  On error, -1 is returned, and "
5078 "I<errno> is set appropriately."
5079 msgstr ""
5080
5081 #. type: Plain text
5082 #: build/C/man2/getgroups.2:111
5083 msgid "I<list> has an invalid address."
5084 msgstr ""
5085
5086 #. type: Plain text
5087 #: build/C/man2/getgroups.2:114
5088 msgid "B<getgroups>()  can additionally fail with the following error:"
5089 msgstr ""
5090
5091 #. type: Plain text
5092 #: build/C/man2/getgroups.2:118
5093 msgid "I<size> is less than the number of supplementary group IDs, but is not zero."
5094 msgstr ""
5095
5096 #. type: Plain text
5097 #: build/C/man2/getgroups.2:121
5098 msgid "B<setgroups>()  can additionally fail with the following errors:"
5099 msgstr ""
5100
5101 #. type: Plain text
5102 #: build/C/man2/getgroups.2:127
5103 msgid ""
5104 "I<size> is greater than B<NGROUPS_MAX> (32 before Linux 2.6.4; 65536 since "
5105 "Linux 2.6.4)."
5106 msgstr ""
5107
5108 #. type: Plain text
5109 #: build/C/man2/getgroups.2:133
5110 msgid "The calling process has insufficient privilege."
5111 msgstr ""
5112
5113 #. type: Plain text
5114 #: build/C/man2/getgroups.2:141
5115 msgid ""
5116 "SVr4, 4.3BSD.  The B<getgroups>()  function is in POSIX.1-2001.  Since "
5117 "B<setgroups>()  requires privilege, it is not covered by POSIX.1-2001."
5118 msgstr ""
5119
5120 #. type: Plain text
5121 #: build/C/man2/getgroups.2:153
5122 msgid ""
5123 "A process can have up to B<NGROUPS_MAX> supplementary group IDs in addition "
5124 "to the effective group ID.  The constant B<NGROUPS_MAX> is defined in "
5125 "I<E<lt>limits.hE<gt>>.  The set of supplementary group IDs is inherited from "
5126 "the parent process, and preserved across an B<execve>(2)."
5127 msgstr ""
5128
5129 #. type: Plain text
5130 #: build/C/man2/getgroups.2:156
5131 msgid ""
5132 "The maximum number of supplementary group IDs can be found at run time using "
5133 "B<sysconf>(3):"
5134 msgstr ""
5135
5136 #. type: Plain text
5137 #: build/C/man2/getgroups.2:160
5138 #, no-wrap
5139 msgid ""
5140 "    long ngroups_max;\n"
5141 "    ngroups_max = sysconf(_SC_NGROUPS_MAX);\n"
5142 msgstr ""
5143
5144 #. type: Plain text
5145 #: build/C/man2/getgroups.2:168
5146 msgid ""
5147 "The maximum return value of B<getgroups>()  cannot be larger than one more "
5148 "than this value.  Since Linux 2.6.4, the maximum number of supplementary "
5149 "group IDs is also exposed via the Linux-specific read-only file, "
5150 "I</proc/sys/kernel/ngroups_max>."
5151 msgstr ""
5152
5153 #. type: Plain text
5154 #: build/C/man2/getgroups.2:178
5155 msgid ""
5156 "The original Linux B<getgroups>()  system call supported only 16-bit group "
5157 "IDs.  Subsequently, Linux 2.4 added B<getgroups32>(), supporting 32-bit "
5158 "IDs.  The glibc B<getgroups>()  wrapper function transparently deals with "
5159 "the variation across kernel versions."
5160 msgstr ""
5161
5162 #. type: Plain text
5163 #: build/C/man2/getgroups.2:186
5164 msgid ""
5165 "B<getgid>(2), B<setgid>(2), B<getgrouplist>(3), B<group_member>(3), "
5166 "B<initgroups>(3), B<capabilities>(7), B<credentials>(7)"
5167 msgstr ""
5168
5169 #. type: TH
5170 #: build/C/man2/getpid.2:25
5171 #, no-wrap
5172 msgid "GETPID"
5173 msgstr ""
5174
5175 #. type: Plain text
5176 #: build/C/man2/getpid.2:28
5177 msgid "getpid, getppid - get process identification"
5178 msgstr ""
5179
5180 #. type: Plain text
5181 #: build/C/man2/getpid.2:34
5182 msgid "B<pid_t getpid(void);>"
5183 msgstr ""
5184
5185 #. type: Plain text
5186 #: build/C/man2/getpid.2:36
5187 msgid "B<pid_t getppid(void);>"
5188 msgstr ""
5189
5190 #. type: Plain text
5191 #: build/C/man2/getpid.2:41
5192 msgid ""
5193 "B<getpid>()  returns the process ID of the calling process.  (This is often "
5194 "used by routines that generate unique temporary filenames.)"
5195 msgstr ""
5196
5197 #. type: Plain text
5198 #: build/C/man2/getpid.2:44
5199 msgid "B<getppid>()  returns the process ID of the parent of the calling process."
5200 msgstr ""
5201
5202 #. type: Plain text
5203 #: build/C/man2/getpid.2:48
5204 msgid "POSIX.1-2001, 4.3BSD, SVr4."
5205 msgstr ""
5206
5207 #.  The following program demonstrates this "feature":
5208 #
5209 #.  #define _GNU_SOURCE
5210 #.  #include <sys/syscall.h>
5211 #.  #include <sys/wait.h>
5212 #.  #include <stdio.h>
5213 #.  #include <stdlib.h>
5214 #.  #include <unistd.h>
5215 #
5216 #.  int
5217 #.  main(int argc, char *argv[])
5218 #.  {
5219 #.     /* The following statement fills the getpid() cache */
5220 #
5221 #.     printf("parent PID = %ld
5222 #. ", (long) getpid());
5223 #
5224 #.     if (syscall(SYS_fork) == 0) {
5225 #.         if (getpid() != syscall(SYS_getpid))
5226 #.             printf("child getpid() mismatch: getpid()=%ld; "
5227 #.                     "syscall(SYS_getpid)=%ld
5228 #. ",
5229 #.                     (long) getpid(), (long) syscall(SYS_getpid));
5230 #.         exit(EXIT_SUCCESS);
5231 #.     }
5232 #.     wait(NULL);
5233 #. }
5234 #. type: Plain text
5235 #: build/C/man2/getpid.2:100
5236 msgid ""
5237 "Since glibc version 2.3.4, the glibc wrapper function for B<getpid>()  "
5238 "caches PIDs, so as to avoid additional system calls when a process calls "
5239 "B<getpid>()  repeatedly.  Normally this caching is invisible, but its "
5240 "correct operation relies on support in the wrapper functions for B<fork>(2), "
5241 "B<vfork>(2), and B<clone>(2): if an application bypasses the glibc wrappers "
5242 "for these system calls by using B<syscall>(2), then a call to B<getpid>()  "
5243 "in the child will return the wrong value (to be precise: it will return the "
5244 "PID of the parent process).  See also B<clone>(2)  for discussion of a case "
5245 "where B<getpid>()  may return the wrong value even when invoking B<clone>(2)  "
5246 "via the glibc wrapper function."
5247 msgstr ""
5248
5249 #. type: Plain text
5250 #: build/C/man2/getpid.2:111
5251 msgid ""
5252 "B<clone>(2), B<fork>(2), B<kill>(2), B<exec>(3), B<mkstemp>(3), "
5253 "B<tempnam>(3), B<tmpfile>(3), B<tmpnam>(3), B<credentials>(7), "
5254 "B<pid_namespaces>(7)"
5255 msgstr ""
5256
5257 #. type: TH
5258 #: build/C/man2/getpriority.2:45
5259 #, no-wrap
5260 msgid "GETPRIORITY"
5261 msgstr ""
5262
5263 #. type: Plain text
5264 #: build/C/man2/getpriority.2:48
5265 msgid "getpriority, setpriority - get/set program scheduling priority"
5266 msgstr ""
5267
5268 #. type: Plain text
5269 #: build/C/man2/getpriority.2:50 build/C/man2/getrlimit.2:69 build/C/man2/getrusage.2:44
5270 msgid "B<#include E<lt>sys/time.hE<gt>>"
5271 msgstr ""
5272
5273 #. type: Plain text
5274 #: build/C/man2/getpriority.2:52 build/C/man2/getrlimit.2:71 build/C/man2/getrusage.2:46
5275 msgid "B<#include E<lt>sys/resource.hE<gt>>"
5276 msgstr ""
5277
5278 #. type: Plain text
5279 #: build/C/man2/getpriority.2:54
5280 msgid "B<int getpriority(int >I<which>B<, id_t >I<who>B<);>"
5281 msgstr ""
5282
5283 #. type: Plain text
5284 #: build/C/man2/getpriority.2:56
5285 msgid "B<int setpriority(int >I<which>B<, id_t >I<who>B<, int >I<prio>B<);>"
5286 msgstr ""
5287
5288 #. type: Plain text
5289 #: build/C/man2/getpriority.2:67
5290 msgid ""
5291 "The scheduling priority of the process, process group, or user, as indicated "
5292 "by I<which> and I<who> is obtained with the B<getpriority>()  call and set "
5293 "with the B<setpriority>()  call."
5294 msgstr ""
5295
5296 #. type: Plain text
5297 #: build/C/man2/getpriority.2:94
5298 msgid ""
5299 "The value I<which> is one of B<PRIO_PROCESS>, B<PRIO_PGRP>, or B<PRIO_USER>, "
5300 "and I<who> is interpreted relative to I<which> (a process identifier for "
5301 "B<PRIO_PROCESS>, process group identifier for B<PRIO_PGRP>, and a user ID "
5302 "for B<PRIO_USER>).  A zero value for I<who> denotes (respectively) the "
5303 "calling process, the process group of the calling process, or the real user "
5304 "ID of the calling process.  I<Prio> is a value in the range -20 to 19 (but "
5305 "see the Notes below).  The default priority is 0; lower priorities cause "
5306 "more favorable scheduling."
5307 msgstr ""
5308
5309 #. type: Plain text
5310 #: build/C/man2/getpriority.2:104
5311 msgid ""
5312 "The B<getpriority>()  call returns the highest priority (lowest numerical "
5313 "value)  enjoyed by any of the specified processes.  The B<setpriority>()  "
5314 "call sets the priorities of all of the specified processes to the specified "
5315 "value.  Only the superuser may lower priorities."
5316 msgstr ""
5317
5318 #. type: Plain text
5319 #: build/C/man2/getpriority.2:117
5320 msgid ""
5321 "Since B<getpriority>()  can legitimately return the value -1, it is "
5322 "necessary to clear the external variable I<errno> prior to the call, then "
5323 "check it afterward to determine if -1 is an error or a legitimate value.  "
5324 "The B<setpriority>()  call returns 0 if there is no error, or -1 if there "
5325 "is."
5326 msgstr ""
5327
5328 #. type: Plain text
5329 #: build/C/man2/getpriority.2:126
5330 msgid "I<which> was not one of B<PRIO_PROCESS>, B<PRIO_PGRP>, or B<PRIO_USER>."
5331 msgstr ""
5332
5333 #. type: Plain text
5334 #: build/C/man2/getpriority.2:133
5335 msgid "No process was located using the I<which> and I<who> values specified."
5336 msgstr ""
5337
5338 #. type: Plain text
5339 #: build/C/man2/getpriority.2:137
5340 msgid "In addition to the errors indicated above, B<setpriority>()  may fail if:"
5341 msgstr ""
5342
5343 #. type: Plain text
5344 #: build/C/man2/getpriority.2:149
5345 msgid ""
5346 "The caller attempted to lower a process priority, but did not have the "
5347 "required privilege (on Linux: did not have the B<CAP_SYS_NICE> capability).  "
5348 "Since Linux 2.6.12, this error occurs only if the caller attempts to set a "
5349 "process priority outside the range of the B<RLIMIT_NICE> soft resource limit "
5350 "of the target process; see B<getrlimit>(2)  for details."
5351 msgstr ""
5352
5353 #. type: Plain text
5354 #: build/C/man2/getpriority.2:157
5355 msgid ""
5356 "A process was located, but its effective user ID did not match either the "
5357 "effective or the real user ID of the caller, and was not privileged (on "
5358 "Linux: did not have the B<CAP_SYS_NICE> capability).  But see NOTES below."
5359 msgstr ""
5360
5361 #. type: Plain text
5362 #: build/C/man2/getpriority.2:160
5363 msgid "SVr4, 4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
5364 msgstr ""
5365
5366 #. type: Plain text
5367 #: build/C/man2/getpriority.2:166
5368 msgid ""
5369 "A child created by B<fork>(2)  inherits its parent's nice value.  The nice "
5370 "value is preserved across B<execve>(2)."
5371 msgstr ""
5372
5373 #. type: Plain text
5374 #: build/C/man2/getpriority.2:177
5375 msgid ""
5376 "The degree to which their relative nice value affects the scheduling of "
5377 "processes varies across UNIX systems, and, on Linux, across kernel "
5378 "versions.  Starting with kernel 2.6.23, Linux adopted an algorithm that "
5379 "causes relative differences in nice values to have a much stronger effect.  "
5380 "This causes very low nice values (+19) to truly provide little CPU to a "
5381 "process whenever there is any other higher priority load on the system, and "
5382 "makes high nice values (-20) deliver most of the CPU to applications that "
5383 "require it (e.g., some audio applications)."
5384 msgstr ""
5385
5386 #. type: Plain text
5387 #: build/C/man2/getpriority.2:192
5388 msgid ""
5389 "The details on the condition for B<EPERM> depend on the system.  The above "
5390 "description is what POSIX.1-2001 says, and seems to be followed on all "
5391 "System\\ V-like systems.  Linux kernels before 2.6.12 required the real or "
5392 "effective user ID of the caller to match the real user of the process I<who> "
5393 "(instead of its effective user ID).  Linux 2.6.12 and later require the "
5394 "effective user ID of the caller to match the real or effective user ID of "
5395 "the process I<who>.  All BSD-like systems (SunOS 4.1.3, Ultrix 4.2, 4.3BSD, "
5396 "FreeBSD 4.3, OpenBSD-2.5, ...) behave in the same manner as Linux 2.6.12 and "
5397 "later."
5398 msgstr ""
5399
5400 #. type: Plain text
5401 #: build/C/man2/getpriority.2:197
5402 msgid ""
5403 "The actual priority range varies between kernel versions.  Linux before "
5404 "1.3.36 had -infinity..15.  Since kernel 1.3.43, Linux has the range "
5405 "-20..19.  On some other systems, the range of nice values is -20..20."
5406 msgstr ""
5407
5408 #. type: Plain text
5409 #: build/C/man2/getpriority.2:210
5410 msgid ""
5411 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
5412 "portability.  (Indeed, I<E<lt>sys/resource.hE<gt>> defines the I<rusage> "
5413 "structure with fields of type I<struct timeval> defined in "
5414 "I<E<lt>sys/time.hE<gt>>.)"
5415 msgstr ""
5416
5417 #. type: SS
5418 #: build/C/man2/getpriority.2:210 build/C/man2/seteuid.2:132
5419 #, no-wrap
5420 msgid "C library/kernel ABI differences"
5421 msgstr ""
5422
5423 #. type: Plain text
5424 #: build/C/man2/getpriority.2:225
5425 msgid ""
5426 "Within the kernel, nice values are actually represented using the range "
5427 "40..1 (since negative numbers are error codes) and these are the values "
5428 "employed by the B<setpriority>()  and B<getpriority>()  system calls.  The "
5429 "glibc wrapper functions for these system calls handle the translations "
5430 "between the user-land and kernel representations of the nice value according "
5431 "to the formula I<unice\\ =\\ 20\\ -\\ knice>.  (Thus, the kernels 40..1 "
5432 "range corresponds to the range -20..19 as seen by user space.)"
5433 msgstr ""
5434
5435 #. type: Plain text
5436 #: build/C/man2/getpriority.2:232
5437 msgid ""
5438 "According to POSIX, the nice value is a per-process setting.  However, under "
5439 "the current Linux/NPTL implementation of POSIX threads, the nice value is a "
5440 "per-thread attribute: different threads in the same process can have "
5441 "different nice values.  Portable applications should avoid relying on the "
5442 "Linux behavior, which may be made standards conformant in the future."
5443 msgstr ""
5444
5445 #. type: Plain text
5446 #: build/C/man2/getpriority.2:238
5447 msgid "B<nice>(1), B<renice>(1), B<fork>(2), B<capabilities>(7), B<sched>(7)"
5448 msgstr ""
5449
5450 #. type: Plain text
5451 #: build/C/man2/getpriority.2:241
5452 msgid ""
5453 "I<Documentation/scheduler/sched-nice-design.txt> in the Linux kernel source "
5454 "tree (since Linux 2.6.23)"
5455 msgstr ""
5456
5457 #. type: TH
5458 #: build/C/man2/getresuid.2:28
5459 #, no-wrap
5460 msgid "GETRESUID"
5461 msgstr ""
5462
5463 #. type: Plain text
5464 #: build/C/man2/getresuid.2:31
5465 msgid "getresuid, getresgid - get real, effective and saved user/group IDs"
5466 msgstr ""
5467
5468 #. type: Plain text
5469 #: build/C/man2/getresuid.2:33 build/C/man2/setresuid.2:31
5470 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
5471 msgstr ""
5472
5473 #. type: Plain text
5474 #: build/C/man2/getresuid.2:37
5475 msgid "B<int getresuid(uid_t *>I<ruid>B<, uid_t *>I<euid>B<, uid_t *>I<suid>B<);>"
5476 msgstr ""
5477
5478 #. type: Plain text
5479 #: build/C/man2/getresuid.2:39
5480 msgid "B<int getresgid(gid_t *>I<rgid>B<, gid_t *>I<egid>B<, gid_t *>I<sgid>B<);>"
5481 msgstr ""
5482
5483 #. type: Plain text
5484 #: build/C/man2/getresuid.2:50
5485 msgid ""
5486 "B<getresuid>()  returns the real UID, the effective UID, and the saved "
5487 "set-user-ID of the calling process, in the arguments I<ruid>, I<euid>, and "
5488 "I<suid>, respectively.  B<getresgid>()  performs the analogous task for the "
5489 "process's group IDs."
5490 msgstr ""
5491
5492 #. type: Plain text
5493 #: build/C/man2/getresuid.2:60
5494 msgid ""
5495 "One of the arguments specified an address outside the calling program's "
5496 "address space."
5497 msgstr ""
5498
5499 #. type: Plain text
5500 #: build/C/man2/getresuid.2:62
5501 msgid "These system calls appeared on Linux starting with kernel 2.1.44."
5502 msgstr ""
5503
5504 #. type: Plain text
5505 #: build/C/man2/getresuid.2:67
5506 msgid ""
5507 "The prototypes are given by glibc since version 2.3.2, provided "
5508 "B<_GNU_SOURCE> is defined."
5509 msgstr ""
5510
5511 #. type: Plain text
5512 #: build/C/man2/getresuid.2:70 build/C/man2/setresuid.2:112
5513 msgid "These calls are nonstandard; they also appear on HP-UX and some of the BSDs."
5514 msgstr ""
5515
5516 #. type: Plain text
5517 #: build/C/man2/getresuid.2:86
5518 msgid ""
5519 "The original Linux B<getresuid>()  and B<getresgid>()  system calls "
5520 "supported only 16-bit user and group IDs.  Subsequently, Linux 2.4 added "
5521 "B<getresuid32>()  and B<getresgid32>(), supporting 32-bit IDs.  The glibc "
5522 "B<getresuid>()  and B<getresgid>()  wrapper functions transparently deal "
5523 "with the variations across kernel versions."
5524 msgstr ""
5525
5526 #. type: Plain text
5527 #: build/C/man2/getresuid.2:92
5528 msgid ""
5529 "B<getuid>(2), B<setresuid>(2), B<setreuid>(2), B<setuid>(2), "
5530 "B<credentials>(7)"
5531 msgstr ""
5532
5533 #. type: TH
5534 #: build/C/man2/getrlimit.2:64
5535 #, no-wrap
5536 msgid "GETRLIMIT"
5537 msgstr ""
5538
5539 #. type: TH
5540 #: build/C/man2/getrlimit.2:64
5541 #, no-wrap
5542 msgid "2015-01-22"
5543 msgstr ""
5544
5545 #. type: Plain text
5546 #: build/C/man2/getrlimit.2:67
5547 msgid "getrlimit, setrlimit, prlimit - get/set resource limits"
5548 msgstr ""
5549
5550 #. type: Plain text
5551 #: build/C/man2/getrlimit.2:73
5552 msgid "B<int getrlimit(int >I<resource>B<, struct rlimit *>I<rlim>B<);>"
5553 msgstr ""
5554
5555 #. type: Plain text
5556 #: build/C/man2/getrlimit.2:75
5557 msgid "B<int setrlimit(int >I<resource>B<, const struct rlimit *>I<rlim>B<);>"
5558 msgstr ""
5559
5560 #. type: Plain text
5561 #: build/C/man2/getrlimit.2:78
5562 msgid ""
5563 "B<int prlimit(pid_t >I<pid>B<, int >I<resource>B<, const struct rlimit "
5564 "*>I<new_limit>B<,>"
5565 msgstr ""
5566
5567 #. type: Plain text
5568 #: build/C/man2/getrlimit.2:80
5569 msgid "B< struct rlimit *>I<old_limit>B<);>"
5570 msgstr ""
5571
5572 #. type: Plain text
5573 #: build/C/man2/getrlimit.2:88
5574 msgid "B<prlimit>(): _GNU_SOURCE && _FILE_OFFSET_BITS == 64"
5575 msgstr ""
5576
5577 #. type: Plain text
5578 #: build/C/man2/getrlimit.2:97
5579 msgid ""
5580 "The B<getrlimit>()  and B<setrlimit>()  system calls get and set resource "
5581 "limits respectively.  Each resource has an associated soft and hard limit, "
5582 "as defined by the I<rlimit> structure:"
5583 msgstr ""
5584
5585 #. type: Plain text
5586 #: build/C/man2/getrlimit.2:104
5587 #, no-wrap
5588 msgid ""
5589 "struct rlimit {\n"
5590 "    rlim_t rlim_cur;  /* Soft limit */\n"
5591 "    rlim_t rlim_max;  /* Hard limit (ceiling for rlim_cur) */\n"
5592 "};\n"
5593 msgstr ""
5594
5595 #. type: Plain text
5596 #: build/C/man2/getrlimit.2:115
5597 msgid ""
5598 "The soft limit is the value that the kernel enforces for the corresponding "
5599 "resource.  The hard limit acts as a ceiling for the soft limit: an "
5600 "unprivileged process may set only its soft limit to a value in the range "
5601 "from 0 up to the hard limit, and (irreversibly) lower its hard limit.  A "
5602 "privileged process (under Linux: one with the B<CAP_SYS_RESOURCE> "
5603 "capability) may make arbitrary changes to either limit value."
5604 msgstr ""
5605
5606 #. type: Plain text
5607 #: build/C/man2/getrlimit.2:122
5608 msgid ""
5609 "The value B<RLIM_INFINITY> denotes no limit on a resource (both in the "
5610 "structure returned by B<getrlimit>()  and in the structure passed to "
5611 "B<setrlimit>())."
5612 msgstr ""
5613
5614 #. type: Plain text
5615 #: build/C/man2/getrlimit.2:126
5616 msgid "The I<resource> argument must be one of:"
5617 msgstr ""
5618
5619 #. type: TP
5620 #: build/C/man2/getrlimit.2:126
5621 #, no-wrap
5622 msgid "B<RLIMIT_AS>"
5623 msgstr ""
5624
5625 #.  since 2.0.27 / 2.1.12
5626 #. type: Plain text
5627 #: build/C/man2/getrlimit.2:146
5628 msgid ""
5629 "The maximum size of the process's virtual memory (address space) in bytes.  "
5630 "This limit affects calls to B<brk>(2), B<mmap>(2), and B<mremap>(2), which "
5631 "fail with the error B<ENOMEM> upon exceeding this limit.  Also automatic "
5632 "stack expansion will fail (and generate a B<SIGSEGV> that kills the process "
5633 "if no alternate stack has been made available via B<sigaltstack>(2)).  Since "
5634 "the value is a I<long>, on machines with a 32-bit I<long> either this limit "
5635 "is at most 2 GiB, or this resource is unlimited."
5636 msgstr ""
5637
5638 #. type: TP
5639 #: build/C/man2/getrlimit.2:146
5640 #, no-wrap
5641 msgid "B<RLIMIT_CORE>"
5642 msgstr ""
5643
5644 #. type: Plain text
5645 #: build/C/man2/getrlimit.2:154
5646 msgid ""
5647 "Maximum size of a I<core> file (see B<core>(5)).  When 0 no core dump files "
5648 "are created.  When nonzero, larger dumps are truncated to this size."
5649 msgstr ""
5650
5651 #. type: TP
5652 #: build/C/man2/getrlimit.2:154
5653 #, no-wrap
5654 msgid "B<RLIMIT_CPU>"
5655 msgstr ""
5656
5657 #. type: Plain text
5658 #: build/C/man2/getrlimit.2:174
5659 msgid ""
5660 "CPU time limit in seconds.  When the process reaches the soft limit, it is "
5661 "sent a B<SIGXCPU> signal.  The default action for this signal is to "
5662 "terminate the process.  However, the signal can be caught, and the handler "
5663 "can return control to the main program.  If the process continues to consume "
5664 "CPU time, it will be sent B<SIGXCPU> once per second until the hard limit is "
5665 "reached, at which time it is sent B<SIGKILL>.  (This latter point describes "
5666 "Linux behavior.  Implementations vary in how they treat processes which "
5667 "continue to consume CPU time after reaching the soft limit.  Portable "
5668 "applications that need to catch this signal should perform an orderly "
5669 "termination upon first receipt of B<SIGXCPU>.)"
5670 msgstr ""
5671
5672 #. type: TP
5673 #: build/C/man2/getrlimit.2:174
5674 #, no-wrap
5675 msgid "B<RLIMIT_DATA>"
5676 msgstr ""
5677
5678 #. type: Plain text
5679 #: build/C/man2/getrlimit.2:185
5680 msgid ""
5681 "The maximum size of the process's data segment (initialized data, "
5682 "uninitialized data, and heap).  This limit affects calls to B<brk>(2)  and "
5683 "B<sbrk>(2), which fail with the error B<ENOMEM> upon encountering the soft "
5684 "limit of this resource."
5685 msgstr ""
5686
5687 #. type: TP
5688 #: build/C/man2/getrlimit.2:185
5689 #, no-wrap
5690 msgid "B<RLIMIT_FSIZE>"
5691 msgstr ""
5692
5693 #. type: Plain text
5694 #: build/C/man2/getrlimit.2:197
5695 msgid ""
5696 "The maximum size of files that the process may create.  Attempts to extend a "
5697 "file beyond this limit result in delivery of a B<SIGXFSZ> signal.  By "
5698 "default, this signal terminates a process, but a process can catch this "
5699 "signal instead, in which case the relevant system call (e.g., B<write>(2), "
5700 "B<truncate>(2))  fails with the error B<EFBIG>."
5701 msgstr ""
5702
5703 #. type: TP
5704 #: build/C/man2/getrlimit.2:197
5705 #, no-wrap
5706 msgid "B<RLIMIT_LOCKS> (Early Linux 2.4 only)"
5707 msgstr ""
5708
5709 #.  to be precise: Linux 2.4.0-test9; no longer in 2.4.25 / 2.5.65
5710 #. type: Plain text
5711 #: build/C/man2/getrlimit.2:205
5712 msgid ""
5713 "A limit on the combined number of B<flock>(2)  locks and B<fcntl>(2)  leases "
5714 "that this process may establish."
5715 msgstr ""
5716
5717 #. type: TP
5718 #: build/C/man2/getrlimit.2:205
5719 #, no-wrap
5720 msgid "B<RLIMIT_MEMLOCK>"
5721 msgstr ""
5722
5723 #. type: Plain text
5724 #: build/C/man2/getrlimit.2:243
5725 msgid ""
5726 "The maximum number of bytes of memory that may be locked into RAM.  In "
5727 "effect this limit is rounded down to the nearest multiple of the system page "
5728 "size.  This limit affects B<mlock>(2)  and B<mlockall>(2)  and the "
5729 "B<mmap>(2)  B<MAP_LOCKED> operation.  Since Linux 2.6.9 it also affects the "
5730 "B<shmctl>(2)  B<SHM_LOCK> operation, where it sets a maximum on the total "
5731 "bytes in shared memory segments (see B<shmget>(2))  that may be locked by "
5732 "the real user ID of the calling process.  The B<shmctl>(2)  B<SHM_LOCK> "
5733 "locks are accounted for separately from the per-process memory locks "
5734 "established by B<mlock>(2), B<mlockall>(2), and B<mmap>(2)  B<MAP_LOCKED>; a "
5735 "process can lock bytes up to this limit in each of these two categories.  In "
5736 "Linux kernels before 2.6.9, this limit controlled the amount of memory that "
5737 "could be locked by a privileged process.  Since Linux 2.6.9, no limits are "
5738 "placed on the amount of memory that a privileged process may lock, and this "
5739 "limit instead governs the amount of memory that an unprivileged process may "
5740 "lock."
5741 msgstr ""
5742
5743 #. type: TP
5744 #: build/C/man2/getrlimit.2:243
5745 #, no-wrap
5746 msgid "B<RLIMIT_MSGQUEUE> (since Linux 2.6.8)"
5747 msgstr ""
5748
5749 #. type: Plain text
5750 #: build/C/man2/getrlimit.2:251
5751 msgid ""
5752 "Specifies the limit on the number of bytes that can be allocated for POSIX "
5753 "message queues for the real user ID of the calling process.  This limit is "
5754 "enforced for B<mq_open>(3).  Each message queue that the user creates counts "
5755 "(until it is removed)  against this limit according to the formula:"
5756 msgstr ""
5757
5758 #. type: Plain text
5759 #: build/C/man2/getrlimit.2:260
5760 #, no-wrap
5761 msgid ""
5762 "    Since Linux 3.5:\n"
5763 "        bytes = attr.mq_maxmsg * sizeof(struct msg_msg) +\n"
5764 "                min(attr.mq_maxmsg, MQ_PRIO_MAX) *\n"
5765 "                      sizeof(struct posix_msg_tree_node)+\n"
5766 "                                /* For overhead */\n"
5767 "                attr.mq_maxmsg * attr.mq_msgsize;\n"
5768 "                                /* For message data */\n"
5769 msgstr ""
5770
5771 #. type: Plain text
5772 #: build/C/man2/getrlimit.2:266
5773 #, no-wrap
5774 msgid ""
5775 "    Linux 3.4 and earlier:\n"
5776 "        bytes = attr.mq_maxmsg * sizeof(struct msg_msg *) +\n"
5777 "                                /* For overhead */\n"
5778 "                attr.mq_maxmsg * attr.mq_msgsize;\n"
5779 "                                /* For message data */\n"
5780 msgstr ""
5781
5782 #. type: Plain text
5783 #: build/C/man2/getrlimit.2:279
5784 msgid ""
5785 "where I<attr> is the I<mq_attr> structure specified as the fourth argument "
5786 "to B<mq_open>(3), and the I<msg_msg> and I<posix_msg_tree_node> structures "
5787 "are kernel-internal structures."
5788 msgstr ""
5789
5790 #. type: Plain text
5791 #: build/C/man2/getrlimit.2:285
5792 msgid ""
5793 "The \"overhead\" addend in the formula accounts for overhead bytes required "
5794 "by the implementation and ensures that the user cannot create an unlimited "
5795 "number of zero-length messages (such messages nevertheless each consume some "
5796 "system memory for bookkeeping overhead)."
5797 msgstr ""
5798
5799 #. type: TP
5800 #: build/C/man2/getrlimit.2:285
5801 #, no-wrap
5802 msgid "B<RLIMIT_NICE> (since Linux 2.6.12, but see BUGS below)"
5803 msgstr ""
5804
5805 #. type: Plain text
5806 #: build/C/man2/getrlimit.2:298
5807 msgid ""
5808 "Specifies a ceiling to which the process's nice value can be raised using "
5809 "B<setpriority>(2)  or B<nice>(2).  The actual ceiling for the nice value is "
5810 "calculated as I<20\\ -\\ rlim_cur>.  (This strangeness occurs because "
5811 "negative numbers cannot be specified as resource limit values, since they "
5812 "typically have special meanings.  For example, B<RLIM_INFINITY> typically is "
5813 "the same as -1.)"
5814 msgstr ""
5815
5816 #. type: TP
5817 #: build/C/man2/getrlimit.2:298
5818 #, no-wrap
5819 msgid "B<RLIMIT_NOFILE>"
5820 msgstr ""
5821
5822 #. type: Plain text
5823 #: build/C/man2/getrlimit.2:312
5824 msgid ""
5825 "Specifies a value one greater than the maximum file descriptor number that "
5826 "can be opened by this process.  Attempts (B<open>(2), B<pipe>(2), B<dup>(2), "
5827 "etc.)  to exceed this limit yield the error B<EMFILE>.  (Historically, this "
5828 "limit was named B<RLIMIT_OFILE> on BSD.)"
5829 msgstr ""
5830
5831 #. type: TP
5832 #: build/C/man2/getrlimit.2:312
5833 #, no-wrap
5834 msgid "B<RLIMIT_NPROC>"
5835 msgstr ""
5836
5837 #. type: Plain text
5838 #: build/C/man2/getrlimit.2:325
5839 msgid ""
5840 "The maximum number of processes (or, more precisely on Linux, threads)  that "
5841 "can be created for the real user ID of the calling process.  Upon "
5842 "encountering this limit, B<fork>(2)  fails with the error B<EAGAIN>.  This "
5843 "limit is not enforced for processes that have either the B<CAP_SYS_ADMIN> or "
5844 "the B<CAP_SYS_RESOURCE> capability."
5845 msgstr ""
5846
5847 #. type: TP
5848 #: build/C/man2/getrlimit.2:325
5849 #, no-wrap
5850 msgid "B<RLIMIT_RSS>"
5851 msgstr ""
5852
5853 #.  As at kernel 2.6.12, this limit still does nothing in 2.6 though
5854 #.  talk of making it do something has surfaced from time to time in LKML
5855 #.        -- MTK, Jul 05
5856 #. type: Plain text
5857 #: build/C/man2/getrlimit.2:337
5858 msgid ""
5859 "Specifies the limit (in pages) of the process's resident set (the number of "
5860 "virtual pages resident in RAM).  This limit has effect only in Linux 2.4.x, "
5861 "x E<lt> 30, and there affects only calls to B<madvise>(2)  specifying "
5862 "B<MADV_WILLNEED>."
5863 msgstr ""
5864
5865 #. type: TP
5866 #: build/C/man2/getrlimit.2:337
5867 #, no-wrap
5868 msgid "B<RLIMIT_RTPRIO> (since Linux 2.6.12, but see BUGS)"
5869 msgstr ""
5870
5871 #. type: Plain text
5872 #: build/C/man2/getrlimit.2:344
5873 msgid ""
5874 "Specifies a ceiling on the real-time priority that may be set for this "
5875 "process using B<sched_setscheduler>(2)  and B<sched_setparam>(2)."
5876 msgstr ""
5877
5878 #. type: TP
5879 #: build/C/man2/getrlimit.2:344
5880 #, no-wrap
5881 msgid "B<RLIMIT_RTTIME> (since Linux 2.6.25)"
5882 msgstr ""
5883
5884 #. type: Plain text
5885 #: build/C/man2/getrlimit.2:356
5886 msgid ""
5887 "Specifies a limit (in microseconds)  on the amount of CPU time that a "
5888 "process scheduled under a real-time scheduling policy may consume without "
5889 "making a blocking system call.  For the purpose of this limit, each time a "
5890 "process makes a blocking system call, the count of its consumed CPU time is "
5891 "reset to zero.  The CPU time count is not reset if the process continues "
5892 "trying to use the CPU but is preempted, its time slice expires, or it calls "
5893 "B<sched_yield>(2)."
5894 msgstr ""
5895
5896 #. type: Plain text
5897 #: build/C/man2/getrlimit.2:367
5898 msgid ""
5899 "Upon reaching the soft limit, the process is sent a B<SIGXCPU> signal.  If "
5900 "the process catches or ignores this signal and continues consuming CPU time, "
5901 "then B<SIGXCPU> will be generated once each second until the hard limit is "
5902 "reached, at which point the process is sent a B<SIGKILL> signal."
5903 msgstr ""
5904
5905 #. type: Plain text
5906 #: build/C/man2/getrlimit.2:370
5907 msgid ""
5908 "The intended use of this limit is to stop a runaway real-time process from "
5909 "locking up the system."
5910 msgstr ""
5911
5912 #. type: TP
5913 #: build/C/man2/getrlimit.2:370
5914 #, no-wrap
5915 msgid "B<RLIMIT_SIGPENDING> (since Linux 2.6.8)"
5916 msgstr ""
5917
5918 #.  This replaces the /proc/sys/kernel/rtsig-max system-wide limit
5919 #.  that was present in kernels <= 2.6.7.  MTK Dec 04
5920 #. type: Plain text
5921 #: build/C/man2/getrlimit.2:384
5922 msgid ""
5923 "Specifies the limit on the number of signals that may be queued for the real "
5924 "user ID of the calling process.  Both standard and real-time signals are "
5925 "counted for the purpose of checking this limit.  However, the limit is "
5926 "enforced only for B<sigqueue>(3); it is always possible to use B<kill>(2)  "
5927 "to queue one instance of any of the signals that are not already queued to "
5928 "the process."
5929 msgstr ""
5930
5931 #. type: TP
5932 #: build/C/man2/getrlimit.2:384
5933 #, no-wrap
5934 msgid "B<RLIMIT_STACK>"
5935 msgstr ""
5936
5937 #. type: Plain text
5938 #: build/C/man2/getrlimit.2:392
5939 msgid ""
5940 "The maximum size of the process stack, in bytes.  Upon reaching this limit, "
5941 "a B<SIGSEGV> signal is generated.  To handle this signal, a process must "
5942 "employ an alternate signal stack (B<sigaltstack>(2))."
5943 msgstr ""
5944
5945 #. type: Plain text
5946 #: build/C/man2/getrlimit.2:397
5947 msgid ""
5948 "Since Linux 2.6.23, this limit also determines the amount of space used for "
5949 "the process's command-line arguments and environment variables; for details, "
5950 "see B<execve>(2)."
5951 msgstr ""
5952
5953 #. type: SS
5954 #: build/C/man2/getrlimit.2:397
5955 #, no-wrap
5956 msgid "prlimit()"
5957 msgstr ""
5958
5959 #.  commit c022a0acad534fd5f5d5f17280f6d4d135e74e81
5960 #.  Author: Jiri Slaby <jslaby@suse.cz>
5961 #.  Date:   Tue May 4 18:03:50 2010 +0200
5962 #
5963 #.      rlimits: implement prlimit64 syscall
5964 #
5965 #.  commit 6a1d5e2c85d06da35cdfd93f1a27675bfdc3ad8c
5966 #.  Author: Jiri Slaby <jslaby@suse.cz>
5967 #.  Date:   Wed Mar 24 17:06:58 2010 +0100
5968 #
5969 #.      rlimits: add rlimit64 structure
5970 #. type: Plain text
5971 #: build/C/man2/getrlimit.2:417
5972 msgid ""
5973 "The Linux-specific B<prlimit>()  system call combines and extends the "
5974 "functionality of B<setrlimit>()  and B<getrlimit>().  It can be used to both "
5975 "set and get the resource limits of an arbitrary process."
5976 msgstr ""
5977
5978 #. type: Plain text
5979 #: build/C/man2/getrlimit.2:424
5980 msgid ""
5981 "The I<resource> argument has the same meaning as for B<setrlimit>()  and "
5982 "B<getrlimit>()."
5983 msgstr ""
5984
5985 #. type: Plain text
5986 #: build/C/man2/getrlimit.2:442
5987 msgid ""
5988 "If the I<new_limit> argument is a not NULL, then the I<rlimit> structure to "
5989 "which it points is used to set new values for the soft and hard limits for "
5990 "I<resource>.  If the I<old_limit> argument is a not NULL, then a successful "
5991 "call to B<prlimit>()  places the previous soft and hard limits for "
5992 "I<resource> in the I<rlimit> structure pointed to by I<old_limit>."
5993 msgstr ""
5994
5995 #.  FIXME . this permission check is strange
5996 #.  Asked about this on LKML, 7 Nov 2010
5997 #.      "Inconsistent credential checking in prlimit() syscall"
5998 #. type: Plain text
5999 #: build/C/man2/getrlimit.2:461
6000 msgid ""
6001 "The I<pid> argument specifies the ID of the process on which the call is to "
6002 "operate.  If I<pid> is 0, then the call applies to the calling process.  To "
6003 "set or get the resources of a process other than itself, the caller must "
6004 "have the B<CAP_SYS_RESOURCE> capability, or the real, effective, and saved "
6005 "set user IDs of the target process must match the real user ID of the caller "
6006 "I<and> the real, effective, and saved set group IDs of the target process "
6007 "must match the real group ID of the caller."
6008 msgstr ""
6009
6010 #. type: Plain text
6011 #: build/C/man2/getrlimit.2:466
6012 msgid ""
6013 "On success, these system calls return 0.  On error, -1 is returned, and "
6014 "I<errno> is set appropriately."
6015 msgstr ""
6016
6017 #. type: Plain text
6018 #: build/C/man2/getrlimit.2:471
6019 msgid ""
6020 "A pointer argument points to a location outside the accessible address "
6021 "space."
6022 msgstr ""
6023
6024 #. type: Plain text
6025 #: build/C/man2/getrlimit.2:483
6026 msgid ""
6027 "The value specified in I<resource> is not valid; or, for B<setrlimit>()  or "
6028 "B<prlimit>(): I<rlim-E<gt>rlim_cur> was greater than I<rlim-E<gt>rlim_max>."
6029 msgstr ""
6030
6031 #. type: Plain text
6032 #: build/C/man2/getrlimit.2:488
6033 msgid ""
6034 "An unprivileged process tried to raise the hard limit; the "
6035 "B<CAP_SYS_RESOURCE> capability is required to do this."
6036 msgstr ""
6037
6038 #. type: Plain text
6039 #: build/C/man2/getrlimit.2:496
6040 msgid ""
6041 "The caller tried to increase the hard B<RLIMIT_NOFILE> limit above the "
6042 "maximum defined by I</proc/sys/fs/nr_open> (see B<proc>(5))"
6043 msgstr ""
6044
6045 #. type: Plain text
6046 #: build/C/man2/getrlimit.2:502
6047 msgid ""
6048 "(B<prlimit>())  The calling process did not have permission to set limits "
6049 "for the process specified by I<pid>."
6050 msgstr ""
6051
6052 #. type: Plain text
6053 #: build/C/man2/getrlimit.2:506
6054 msgid "Could not find a process with the ID specified in I<pid>."
6055 msgstr ""
6056
6057 #. type: Plain text
6058 #: build/C/man2/getrlimit.2:511
6059 msgid ""
6060 "The B<prlimit>()  system call is available since Linux 2.6.36.  Library "
6061 "support is available since glibc 2.13."
6062 msgstr ""
6063
6064 #. type: Plain text
6065 #: build/C/man2/getrlimit.2:515
6066 msgid "B<getrlimit>(), B<setrlimit>(): SVr4, 4.3BSD, POSIX.1-2001."
6067 msgstr ""
6068
6069 #. type: Plain text
6070 #: build/C/man2/getrlimit.2:518
6071 msgid "B<prlimit>(): Linux-specific."
6072 msgstr ""
6073
6074 #. type: Plain text
6075 #: build/C/man2/getrlimit.2:534
6076 msgid ""
6077 "B<RLIMIT_MEMLOCK> and B<RLIMIT_NPROC> derive from BSD and are not specified "
6078 "in POSIX.1-2001; they are present on the BSDs and Linux, but on few other "
6079 "implementations.  B<RLIMIT_RSS> derives from BSD and is not specified in "
6080 "POSIX.1-2001; it is nevertheless present on most implementations.  "
6081 "B<RLIMIT_MSGQUEUE>, B<RLIMIT_NICE>, B<RLIMIT_RTPRIO>, B<RLIMIT_RTTIME>, and "
6082 "B<RLIMIT_SIGPENDING> are Linux-specific."
6083 msgstr ""
6084
6085 #. type: Plain text
6086 #: build/C/man2/getrlimit.2:540
6087 msgid ""
6088 "A child process created via B<fork>(2)  inherits its parent's resource "
6089 "limits.  Resource limits are preserved across B<execve>(2)."
6090 msgstr ""
6091
6092 #. type: Plain text
6093 #: build/C/man2/getrlimit.2:545
6094 msgid ""
6095 "Lowering the soft limit for a resource below the process's current "
6096 "consumption of that resource will succeed (but will prevent the process from "
6097 "further increasing its consumption of the resource)."
6098 msgstr ""
6099
6100 #. type: Plain text
6101 #: build/C/man2/getrlimit.2:554
6102 msgid ""
6103 "One can set the resource limits of the shell using the built-in I<ulimit> "
6104 "command (I<limit> in B<csh>(1)).  The shell's resource limits are inherited "
6105 "by the processes that it creates to execute commands."
6106 msgstr ""
6107
6108 #. type: Plain text
6109 #: build/C/man2/getrlimit.2:559
6110 msgid ""
6111 "Since Linux 2.6.24, the resource limits of any process can be inspected via "
6112 "I</proc/[pid]/limits>; see B<proc>(5)."
6113 msgstr ""
6114
6115 #. type: Plain text
6116 #: build/C/man2/getrlimit.2:568
6117 msgid ""
6118 "Ancient systems provided a B<vlimit>()  function with a similar purpose to "
6119 "B<setrlimit>().  For backward compatibility, glibc also provides "
6120 "B<vlimit>().  All new applications should be written using B<setrlimit>()."
6121 msgstr ""
6122
6123 #. type: SS
6124 #: build/C/man2/getrlimit.2:568
6125 #, no-wrap
6126 msgid "C library/ kernel ABI differences"
6127 msgstr ""
6128
6129 #. type: Plain text
6130 #: build/C/man2/getrlimit.2:577
6131 msgid ""
6132 "Since version 2.13, the glibc B<getrlimit>()  and B<setrlimit>()  wrapper "
6133 "functions no longer invoke the corresponding system calls, but instead "
6134 "employ B<prlimit>(), for the reasons described in BUGS."
6135 msgstr ""
6136
6137 #. type: Plain text
6138 #: build/C/man2/getrlimit.2:586
6139 msgid ""
6140 "In older Linux kernels, the B<SIGXCPU> and B<SIGKILL> signals delivered when "
6141 "a process encountered the soft and hard B<RLIMIT_CPU> limits were delivered "
6142 "one (CPU) second later than they should have been.  This was fixed in kernel "
6143 "2.6.8."
6144 msgstr ""
6145
6146 #.  see http://marc.theaimsgroup.com/?l=linux-kernel&m=114008066530167&w=2
6147 #. type: Plain text
6148 #: build/C/man2/getrlimit.2:594
6149 msgid ""
6150 "In 2.6.x kernels before 2.6.17, a B<RLIMIT_CPU> limit of 0 is wrongly "
6151 "treated as \"no limit\" (like B<RLIM_INFINITY>).  Since Linux 2.6.17, "
6152 "setting a limit of 0 does have an effect, but is actually treated as a limit "
6153 "of 1 second."
6154 msgstr ""
6155
6156 #.  See https://lwn.net/Articles/145008/
6157 #. type: Plain text
6158 #: build/C/man2/getrlimit.2:599
6159 msgid ""
6160 "A kernel bug means that B<RLIMIT_RTPRIO> does not work in kernel 2.6.12; the "
6161 "problem is fixed in kernel 2.6.13."
6162 msgstr ""
6163
6164 #.  see http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2
6165 #. type: Plain text
6166 #: build/C/man2/getrlimit.2:610
6167 msgid ""
6168 "In kernel 2.6.12, there was an off-by-one mismatch between the priority "
6169 "ranges returned by B<getpriority>(2)  and B<RLIMIT_NICE>.  This had the "
6170 "effect that the actual ceiling for the nice value was calculated as I<19\\ "
6171 "-\\ rlim_cur>.  This was fixed in kernel 2.6.13."
6172 msgstr ""
6173
6174 #.  The relevant patch, sent to LKML, seems to be
6175 #.  http://thread.gmane.org/gmane.linux.kernel/273462
6176 #.  From: Roland McGrath <roland <at> redhat.com>
6177 #.  Subject: [PATCH 7/7] make RLIMIT_CPU/SIGXCPU per-process
6178 #.  Date: 2005-01-23 23:27:46 GMT
6179 #.  Tested Solaris 10, FreeBSD 9, OpenBSD 5.0
6180 #.  FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=50951
6181 #. type: Plain text
6182 #: build/C/man2/getrlimit.2:637
6183 msgid ""
6184 "Since Linux 2.6.12, if a process reaches its soft B<RLIMIT_CPU> limit and "
6185 "has a handler installed for B<SIGXCPU>, then, in addition to invoking the "
6186 "signal handler, the kernel increases the soft limit by one second.  This "
6187 "behavior repeats if the process continues to consume CPU time, until the "
6188 "hard limit is reached, at which point the process is killed.  Other "
6189 "implementations do not change the B<RLIMIT_CPU> soft limit in this manner, "
6190 "and the Linux behavior is probably not standards conformant; portable "
6191 "applications should avoid relying on this Linux-specific behavior.  The "
6192 "Linux-specific B<RLIMIT_RTTIME> limit exhibits the same behavior when the "
6193 "soft limit is encountered."
6194 msgstr ""
6195
6196 #. type: Plain text
6197 #: build/C/man2/getrlimit.2:647
6198 msgid ""
6199 "Kernels before 2.4.22 did not diagnose the error B<EINVAL> for "
6200 "B<setrlimit>()  when I<rlim-E<gt>rlim_cur> was greater than "
6201 "I<rlim-E<gt>rlim_max>."
6202 msgstr ""
6203
6204 #. type: SS
6205 #: build/C/man2/getrlimit.2:647
6206 #, no-wrap
6207 msgid "Representation of \"large\" resource limit values on 32-bit platforms"
6208 msgstr ""
6209
6210 #.  https://bugzilla.kernel.org/show_bug.cgi?id=5042
6211 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=12201
6212 #. type: Plain text
6213 #: build/C/man2/getrlimit.2:678
6214 msgid ""
6215 "The glibc B<getrlimit>()  and B<setrlimit>()  wrapper functions use a 64-bit "
6216 "I<rlim_t> data type, even on 32-bit platforms.  However, the I<rlim_t> data "
6217 "type used in the B<getrlimit>()  and B<setrlimit>()  system calls is a "
6218 "(32-bit)  I<unsigned long>.  Furthermore, in Linux versions before 2.6.36, "
6219 "the kernel represents resource limits on 32-bit platforms as I<unsigned "
6220 "long>.  However, a 32-bit data type is not wide enough.  The most pertinent "
6221 "limit here is B<RLIMIT_FSIZE>, which specifies the maximum size to which a "
6222 "file can grow: to be useful, this limit must be represented using a type "
6223 "that is as wide as the type used to represent file offsets\\(emthat is, as "
6224 "wide as a 64-bit B<off_t> (assuming a program compiled with "
6225 "I<_FILE_OFFSET_BITS=64>)."
6226 msgstr ""
6227
6228 #. type: Plain text
6229 #: build/C/man2/getrlimit.2:688
6230 msgid ""
6231 "To work around this kernel limitation, if a program tried to set a resource "
6232 "limit to a value larger than can be represented in a 32-bit I<unsigned "
6233 "long>, then the glibc B<setrlimit>()  wrapper function silently converted "
6234 "the limit value to B<RLIM_INFINITY>.  In other words, the requested resource "
6235 "limit setting was silently ignored."
6236 msgstr ""
6237
6238 #. type: Plain text
6239 #: build/C/man2/getrlimit.2:690
6240 msgid "This problem was addressed in Linux 2.6.36 with two principal changes:"
6241 msgstr ""
6242
6243 #. type: Plain text
6244 #: build/C/man2/getrlimit.2:693
6245 msgid ""
6246 "the addition of a new kernel representation of resource limits that uses 64 "
6247 "bits, even on 32-bit platforms;"
6248 msgstr ""
6249
6250 #. type: Plain text
6251 #: build/C/man2/getrlimit.2:697
6252 msgid ""
6253 "the addition of the B<prlimit>()  system call, which employs 64-bit values "
6254 "for its resource limit arguments."
6255 msgstr ""
6256
6257 #.  https://www.sourceware.org/bugzilla/show_bug.cgi?id=12201
6258 #. type: Plain text
6259 #: build/C/man2/getrlimit.2:710
6260 msgid ""
6261 "Since version 2.13, glibc works around the limitations of the B<getrlimit>()  "
6262 "and B<setrlimit>()  system calls by implementing B<setrlimit>()  and "
6263 "B<getrlimit>()  as wrapper functions that call B<prlimit>()."
6264 msgstr ""
6265
6266 #. type: Plain text
6267 #: build/C/man2/getrlimit.2:713
6268 msgid "The program below demonstrates the use of B<prlimit>()."
6269 msgstr ""
6270
6271 #. type: Plain text
6272 #: build/C/man2/getrlimit.2:722
6273 #, no-wrap
6274 msgid ""
6275 "#define _GNU_SOURCE\n"
6276 "#define _FILE_OFFSET_BITS 64\n"
6277 "#include E<lt>stdio.hE<gt>\n"
6278 "#include E<lt>time.hE<gt>\n"
6279 "#include E<lt>stdlib.hE<gt>\n"
6280 "#include E<lt>unistd.hE<gt>\n"
6281 "#include E<lt>sys/resource.hE<gt>\n"
6282 msgstr ""
6283
6284 #. type: Plain text
6285 #: build/C/man2/getrlimit.2:725
6286 #, no-wrap
6287 msgid ""
6288 "#define errExit(msg) \tdo { perror(msg); exit(EXIT_FAILURE); \\e\n"
6289 "                        } while (0)\n"
6290 msgstr ""
6291
6292 #. type: Plain text
6293 #: build/C/man2/getrlimit.2:732
6294 #, no-wrap
6295 msgid ""
6296 "int\n"
6297 "main(int argc, char *argv[])\n"
6298 "{\n"
6299 "    struct rlimit old, new;\n"
6300 "    struct rlimit *newp;\n"
6301 "    pid_t pid;\n"
6302 msgstr ""
6303
6304 #. type: Plain text
6305 #: build/C/man2/getrlimit.2:738
6306 #, no-wrap
6307 msgid ""
6308 "    if (!(argc == 2 || argc == 4)) {\n"
6309 "        fprintf(stderr, \"Usage: %s E<lt>pidE<gt> [E<lt>new-soft-limitE<gt> "
6310 "\"\n"
6311 "                \"E<lt>new-hard-limitE<gt>]\\en\", argv[0]);\n"
6312 "        exit(EXIT_FAILURE);\n"
6313 "    }\n"
6314 msgstr ""
6315
6316 #. type: Plain text
6317 #: build/C/man2/getrlimit.2:740
6318 #, no-wrap
6319 msgid "    pid = atoi(argv[1]);        /* PID of target process */\n"
6320 msgstr ""
6321
6322 #. type: Plain text
6323 #: build/C/man2/getrlimit.2:747
6324 #, no-wrap
6325 msgid ""
6326 "    newp = NULL;\n"
6327 "    if (argc == 4) {\n"
6328 "        new.rlim_cur = atoi(argv[2]);\n"
6329 "        new.rlim_max = atoi(argv[3]);\n"
6330 "        newp = &new;\n"
6331 "    }\n"
6332 msgstr ""
6333
6334 #. type: Plain text
6335 #: build/C/man2/getrlimit.2:750
6336 #, no-wrap
6337 msgid ""
6338 "    /* Set CPU time limit of target process; retrieve and display\n"
6339 "       previous limit */\n"
6340 msgstr ""
6341
6342 #. type: Plain text
6343 #: build/C/man2/getrlimit.2:755
6344 #, no-wrap
6345 msgid ""
6346 "    if (prlimit(pid, RLIMIT_CPU, newp, &old) == -1)\n"
6347 "        errExit(\"prlimit-1\");\n"
6348 "    printf(\"Previous limits: soft=%lld; hard=%lld\\en\",\n"
6349 "            (long long) old.rlim_cur, (long long) old.rlim_max);\n"
6350 msgstr ""
6351
6352 #. type: Plain text
6353 #: build/C/man2/getrlimit.2:757
6354 #, no-wrap
6355 msgid "    /* Retrieve and display new CPU time limit */\n"
6356 msgstr ""
6357
6358 #. type: Plain text
6359 #: build/C/man2/getrlimit.2:762
6360 #, no-wrap
6361 msgid ""
6362 "    if (prlimit(pid, RLIMIT_CPU, NULL, &old) == -1)\n"
6363 "        errExit(\"prlimit-2\");\n"
6364 "    printf(\"New limits: soft=%lld; hard=%lld\\en\",\n"
6365 "            (long long) old.rlim_cur, (long long) old.rlim_max);\n"
6366 msgstr ""
6367
6368 #. type: Plain text
6369 #: build/C/man2/getrlimit.2:765 build/C/man7/user_namespaces.7:829
6370 #, no-wrap
6371 msgid ""
6372 "    exit(EXIT_FAILURE);\n"
6373 "}\n"
6374 msgstr ""
6375
6376 #. type: Plain text
6377 #: build/C/man2/getrlimit.2:784
6378 msgid ""
6379 "B<prlimit>(1), B<dup>(2), B<fcntl>(2), B<fork>(2), B<getrusage>(2), "
6380 "B<mlock>(2), B<mmap>(2), B<open>(2), B<quotactl>(2), B<sbrk>(2), "
6381 "B<shmctl>(2), B<malloc>(3), B<sigqueue>(3), B<ulimit>(3), B<core>(5), "
6382 "B<capabilities>(7), B<signal>(7)"
6383 msgstr ""
6384
6385 #. type: TH
6386 #: build/C/man2/getrusage.2:39
6387 #, no-wrap
6388 msgid "GETRUSAGE"
6389 msgstr ""
6390
6391 #. type: TH
6392 #: build/C/man2/getrusage.2:39
6393 #, no-wrap
6394 msgid "2014-05-10"
6395 msgstr ""
6396
6397 #. type: Plain text
6398 #: build/C/man2/getrusage.2:42
6399 msgid "getrusage - get resource usage"
6400 msgstr ""
6401
6402 #. type: Plain text
6403 #: build/C/man2/getrusage.2:48
6404 msgid "B<int getrusage(int >I<who>B<, struct rusage *>I<usage>B<);>"
6405 msgstr ""
6406
6407 #. type: Plain text
6408 #: build/C/man2/getrusage.2:54
6409 msgid ""
6410 "B<getrusage>()  returns resource usage measures for I<who>, which can be one "
6411 "of the following:"
6412 msgstr ""
6413
6414 #. type: TP
6415 #: build/C/man2/getrusage.2:54
6416 #, no-wrap
6417 msgid "B<RUSAGE_SELF>"
6418 msgstr ""
6419
6420 #. type: Plain text
6421 #: build/C/man2/getrusage.2:58
6422 msgid ""
6423 "Return resource usage statistics for the calling process, which is the sum "
6424 "of resources used by all threads in the process."
6425 msgstr ""
6426
6427 #. type: TP
6428 #: build/C/man2/getrusage.2:58
6429 #, no-wrap
6430 msgid "B<RUSAGE_CHILDREN>"
6431 msgstr ""
6432
6433 #. type: Plain text
6434 #: build/C/man2/getrusage.2:65
6435 msgid ""
6436 "Return resource usage statistics for all children of the calling process "
6437 "that have terminated and been waited for.  These statistics will include the "
6438 "resources used by grandchildren, and further removed descendants, if all of "
6439 "the intervening descendants waited on their terminated children."
6440 msgstr ""
6441
6442 #. type: TP
6443 #: build/C/man2/getrusage.2:65
6444 #, no-wrap
6445 msgid "B<RUSAGE_THREAD> (since Linux 2.6.26)"
6446 msgstr ""
6447
6448 #. type: Plain text
6449 #: build/C/man2/getrusage.2:75
6450 msgid ""
6451 "Return resource usage statistics for the calling thread.  The B<_GNU_SOURCE> "
6452 "feature test macro must be defined (before including I<any> header file)  in "
6453 "order to obtain the definition of this constant from "
6454 "I<E<lt>sys/resource.hE<gt>>."
6455 msgstr ""
6456
6457 #. type: Plain text
6458 #: build/C/man2/getrusage.2:79
6459 msgid ""
6460 "The resource usages are returned in the structure pointed to by I<usage>, "
6461 "which has the following form:"
6462 msgstr ""
6463
6464 #. type: Plain text
6465 #: build/C/man2/getrusage.2:100
6466 #, no-wrap
6467 msgid ""
6468 "struct rusage {\n"
6469 "    struct timeval ru_utime; /* user CPU time used */\n"
6470 "    struct timeval ru_stime; /* system CPU time used */\n"
6471 "    long   ru_maxrss;        /* maximum resident set size */\n"
6472 "    long   ru_ixrss;         /* integral shared memory size */\n"
6473 "    long   ru_idrss;         /* integral unshared data size */\n"
6474 "    long   ru_isrss;         /* integral unshared stack size */\n"
6475 "    long   ru_minflt;        /* page reclaims (soft page faults) */\n"
6476 "    long   ru_majflt;        /* page faults (hard page faults) */\n"
6477 "    long   ru_nswap;         /* swaps */\n"
6478 "    long   ru_inblock;       /* block input operations */\n"
6479 "    long   ru_oublock;       /* block output operations */\n"
6480 "    long   ru_msgsnd;        /* IPC messages sent */\n"
6481 "    long   ru_msgrcv;        /* IPC messages received */\n"
6482 "    long   ru_nsignals;      /* signals received */\n"
6483 "    long   ru_nvcsw;         /* voluntary context switches */\n"
6484 "    long   ru_nivcsw;        /* involuntary context switches */\n"
6485 "};\n"
6486 msgstr ""
6487
6488 #. type: Plain text
6489 #: build/C/man2/getrusage.2:108
6490 msgid ""
6491 "Not all fields are completed; unmaintained fields are set to zero by the "
6492 "kernel.  (The unmaintained fields are provided for compatibility with other "
6493 "systems, and because they may one day be supported on Linux.)  The fields "
6494 "are interpreted as follows:"
6495 msgstr ""
6496
6497 #. type: TP
6498 #: build/C/man2/getrusage.2:108
6499 #, no-wrap
6500 msgid "I<ru_utime>"
6501 msgstr ""
6502
6503 #. type: Plain text
6504 #: build/C/man2/getrusage.2:114
6505 msgid ""
6506 "This is the total amount of time spent executing in user mode, expressed in "
6507 "a I<timeval> structure (seconds plus microseconds)."
6508 msgstr ""
6509
6510 #. type: TP
6511 #: build/C/man2/getrusage.2:114
6512 #, no-wrap
6513 msgid "I<ru_stime>"
6514 msgstr ""
6515
6516 #. type: Plain text
6517 #: build/C/man2/getrusage.2:120
6518 msgid ""
6519 "This is the total amount of time spent executing in kernel mode, expressed "
6520 "in a I<timeval> structure (seconds plus microseconds)."
6521 msgstr ""
6522
6523 #. type: TP
6524 #: build/C/man2/getrusage.2:120
6525 #, no-wrap
6526 msgid "I<ru_maxrss> (since Linux 2.6.32)"
6527 msgstr ""
6528
6529 #. type: Plain text
6530 #: build/C/man2/getrusage.2:127
6531 msgid ""
6532 "This is the maximum resident set size used (in kilobytes).  For "
6533 "B<RUSAGE_CHILDREN>, this is the resident set size of the largest child, not "
6534 "the maximum resident set size of the process tree."
6535 msgstr ""
6536
6537 #. type: TP
6538 #: build/C/man2/getrusage.2:127
6539 #, no-wrap
6540 msgid "I<ru_ixrss> (unmaintained)"
6541 msgstr ""
6542
6543 #.  On some systems, this field records the number of signals received.
6544 #. type: Plain text
6545 #: build/C/man2/getrusage.2:133 build/C/man2/getrusage.2:138 build/C/man2/getrusage.2:143 build/C/man2/getrusage.2:155 build/C/man2/getrusage.2:167 build/C/man2/getrusage.2:173 build/C/man2/getrusage.2:177
6546 msgid "This field is currently unused on Linux."
6547 msgstr ""
6548
6549 #. type: TP
6550 #: build/C/man2/getrusage.2:133
6551 #, no-wrap
6552 msgid "I<ru_idrss> (unmaintained)"
6553 msgstr ""
6554
6555 #. type: TP
6556 #: build/C/man2/getrusage.2:138
6557 #, no-wrap
6558 msgid "I<ru_isrss> (unmaintained)"
6559 msgstr ""
6560
6561 #. type: TP
6562 #: build/C/man2/getrusage.2:143
6563 #, no-wrap
6564 msgid "I<ru_minflt>"
6565 msgstr ""
6566
6567 #. type: Plain text
6568 #: build/C/man2/getrusage.2:148
6569 msgid ""
6570 "The number of page faults serviced without any I/O activity; here I/O "
6571 "activity is avoided by ``reclaiming'' a page frame from the list of pages "
6572 "awaiting reallocation."
6573 msgstr ""
6574
6575 #. type: TP
6576 #: build/C/man2/getrusage.2:148
6577 #, no-wrap
6578 msgid "I<ru_majflt>"
6579 msgstr ""
6580
6581 #. type: Plain text
6582 #: build/C/man2/getrusage.2:151
6583 msgid "The number of page faults serviced that required I/O activity."
6584 msgstr ""
6585
6586 #. type: TP
6587 #: build/C/man2/getrusage.2:151
6588 #, no-wrap
6589 msgid "I<ru_nswap> (unmaintained)"
6590 msgstr ""
6591
6592 #. type: TP
6593 #: build/C/man2/getrusage.2:155
6594 #, no-wrap
6595 msgid "I<ru_inblock> (since Linux 2.6.22)"
6596 msgstr ""
6597
6598 #. type: Plain text
6599 #: build/C/man2/getrusage.2:158
6600 msgid "The number of times the filesystem had to perform input."
6601 msgstr ""
6602
6603 #. type: TP
6604 #: build/C/man2/getrusage.2:158
6605 #, no-wrap
6606 msgid "I<ru_oublock> (since Linux 2.6.22)"
6607 msgstr ""
6608
6609 #. type: Plain text
6610 #: build/C/man2/getrusage.2:161
6611 msgid "The number of times the filesystem had to perform output."
6612 msgstr ""
6613
6614 #. type: TP
6615 #: build/C/man2/getrusage.2:161
6616 #, no-wrap
6617 msgid "I<ru_msgsnd> (unmaintained)"
6618 msgstr ""
6619
6620 #. type: TP
6621 #: build/C/man2/getrusage.2:167
6622 #, no-wrap
6623 msgid "I<ru_msgrcv> (unmaintained)"
6624 msgstr ""
6625
6626 #. type: TP
6627 #: build/C/man2/getrusage.2:173
6628 #, no-wrap
6629 msgid "I<ru_nsignals> (unmaintained)"
6630 msgstr ""
6631
6632 #. type: TP
6633 #: build/C/man2/getrusage.2:177
6634 #, no-wrap
6635 msgid "I<ru_nvcsw> (since Linux 2.6)"
6636 msgstr ""
6637
6638 #. type: Plain text
6639 #: build/C/man2/getrusage.2:182
6640 msgid ""
6641 "The number of times a context switch resulted due to a process voluntarily "
6642 "giving up the processor before its time slice was completed (usually to "
6643 "await availability of a resource)."
6644 msgstr ""
6645
6646 #. type: TP
6647 #: build/C/man2/getrusage.2:182
6648 #, no-wrap
6649 msgid "I<ru_nivcsw> (since Linux 2.6)"
6650 msgstr ""
6651
6652 #. type: Plain text
6653 #: build/C/man2/getrusage.2:187
6654 msgid ""
6655 "The number of times a context switch resulted due to a higher priority "
6656 "process becoming runnable or because the current process exceeded its time "
6657 "slice."
6658 msgstr ""
6659
6660 #. type: Plain text
6661 #: build/C/man2/getrusage.2:198
6662 msgid "I<usage> points outside the accessible address space."
6663 msgstr ""
6664
6665 #. type: Plain text
6666 #: build/C/man2/getrusage.2:202
6667 msgid "I<who> is invalid."
6668 msgstr ""
6669
6670 #. type: Plain text
6671 #: build/C/man2/getrusage.2:210
6672 msgid ""
6673 "SVr4, 4.3BSD.  POSIX.1-2001 specifies B<getrusage>(), but specifies only the "
6674 "fields I<ru_utime> and I<ru_stime>."
6675 msgstr ""
6676
6677 #. type: Plain text
6678 #: build/C/man2/getrusage.2:213
6679 msgid "B<RUSAGE_THREAD> is Linux-specific."
6680 msgstr ""
6681
6682 #. type: Plain text
6683 #: build/C/man2/getrusage.2:216
6684 msgid "Resource usage metrics are preserved across an B<execve>(2)."
6685 msgstr ""
6686
6687 #. type: Plain text
6688 #: build/C/man2/getrusage.2:224
6689 msgid ""
6690 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
6691 "portability.  (Indeed, I<struct timeval> is defined in "
6692 "I<E<lt>sys/time.hE<gt>>.)"
6693 msgstr ""
6694
6695 #.  See the description of getrusage() in XSH.
6696 #.  A similar statement was also in SUSv2.
6697 #. type: Plain text
6698 #: build/C/man2/getrusage.2:236
6699 msgid ""
6700 "In Linux kernel versions before 2.6.9, if the disposition of B<SIGCHLD> is "
6701 "set to B<SIG_IGN> then the resource usages of child processes are "
6702 "automatically included in the value returned by B<RUSAGE_CHILDREN>, although "
6703 "POSIX.1-2001 explicitly prohibits this.  This nonconformance is rectified in "
6704 "Linux 2.6.9 and later."
6705 msgstr ""
6706
6707 #. type: Plain text
6708 #: build/C/man2/getrusage.2:239
6709 msgid ""
6710 "The structure definition shown at the start of this page was taken from "
6711 "4.3BSD Reno."
6712 msgstr ""
6713
6714 #. type: Plain text
6715 #: build/C/man2/getrusage.2:248
6716 msgid ""
6717 "Ancient systems provided a B<vtimes>()  function with a similar purpose to "
6718 "B<getrusage>().  For backward compatibility, glibc also provides "
6719 "B<vtimes>().  All new applications should be written using B<getrusage>()."
6720 msgstr ""
6721
6722 #. type: Plain text
6723 #: build/C/man2/getrusage.2:253
6724 msgid "See also the description of I</proc/PID/stat> in B<proc>(5)."
6725 msgstr ""
6726
6727 #. type: Plain text
6728 #: build/C/man2/getrusage.2:260
6729 msgid ""
6730 "B<clock_gettime>(2), B<getrlimit>(2), B<times>(2), B<wait>(2), B<wait4>(2), "
6731 "B<clock>(3)"
6732 msgstr ""
6733
6734 #. type: TH
6735 #: build/C/man2/getsid.2:26
6736 #, no-wrap
6737 msgid "GETSID"
6738 msgstr ""
6739
6740 #. type: TH
6741 #: build/C/man2/getsid.2:26
6742 #, no-wrap
6743 msgid "2010-09-26"
6744 msgstr ""
6745
6746 #. type: Plain text
6747 #: build/C/man2/getsid.2:29
6748 msgid "getsid - get session ID"
6749 msgstr ""
6750
6751 #. type: Plain text
6752 #: build/C/man2/getsid.2:33
6753 msgid "B<pid_t getsid(pid_t>I< pid>B<);>"
6754 msgstr ""
6755
6756 #. type: Plain text
6757 #: build/C/man2/getsid.2:42
6758 msgid "B<getsid>():"
6759 msgstr ""
6760
6761 #. type: Plain text
6762 #: build/C/man2/getsid.2:45 build/C/man2/setpgid.2:79
6763 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
6764 msgstr ""
6765
6766 #. type: Plain text
6767 #: build/C/man2/getsid.2:47 build/C/man2/setpgid.2:81
6768 msgid "|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
6769 msgstr ""
6770
6771 #. type: Plain text
6772 #: build/C/man2/getsid.2:58
6773 msgid ""
6774 "I<getsid(0)> returns the session ID of the calling process.  I<getsid(p)> "
6775 "returns the session ID of the process with process ID I<p>.  (The session ID "
6776 "of a process is the process group ID of the session leader.)"
6777 msgstr ""
6778
6779 #. type: Plain text
6780 #: build/C/man2/getsid.2:63
6781 msgid ""
6782 "On success, a session ID is returned.  On error, I<(pid_t)\\ -1> will be "
6783 "returned, and I<errno> is set appropriately."
6784 msgstr ""
6785
6786 #. type: Plain text
6787 #: build/C/man2/getsid.2:70
6788 msgid ""
6789 "A process with process ID I<p> exists, but it is not in the same session as "
6790 "the calling process, and the implementation considers this an error."
6791 msgstr ""
6792
6793 #. type: Plain text
6794 #: build/C/man2/getsid.2:75
6795 msgid "No process with process ID I<p> was found."
6796 msgstr ""
6797
6798 #.  Linux has this system call since Linux 1.3.44.
6799 #.  There is libc support since libc 5.2.19.
6800 #. type: Plain text
6801 #: build/C/man2/getsid.2:79
6802 msgid "This system call is available on Linux since version 2.0."
6803 msgstr ""
6804
6805 #. type: Plain text
6806 #: build/C/man2/getsid.2:81 build/C/man2/setgid.2:73 build/C/man2/setsid.2:70
6807 msgid "SVr4, POSIX.1-2001."
6808 msgstr ""
6809
6810 #. type: Plain text
6811 #: build/C/man2/getsid.2:84
6812 msgid "Linux does not return B<EPERM>."
6813 msgstr ""
6814
6815 #. type: Plain text
6816 #: build/C/man2/getsid.2:88
6817 msgid "B<getpgid>(2), B<setsid>(2), B<credentials>(7)"
6818 msgstr ""
6819
6820 #. type: TH
6821 #: build/C/man2/getuid.2:26
6822 #, no-wrap
6823 msgid "GETUID"
6824 msgstr ""
6825
6826 #. type: Plain text
6827 #: build/C/man2/getuid.2:29
6828 msgid "getuid, geteuid - get user identity"
6829 msgstr ""
6830
6831 #. type: Plain text
6832 #: build/C/man2/getuid.2:35
6833 msgid "B<uid_t getuid(void);>"
6834 msgstr ""
6835
6836 #. type: Plain text
6837 #: build/C/man2/getuid.2:37
6838 msgid "B<uid_t geteuid(void);>"
6839 msgstr ""
6840
6841 #. type: Plain text
6842 #: build/C/man2/getuid.2:40
6843 msgid "B<getuid>()  returns the real user ID of the calling process."
6844 msgstr ""
6845
6846 #. type: Plain text
6847 #: build/C/man2/getuid.2:43
6848 msgid "B<geteuid>()  returns the effective user ID of the calling process."
6849 msgstr ""
6850
6851 #. type: SS
6852 #: build/C/man2/getuid.2:48
6853 #, no-wrap
6854 msgid "History"
6855 msgstr ""
6856
6857 #. type: Plain text
6858 #: build/C/man2/getuid.2:57
6859 msgid ""
6860 "In UNIX\\ V6 the B<getuid>()  call returned I<(euid E<lt>E<lt> 8) + uid>.  "
6861 "UNIX\\ V7 introduced separate calls B<getuid>()  and B<geteuid>()."
6862 msgstr ""
6863
6864 #. type: Plain text
6865 #: build/C/man2/getuid.2:73
6866 msgid ""
6867 "The original Linux B<getuid>()  and B<geteuid>()  system calls supported "
6868 "only 16-bit user IDs.  Subsequently, Linux 2.4 added B<getuid32>()  and "
6869 "B<geteuid32>(), supporting 32-bit IDs.  The glibc B<getuid>()  and "
6870 "B<geteuid>()  wrapper functions transparently deal with the variations "
6871 "across kernel versions."
6872 msgstr ""
6873
6874 #. type: Plain text
6875 #: build/C/man2/getuid.2:78
6876 msgid "B<getresuid>(2), B<setreuid>(2), B<setuid>(2), B<credentials>(7)"
6877 msgstr ""
6878
6879 #. type: TH
6880 #: build/C/man3/group_member.3:25
6881 #, no-wrap
6882 msgid "GROUP_MEMBER"
6883 msgstr ""
6884
6885 #. type: TH
6886 #: build/C/man3/group_member.3:25
6887 #, no-wrap
6888 msgid "2014-03-30"
6889 msgstr ""
6890
6891 #. type: TH
6892 #: build/C/man3/group_member.3:25
6893 #, no-wrap
6894 msgid "GNU"
6895 msgstr ""
6896
6897 #. type: Plain text
6898 #: build/C/man3/group_member.3:28
6899 msgid "group_member - test whether a process is in a group"
6900 msgstr ""
6901
6902 #. type: Plain text
6903 #: build/C/man3/group_member.3:32
6904 msgid "B<int group_member(gid_t >I<gid>B<);>"
6905 msgstr ""
6906
6907 #. type: Plain text
6908 #: build/C/man3/group_member.3:40
6909 msgid "B<group_member>(): _GNU_SOURCE"
6910 msgstr ""
6911
6912 #. type: Plain text
6913 #: build/C/man3/group_member.3:48
6914 msgid ""
6915 "The B<group_member>()  function tests whether any of the caller's "
6916 "supplementary group IDs (as returned by B<getgroups>(2))  matches I<gid>."
6917 msgstr ""
6918
6919 #. type: Plain text
6920 #: build/C/man3/group_member.3:55
6921 msgid ""
6922 "The B<group_member>()  function returns nonzero if any of the caller's "
6923 "supplementary group IDs matches I<gid>, and zero otherwise."
6924 msgstr ""
6925
6926 #. type: Plain text
6927 #: build/C/man3/group_member.3:57
6928 msgid "This function is a nonstandard GNU extension."
6929 msgstr ""
6930
6931 #. type: Plain text
6932 #: build/C/man3/group_member.3:62
6933 msgid "B<getgid>(2), B<getgroups>(2), B<getgrouplist>(3), B<group>(5)"
6934 msgstr ""
6935
6936 #. type: TH
6937 #: build/C/man2/iopl.2:33
6938 #, no-wrap
6939 msgid "IOPL"
6940 msgstr ""
6941
6942 #. type: TH
6943 #: build/C/man2/iopl.2:33
6944 #, no-wrap
6945 msgid "2013-03-15"
6946 msgstr ""
6947
6948 #. type: Plain text
6949 #: build/C/man2/iopl.2:36
6950 msgid "iopl - change I/O privilege level"
6951 msgstr ""
6952
6953 #. type: Plain text
6954 #: build/C/man2/iopl.2:38
6955 msgid "B<#include E<lt>sys/io.hE<gt>>"
6956 msgstr ""
6957
6958 #. type: Plain text
6959 #: build/C/man2/iopl.2:40
6960 msgid "B<int iopl(int >I<level>B<);>"
6961 msgstr ""
6962
6963 #. type: Plain text
6964 #: build/C/man2/iopl.2:45
6965 msgid ""
6966 "B<iopl>()  changes the I/O privilege level of the calling process, as "
6967 "specified by the two least significant bits in I<level>."
6968 msgstr ""
6969
6970 #. type: Plain text
6971 #: build/C/man2/iopl.2:51
6972 msgid ""
6973 "This call is necessary to allow 8514-compatible X servers to run under "
6974 "Linux.  Since these X servers require access to all 65536 I/O ports, the "
6975 "B<ioperm>(2)  call is not sufficient."
6976 msgstr ""
6977
6978 #. type: Plain text
6979 #: build/C/man2/iopl.2:55
6980 msgid ""
6981 "In addition to granting unrestricted I/O port access, running at a higher "
6982 "I/O privilege level also allows the process to disable interrupts.  This "
6983 "will probably crash the system, and is not recommended."
6984 msgstr ""
6985
6986 #. type: Plain text
6987 #: build/C/man2/iopl.2:60
6988 msgid "Permissions are inherited by B<fork>(2)  and B<execve>(2)."
6989 msgstr ""
6990
6991 #. type: Plain text
6992 #: build/C/man2/iopl.2:62
6993 msgid "The I/O privilege level for a normal process is 0."
6994 msgstr ""
6995
6996 #. type: Plain text
6997 #: build/C/man2/iopl.2:66
6998 msgid ""
6999 "This call is mostly for the i386 architecture.  On many other architectures "
7000 "it does not exist or will always return an error."
7001 msgstr ""
7002
7003 #. type: Plain text
7004 #: build/C/man2/iopl.2:76
7005 msgid "I<level> is greater than 3."
7006 msgstr ""
7007
7008 #. type: Plain text
7009 #: build/C/man2/iopl.2:79
7010 msgid "This call is unimplemented."
7011 msgstr ""
7012
7013 #. type: Plain text
7014 #: build/C/man2/iopl.2:87
7015 msgid ""
7016 "The calling process has insufficient privilege to call B<iopl>(); the "
7017 "B<CAP_SYS_RAWIO> capability is required to raise the I/O privilege level "
7018 "above its current value."
7019 msgstr ""
7020
7021 #. type: Plain text
7022 #: build/C/man2/iopl.2:91
7023 msgid ""
7024 "B<iopl>()  is Linux-specific and should not be used in programs that are "
7025 "intended to be portable."
7026 msgstr ""
7027
7028 #. type: Plain text
7029 #: build/C/man2/iopl.2:100
7030 msgid ""
7031 "Libc5 treats it as a system call and has a prototype in "
7032 "I<E<lt>unistd.hE<gt>>.  Glibc1 does not have a prototype.  Glibc2 has a "
7033 "prototype both in I<E<lt>sys/io.hE<gt>> and in I<E<lt>sys/perm.hE<gt>>.  "
7034 "Avoid the latter, it is available on i386 only."
7035 msgstr ""
7036
7037 #. type: Plain text
7038 #: build/C/man2/iopl.2:104
7039 msgid "B<ioperm>(2), B<outb>(2), B<capabilities>(7)"
7040 msgstr ""
7041
7042 #. type: TH
7043 #: build/C/man2/ioprio_set.2:24
7044 #, no-wrap
7045 msgid "IOPRIO_SET"
7046 msgstr ""
7047
7048 #. type: TH
7049 #: build/C/man2/ioprio_set.2:24
7050 #, no-wrap
7051 msgid "2013-02-12"
7052 msgstr ""
7053
7054 #. type: Plain text
7055 #: build/C/man2/ioprio_set.2:27
7056 msgid "ioprio_get, ioprio_set - get/set I/O scheduling class and priority"
7057 msgstr ""
7058
7059 #. type: Plain text
7060 #: build/C/man2/ioprio_set.2:31
7061 #, no-wrap
7062 msgid ""
7063 "B<int ioprio_get(int >I<which>B<, int >I<who>B<);>\n"
7064 "B<int ioprio_set(int >I<which>B<, int >I<who>B<, int >I<ioprio>B<);>\n"
7065 msgstr ""
7066
7067 #. type: Plain text
7068 #: build/C/man2/ioprio_set.2:35
7069 msgid "I<Note>: There are no glibc wrappers for these system calls; see NOTES."
7070 msgstr ""
7071
7072 #. type: Plain text
7073 #: build/C/man2/ioprio_set.2:42
7074 msgid ""
7075 "The B<ioprio_get>()  and B<ioprio_set>()  system calls respectively get and "
7076 "set the I/O scheduling class and priority of one or more threads."
7077 msgstr ""
7078
7079 #. type: Plain text
7080 #: build/C/man2/ioprio_set.2:54
7081 msgid ""
7082 "The I<which> and I<who> arguments identify the thread(s) on which the system "
7083 "calls operate.  The I<which> argument determines how I<who> is interpreted, "
7084 "and has one of the following values:"
7085 msgstr ""
7086
7087 #. type: TP
7088 #: build/C/man2/ioprio_set.2:54
7089 #, no-wrap
7090 msgid "B<IOPRIO_WHO_PROCESS>"
7091 msgstr ""
7092
7093 #. type: Plain text
7094 #: build/C/man2/ioprio_set.2:61
7095 msgid ""
7096 "I<who> is a process ID or thread ID identifying a single process or thread.  "
7097 "If I<who> is 0, then operate on the calling thread."
7098 msgstr ""
7099
7100 #. type: TP
7101 #: build/C/man2/ioprio_set.2:61
7102 #, no-wrap
7103 msgid "B<IOPRIO_WHO_PGRP>"
7104 msgstr ""
7105
7106 #. type: Plain text
7107 #: build/C/man2/ioprio_set.2:68
7108 msgid ""
7109 "I<who> is a process group ID identifying all the members of a process "
7110 "group.  If I<who> is 0, then operate on the process group of which the "
7111 "caller is a member."
7112 msgstr ""
7113
7114 #. type: TP
7115 #: build/C/man2/ioprio_set.2:68
7116 #, no-wrap
7117 msgid "B<IOPRIO_WHO_USER>"
7118 msgstr ""
7119
7120 #.  FIXME . Need to document the behavior when 'who" is specified as 0
7121 #.  See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652443
7122 #. type: Plain text
7123 #: build/C/man2/ioprio_set.2:75
7124 msgid ""
7125 "I<who> is a user ID identifying all of the processes that have a matching "
7126 "real UID."
7127 msgstr ""
7128
7129 #. type: Plain text
7130 #: build/C/man2/ioprio_set.2:98
7131 msgid ""
7132 "If I<which> is specified as B<IOPRIO_WHO_PGRP> or B<IOPRIO_WHO_USER> when "
7133 "calling B<ioprio_get>(), and more than one process matches I<who>, then the "
7134 "returned priority will be the highest one found among all of the matching "
7135 "processes.  One priority is said to be higher than another one if it belongs "
7136 "to a higher priority class (B<IOPRIO_CLASS_RT> is the highest priority "
7137 "class; B<IOPRIO_CLASS_IDLE> is the lowest)  or if it belongs to the same "
7138 "priority class as the other process but has a higher priority level (a lower "
7139 "priority number means a higher priority level)."
7140 msgstr ""
7141
7142 #. type: Plain text
7143 #: build/C/man2/ioprio_set.2:108
7144 msgid ""
7145 "The I<ioprio> argument given to B<ioprio_set>()  is a bit mask that "
7146 "specifies both the scheduling class and the priority to be assigned to the "
7147 "target process(es).  The following macros are used for assembling and "
7148 "dissecting I<ioprio> values:"
7149 msgstr ""
7150
7151 #. type: TP
7152 #: build/C/man2/ioprio_set.2:108
7153 #, no-wrap
7154 msgid "B<IOPRIO_PRIO_VALUE(>I<class>B<, >I<data>B<)>"
7155 msgstr ""
7156
7157 #. type: Plain text
7158 #: build/C/man2/ioprio_set.2:117
7159 msgid ""
7160 "Given a scheduling I<class> and priority (I<data>), this macro combines the "
7161 "two values to produce an I<ioprio> value, which is returned as the result of "
7162 "the macro."
7163 msgstr ""
7164
7165 #. type: TP
7166 #: build/C/man2/ioprio_set.2:117
7167 #, no-wrap
7168 msgid "B<IOPRIO_PRIO_CLASS(>I<mask>B<)>"
7169 msgstr ""
7170
7171 #. type: Plain text
7172 #: build/C/man2/ioprio_set.2:129
7173 msgid ""
7174 "Given I<mask> (an I<ioprio> value), this macro returns its I/O class "
7175 "component, that is, one of the values B<IOPRIO_CLASS_RT>, "
7176 "B<IOPRIO_CLASS_BE>, or B<IOPRIO_CLASS_IDLE>."
7177 msgstr ""
7178
7179 #. type: TP
7180 #: build/C/man2/ioprio_set.2:129
7181 #, no-wrap
7182 msgid "B<IOPRIO_PRIO_DATA(>I<mask>B<)>"
7183 msgstr ""
7184
7185 #. type: Plain text
7186 #: build/C/man2/ioprio_set.2:138
7187 msgid ""
7188 "Given I<mask> (an I<ioprio> value), this macro returns its priority "
7189 "(I<data>)  component."
7190 msgstr ""
7191
7192 #. type: Plain text
7193 #: build/C/man2/ioprio_set.2:141
7194 msgid ""
7195 "See the NOTES section for more information on scheduling classes and "
7196 "priorities."
7197 msgstr ""
7198
7199 #. type: Plain text
7200 #: build/C/man2/ioprio_set.2:149
7201 msgid ""
7202 "I/O priorities are supported for reads and for synchronous (B<O_DIRECT>, "
7203 "B<O_SYNC>)  writes.  I/O priorities are not supported for asynchronous "
7204 "writes because they are issued outside the context of the program dirtying "
7205 "the memory, and thus program-specific priorities do not apply."
7206 msgstr ""
7207
7208 #. type: Plain text
7209 #: build/C/man2/ioprio_set.2:162
7210 msgid ""
7211 "On success, B<ioprio_get>()  returns the I<ioprio> value of the process with "
7212 "highest I/O priority of any of the processes that match the criteria "
7213 "specified in I<which> and I<who>.  On error, -1 is returned, and I<errno> is "
7214 "set to indicate the error."
7215 msgstr ""
7216
7217 #. type: Plain text
7218 #: build/C/man2/ioprio_set.2:169
7219 msgid ""
7220 "On success, B<ioprio_set>()  returns 0.  On error, -1 is returned, and "
7221 "I<errno> is set to indicate the error."
7222 msgstr ""
7223
7224 #. type: Plain text
7225 #: build/C/man2/ioprio_set.2:179
7226 msgid ""
7227 "Invalid value for I<which> or I<ioprio>.  Refer to the NOTES section for "
7228 "available scheduler classes and priority levels for I<ioprio>."
7229 msgstr ""
7230
7231 #. type: Plain text
7232 #: build/C/man2/ioprio_set.2:187
7233 msgid ""
7234 "The calling process does not have the privilege needed to assign this "
7235 "I<ioprio> to the specified process(es).  See the NOTES section for more "
7236 "information on required privileges for B<ioprio_set>()."
7237 msgstr ""
7238
7239 #. type: Plain text
7240 #: build/C/man2/ioprio_set.2:193
7241 msgid ""
7242 "No process(es) could be found that matched the specification in I<which> and "
7243 "I<who>."
7244 msgstr ""
7245
7246 #. type: Plain text
7247 #: build/C/man2/ioprio_set.2:196
7248 msgid "These system calls have been available on Linux since kernel 2.6.13."
7249 msgstr ""
7250
7251 #. type: Plain text
7252 #: build/C/man2/ioprio_set.2:201
7253 msgid ""
7254 "Glibc does not provide a wrapper for these system calls; call them using "
7255 "B<syscall>(2)."
7256 msgstr ""
7257
7258 #. type: Plain text
7259 #: build/C/man2/ioprio_set.2:220
7260 msgid ""
7261 "Two or more processes or threads can share an I/O context.  This will be the "
7262 "case when B<clone>(2)  was called with the B<CLONE_IO> flag.  However, by "
7263 "default, the distinct threads of a process will B<not> share the same I/O "
7264 "context.  This means that if you want to change the I/O priority of all "
7265 "threads in a process, you may need to call B<ioprio_set>()  on each of the "
7266 "threads.  The thread ID that you would need for this operation is the one "
7267 "that is returned by B<gettid>(2)  or B<clone>(2)."
7268 msgstr ""
7269
7270 #. type: Plain text
7271 #: build/C/man2/ioprio_set.2:225
7272 msgid ""
7273 "These system calls have an effect only when used in conjunction with an I/O "
7274 "scheduler that supports I/O priorities.  As at kernel 2.6.17 the only such "
7275 "scheduler is the Completely Fair Queuing (CFQ) I/O scheduler."
7276 msgstr ""
7277
7278 #. type: SS
7279 #: build/C/man2/ioprio_set.2:225
7280 #, no-wrap
7281 msgid "Selecting an I/O scheduler"
7282 msgstr ""
7283
7284 #. type: Plain text
7285 #: build/C/man2/ioprio_set.2:229
7286 msgid ""
7287 "I/O Schedulers are selected on a per-device basis via the special file "
7288 "I</sys/block/E<lt>deviceE<gt>/queue/scheduler>."
7289 msgstr ""
7290
7291 #. type: Plain text
7292 #: build/C/man2/ioprio_set.2:235
7293 msgid ""
7294 "One can view the current I/O scheduler via the I</sys> filesystem.  For "
7295 "example, the following command displays a list of all schedulers currently "
7296 "loaded in the kernel:"
7297 msgstr ""
7298
7299 #. type: Plain text
7300 #: build/C/man2/ioprio_set.2:240
7301 #, no-wrap
7302 msgid ""
7303 "$B< cat /sys/block/hda/queue/scheduler>\n"
7304 "noop anticipatory deadline [cfq]\n"
7305 msgstr ""
7306
7307 #. type: Plain text
7308 #: build/C/man2/ioprio_set.2:254
7309 msgid ""
7310 "The scheduler surrounded by brackets is the one actually in use for the "
7311 "device (I<hda> in the example).  Setting another scheduler is done by "
7312 "writing the name of the new scheduler to this file.  For example, the "
7313 "following command will set the scheduler for the I<hda> device to I<cfq>:"
7314 msgstr ""
7315
7316 #. type: Plain text
7317 #: build/C/man2/ioprio_set.2:260
7318 #, no-wrap
7319 msgid ""
7320 "$B< su>\n"
7321 "Password:\n"
7322 "#B< echo cfq E<gt> /sys/block/hda/queue/scheduler>\n"
7323 msgstr ""
7324
7325 #. type: SS
7326 #: build/C/man2/ioprio_set.2:262
7327 #, no-wrap
7328 msgid "The Completely Fair Queuing (CFQ) I/O scheduler"
7329 msgstr ""
7330
7331 #. type: Plain text
7332 #: build/C/man2/ioprio_set.2:268
7333 msgid ""
7334 "Since v3 (aka CFQ Time Sliced) CFQ implements I/O nice levels similar to "
7335 "those of CPU scheduling.  These nice levels are grouped in three scheduling "
7336 "classes each one containing one or more priority levels:"
7337 msgstr ""
7338
7339 #. type: TP
7340 #: build/C/man2/ioprio_set.2:268
7341 #, no-wrap
7342 msgid "B<IOPRIO_CLASS_RT> (1)"
7343 msgstr ""
7344
7345 #. type: Plain text
7346 #: build/C/man2/ioprio_set.2:283
7347 msgid ""
7348 "This is the real-time I/O class.  This scheduling class is given higher "
7349 "priority than any other class: processes from this class are given first "
7350 "access to the disk every time.  Thus this I/O class needs to be used with "
7351 "some care: one I/O real-time process can starve the entire system.  Within "
7352 "the real-time class, there are 8 levels of class data (priority) that "
7353 "determine exactly how much time this process needs the disk for on each "
7354 "service.  The highest real-time priority level is 0; the lowest is 7.  In "
7355 "the future this might change to be more directly mappable to performance, by "
7356 "passing in a desired data rate instead."
7357 msgstr ""
7358
7359 #. type: TP
7360 #: build/C/man2/ioprio_set.2:283
7361 #, no-wrap
7362 msgid "B<IOPRIO_CLASS_BE> (2)"
7363 msgstr ""
7364
7365 #. type: Plain text
7366 #: build/C/man2/ioprio_set.2:296
7367 msgid ""
7368 "This is the best-effort scheduling class, which is the default for any "
7369 "process that hasn't set a specific I/O priority.  The class data (priority) "
7370 "determines how much I/O bandwidth the process will get.  Best-effort "
7371 "priority levels are analogous to CPU nice values (see B<getpriority>(2)).  "
7372 "The priority level determines a priority relative to other processes in the "
7373 "best-effort scheduling class.  Priority levels range from 0 (highest) to 7 "
7374 "(lowest)."
7375 msgstr ""
7376
7377 #. type: TP
7378 #: build/C/man2/ioprio_set.2:296
7379 #, no-wrap
7380 msgid "B<IOPRIO_CLASS_IDLE> (3)"
7381 msgstr ""
7382
7383 #. type: Plain text
7384 #: build/C/man2/ioprio_set.2:305
7385 msgid ""
7386 "This is the idle scheduling class.  Processes running at this level only get "
7387 "I/O time when no-one else needs the disk.  The idle class has no class "
7388 "data.  Attention is required when assigning this priority class to a "
7389 "process, since it may become starved if higher priority processes are "
7390 "constantly accessing the disk."
7391 msgstr ""
7392
7393 #. type: Plain text
7394 #: build/C/man2/ioprio_set.2:309
7395 msgid ""
7396 "Refer to I<Documentation/block/ioprio.txt> for more information on the CFQ "
7397 "I/O Scheduler and an example program."
7398 msgstr ""
7399
7400 #. type: SS
7401 #: build/C/man2/ioprio_set.2:309
7402 #, no-wrap
7403 msgid "Required permissions to set I/O priorities"
7404 msgstr ""
7405
7406 #. type: Plain text
7407 #: build/C/man2/ioprio_set.2:312
7408 msgid ""
7409 "Permission to change a process's priority is granted or denied based on two "
7410 "assertions:"
7411 msgstr ""
7412
7413 #. type: TP
7414 #: build/C/man2/ioprio_set.2:312
7415 #, no-wrap
7416 msgid "B<Process ownership>"
7417 msgstr ""
7418
7419 #. type: Plain text
7420 #: build/C/man2/ioprio_set.2:320
7421 msgid ""
7422 "An unprivileged process may set only the I/O priority of a process whose "
7423 "real UID matches the real or effective UID of the calling process.  A "
7424 "process which has the B<CAP_SYS_NICE> capability can change the priority of "
7425 "any process."
7426 msgstr ""
7427
7428 #. type: TP
7429 #: build/C/man2/ioprio_set.2:320
7430 #, no-wrap
7431 msgid "B<What is the desired priority>"
7432 msgstr ""
7433
7434 #. type: Plain text
7435 #: build/C/man2/ioprio_set.2:332
7436 msgid ""
7437 "Attempts to set very high priorities (B<IOPRIO_CLASS_RT>)  require the "
7438 "B<CAP_SYS_ADMIN> capability.  Kernel versions up to 2.6.24 also required "
7439 "B<CAP_SYS_ADMIN> to set a very low priority (B<IOPRIO_CLASS_IDLE>), but "
7440 "since Linux 2.6.25, this is no longer required."
7441 msgstr ""
7442
7443 #. type: Plain text
7444 #: build/C/man2/ioprio_set.2:337
7445 msgid ""
7446 "A call to B<ioprio_set>()  must follow both rules, or the call will fail "
7447 "with the error B<EPERM>."
7448 msgstr ""
7449
7450 #.  6 May 07: Bug report raised:
7451 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=4464
7452 #.  Ulrich Drepper replied that he wasn't going to add these
7453 #.  to glibc.
7454 #. type: Plain text
7455 #: build/C/man2/ioprio_set.2:346
7456 msgid ""
7457 "Glibc does not yet provide a suitable header file defining the function "
7458 "prototypes and macros described on this page.  Suitable definitions can be "
7459 "found in I<linux/ioprio.h>."
7460 msgstr ""
7461
7462 #. type: Plain text
7463 #: build/C/man2/ioprio_set.2:351
7464 msgid "B<ionice>(1), B<getpriority>(2), B<open>(2), B<capabilities>(7)"
7465 msgstr ""
7466
7467 #. type: Plain text
7468 #: build/C/man2/ioprio_set.2:354
7469 msgid "I<Documentation/block/ioprio.txt> in the Linux kernel source tree"
7470 msgstr ""
7471
7472 #. type: TH
7473 #: build/C/man2/ipc.2:25
7474 #, no-wrap
7475 msgid "IPC"
7476 msgstr ""
7477
7478 #. type: TH
7479 #: build/C/man2/ipc.2:25
7480 #, no-wrap
7481 msgid "2012-10-16"
7482 msgstr ""
7483
7484 #. type: Plain text
7485 #: build/C/man2/ipc.2:28
7486 msgid "ipc - System V IPC system calls"
7487 msgstr ""
7488
7489 #. type: Plain text
7490 #: build/C/man2/ipc.2:33
7491 #, no-wrap
7492 msgid ""
7493 "B<int ipc(unsigned int >I<call>B<, int >I<first>B<, int >I<second>B<, int "
7494 ">I<third>B<,>\n"
7495 "B<        void *>I<ptr>B<, long >I<fifth>B<);>\n"
7496 msgstr ""
7497
7498 #. type: Plain text
7499 #: build/C/man2/ipc.2:41
7500 msgid ""
7501 "B<ipc>()  is a common kernel entry point for the System\\ V IPC calls for "
7502 "messages, semaphores, and shared memory.  I<call> determines which IPC "
7503 "function to invoke; the other arguments are passed through to the "
7504 "appropriate call."
7505 msgstr ""
7506
7507 #. type: Plain text
7508 #: build/C/man2/ipc.2:45
7509 msgid ""
7510 "User programs should call the appropriate functions by their usual names.  "
7511 "Only standard library implementors and kernel hackers need to know about "
7512 "B<ipc>()."
7513 msgstr ""
7514
7515 #. type: Plain text
7516 #: build/C/man2/ipc.2:49
7517 msgid ""
7518 "B<ipc>()  is Linux-specific, and should not be used in programs intended to "
7519 "be portable."
7520 msgstr ""
7521
7522 #. type: Plain text
7523 #: build/C/man2/ipc.2:57
7524 msgid ""
7525 "On some architectures\\(emfor example x86-64 and ARM\\(emthere is no "
7526 "B<ipc>()  system call; instead B<msgctl>(2), B<semctl>(2), B<shmctl>(2), and "
7527 "so on really are implemented as separate system calls."
7528 msgstr ""
7529
7530 #. type: Plain text
7531 #: build/C/man2/ipc.2:70
7532 msgid ""
7533 "B<msgctl>(2), B<msgget>(2), B<msgrcv>(2), B<msgsnd>(2), B<semctl>(2), "
7534 "B<semget>(2), B<semop>(2), B<semtimedop>(2), B<shmat>(2), B<shmctl>(2), "
7535 "B<shmdt>(2), B<shmget>(2)"
7536 msgstr ""
7537
7538 #. type: TH
7539 #: build/C/man7/namespaces.7:27
7540 #, no-wrap
7541 msgid "NAMESPACES"
7542 msgstr ""
7543
7544 #. type: Plain text
7545 #: build/C/man7/namespaces.7:30
7546 msgid "namespaces - overview of Linux namespaces"
7547 msgstr ""
7548
7549 #. type: Plain text
7550 #: build/C/man7/namespaces.7:37
7551 msgid ""
7552 "A namespace wraps a global system resource in an abstraction that makes it "
7553 "appear to the processes within the namespace that they have their own "
7554 "isolated instance of the global resource.  Changes to the global resource "
7555 "are visible to other processes that are members of the namespace, but are "
7556 "invisible to other processes.  One use of namespaces is to implement "
7557 "containers."
7558 msgstr ""
7559
7560 #. type: Plain text
7561 #: build/C/man7/namespaces.7:39
7562 msgid "Linux provides the following namespaces:"
7563 msgstr ""
7564
7565 #. type: tbl table
7566 #: build/C/man7/namespaces.7:42
7567 #, no-wrap
7568 msgid "Namespace\tConstant\tIsolates\n"
7569 msgstr ""
7570
7571 #. type: tbl table
7572 #: build/C/man7/namespaces.7:43
7573 #, no-wrap
7574 msgid "IPC\tCLONE_NEWIPC\tSystem V IPC, POSIX message queues\n"
7575 msgstr ""
7576
7577 #. type: tbl table
7578 #: build/C/man7/namespaces.7:44
7579 #, no-wrap
7580 msgid "Network\tCLONE_NEWNET\tNetwork devices, stacks, ports, etc.\n"
7581 msgstr ""
7582
7583 #. type: tbl table
7584 #: build/C/man7/namespaces.7:45
7585 #, no-wrap
7586 msgid "Mount\tCLONE_NEWNS\tMount points\n"
7587 msgstr ""
7588
7589 #. type: tbl table
7590 #: build/C/man7/namespaces.7:46
7591 #, no-wrap
7592 msgid "PID\tCLONE_NEWPID\tProcess IDs\n"
7593 msgstr ""
7594
7595 #. type: tbl table
7596 #: build/C/man7/namespaces.7:47
7597 #, no-wrap
7598 msgid "User\tCLONE_NEWUSER\tUser and group IDs\n"
7599 msgstr ""
7600
7601 #. type: tbl table
7602 #: build/C/man7/namespaces.7:48
7603 #, no-wrap
7604 msgid "UTS\tCLONE_NEWUTS\tHostname and NIS domain name\n"
7605 msgstr ""
7606
7607 #
7608 #.  ==================== The namespaces API ====================
7609 #. type: Plain text
7610 #: build/C/man7/namespaces.7:57
7611 msgid ""
7612 "This page describes the various namespaces and the associated I</proc> "
7613 "files, and summarizes the APIs for working with namespaces."
7614 msgstr ""
7615
7616 #. type: SS
7617 #: build/C/man7/namespaces.7:57
7618 #, no-wrap
7619 msgid "The namespaces API"
7620 msgstr ""
7621
7622 #. type: Plain text
7623 #: build/C/man7/namespaces.7:62
7624 msgid ""
7625 "As well as various I</proc> files described below, the namespaces API "
7626 "includes the following system calls:"
7627 msgstr ""
7628
7629 #. type: TP
7630 #: build/C/man7/namespaces.7:62
7631 #, no-wrap
7632 msgid "B<clone>(2)"
7633 msgstr ""
7634
7635 #. type: Plain text
7636 #: build/C/man7/namespaces.7:75
7637 msgid ""
7638 "The B<clone>(2)  system call creates a new process.  If the I<flags> "
7639 "argument of the call specifies one or more of the B<CLONE_NEW*> flags listed "
7640 "below, then new namespaces are created for each flag, and the child process "
7641 "is made a member of those namespaces.  (This system call also implements a "
7642 "number of features unrelated to namespaces.)"
7643 msgstr ""
7644
7645 #. type: TP
7646 #: build/C/man7/namespaces.7:75
7647 #, no-wrap
7648 msgid "B<setns>(2)"
7649 msgstr ""
7650
7651 #. type: Plain text
7652 #: build/C/man7/namespaces.7:84
7653 msgid ""
7654 "The B<setns>(2)  system call allows the calling process to join an existing "
7655 "namespace.  The namespace to join is specified via a file descriptor that "
7656 "refers to one of the I</proc/[pid]/ns> files described below."
7657 msgstr ""
7658
7659 #. type: TP
7660 #: build/C/man7/namespaces.7:84
7661 #, no-wrap
7662 msgid "B<unshare>(2)"
7663 msgstr ""
7664
7665 #. type: Plain text
7666 #: build/C/man7/namespaces.7:97
7667 msgid ""
7668 "The B<unshare>(2)  system call moves the calling process to a new "
7669 "namespace.  If the I<flags> argument of the call specifies one or more of "
7670 "the B<CLONE_NEW*> flags listed below, then new namespaces are created for "
7671 "each flag, and the calling process is made a member of those namespaces.  "
7672 "(This system call also implements a number of features unrelated to "
7673 "namespaces.)"
7674 msgstr ""
7675
7676 #
7677 #.  ==================== The /proc/[pid]/ns/ directory ====================
7678 #. type: Plain text
7679 #: build/C/man7/namespaces.7:110
7680 msgid ""
7681 "Creation of new namespaces using B<clone>(2)  and B<unshare>(2)  in most "
7682 "cases requires the B<CAP_SYS_ADMIN> capability.  User namespaces are the "
7683 "exception: since Linux 3.8, no privilege is required to create a user "
7684 "namespace."
7685 msgstr ""
7686
7687 #. type: SS
7688 #: build/C/man7/namespaces.7:110
7689 #, no-wrap
7690 msgid "The /proc/[pid]/ns/ directory"
7691 msgstr ""
7692
7693 #.  See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
7694 #. type: Plain text
7695 #: build/C/man7/namespaces.7:117
7696 msgid ""
7697 "Each process has a I</proc/[pid]/ns/> subdirectory containing one entry for "
7698 "each namespace that supports being manipulated by B<setns>(2):"
7699 msgstr ""
7700
7701 #. type: Plain text
7702 #: build/C/man7/namespaces.7:128
7703 #, no-wrap
7704 msgid ""
7705 "$ B<ls -l /proc/$$/ns>\n"
7706 "total 0\n"
7707 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 ipc -E<gt> ipc:[4026531839]\n"
7708 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 mnt -E<gt> mnt:[4026531840]\n"
7709 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 net -E<gt> net:[4026531956]\n"
7710 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 pid -E<gt> pid:[4026531836]\n"
7711 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 user -E<gt> user:[4026531837]\n"
7712 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 uts -E<gt> uts:[4026531838]\n"
7713 msgstr ""
7714
7715 #. type: Plain text
7716 #: build/C/man7/namespaces.7:138
7717 msgid ""
7718 "Bind mounting (see B<mount>(2))  one of the files in this directory to "
7719 "somewhere else in the filesystem keeps the corresponding namespace of the "
7720 "process specified by I<pid> alive even if all processes currently in the "
7721 "namespace terminate."
7722 msgstr ""
7723
7724 #. type: Plain text
7725 #: build/C/man7/namespaces.7:149
7726 msgid ""
7727 "Opening one of the files in this directory (or a file that is bind mounted "
7728 "to one of these files)  returns a file handle for the corresponding "
7729 "namespace of the process specified by I<pid>.  As long as this file "
7730 "descriptor remains open, the namespace will remain alive, even if all "
7731 "processes in the namespace terminate.  The file descriptor can be passed to "
7732 "B<setns>(2)."
7733 msgstr ""
7734
7735 #. type: Plain text
7736 #: build/C/man7/namespaces.7:160
7737 msgid ""
7738 "In Linux 3.7 and earlier, these files were visible as hard links.  Since "
7739 "Linux 3.8, they appear as symbolic links.  If two processes are in the same "
7740 "namespace, then the inode numbers of their I</proc/[pid]/ns/xxx> symbolic "
7741 "links will be the same; an application can check this using the "
7742 "I<stat.st_ino> field returned by B<stat>(2).  The content of this symbolic "
7743 "link is a string containing the namespace type and inode number as in the "
7744 "following example:"
7745 msgstr ""
7746
7747 #. type: Plain text
7748 #: build/C/man7/namespaces.7:165
7749 #, no-wrap
7750 msgid ""
7751 "$ B<readlink /proc/$$/ns/uts>\n"
7752 "uts:[4026531838]\n"
7753 msgstr ""
7754
7755 #. type: Plain text
7756 #: build/C/man7/namespaces.7:169
7757 msgid "The files in this subdirectory are as follows:"
7758 msgstr ""
7759
7760 #. type: TP
7761 #: build/C/man7/namespaces.7:169
7762 #, no-wrap
7763 msgid "I</proc/[pid]/ns/ipc> (since Linux 3.0)"
7764 msgstr ""
7765
7766 #. type: Plain text
7767 #: build/C/man7/namespaces.7:172
7768 msgid "This file is a handle for the IPC namespace of the process."
7769 msgstr ""
7770
7771 #. type: TP
7772 #: build/C/man7/namespaces.7:172
7773 #, no-wrap
7774 msgid "I</proc/[pid]/ns/mnt> (since Linux 3.8)"
7775 msgstr ""
7776
7777 #. type: Plain text
7778 #: build/C/man7/namespaces.7:175
7779 msgid "This file is a handle for the mount namespace of the process."
7780 msgstr ""
7781
7782 #. type: TP
7783 #: build/C/man7/namespaces.7:175
7784 #, no-wrap
7785 msgid "I</proc/[pid]/ns/net> (since Linux 3.0)"
7786 msgstr ""
7787
7788 #. type: Plain text
7789 #: build/C/man7/namespaces.7:178
7790 msgid "This file is a handle for the network namespace of the process."
7791 msgstr ""
7792
7793 #. type: TP
7794 #: build/C/man7/namespaces.7:178
7795 #, no-wrap
7796 msgid "I</proc/[pid]/ns/pid> (since Linux 3.8)"
7797 msgstr ""
7798
7799 #. type: Plain text
7800 #: build/C/man7/namespaces.7:181
7801 msgid "This file is a handle for the PID namespace of the process."
7802 msgstr ""
7803
7804 #. type: TP
7805 #: build/C/man7/namespaces.7:181
7806 #, no-wrap
7807 msgid "I</proc/[pid]/ns/user> (since Linux 3.8)"
7808 msgstr ""
7809
7810 #. type: Plain text
7811 #: build/C/man7/namespaces.7:184
7812 msgid "This file is a handle for the user namespace of the process."
7813 msgstr ""
7814
7815 #. type: TP
7816 #: build/C/man7/namespaces.7:184
7817 #, no-wrap
7818 msgid "I</proc/[pid]/ns/uts> (since Linux 3.0)"
7819 msgstr ""
7820
7821 #
7822 #.  ==================== IPC namespaces ====================
7823 #. type: Plain text
7824 #: build/C/man7/namespaces.7:190
7825 msgid "This file is a handle for the UTS namespace of the process."
7826 msgstr ""
7827
7828 #. type: SS
7829 #: build/C/man7/namespaces.7:190
7830 #, no-wrap
7831 msgid "IPC namespaces (CLONE_NEWIPC)"
7832 msgstr ""
7833
7834 #.  commit 7eafd7c74c3f2e67c27621b987b28397110d643f
7835 #.  https://lwn.net/Articles/312232/
7836 #. type: Plain text
7837 #: build/C/man7/namespaces.7:202
7838 msgid ""
7839 "IPC namespaces isolate certain IPC resources, namely, System V IPC objects "
7840 "(see B<svipc>(7))  and (since Linux 2.6.30)  POSIX message queues (see "
7841 "B<mq_overview>(7)).  The common characteristic of these IPC mechanisms is "
7842 "that IPC objects are identified by mechanisms other than filesystem "
7843 "pathnames."
7844 msgstr ""
7845
7846 #. type: Plain text
7847 #: build/C/man7/namespaces.7:208
7848 msgid ""
7849 "Each IPC namespace has its own set of System V IPC identifiers and its own "
7850 "POSIX message queue filesystem.  Objects created in an IPC namespace are "
7851 "visible to all other processes that are members of that namespace, but are "
7852 "not visible to processes in other IPC namespaces."
7853 msgstr ""
7854
7855 #. type: Plain text
7856 #: build/C/man7/namespaces.7:212
7857 msgid "The following I</proc> interfaces are distinct in each IPC namespace:"
7858 msgstr ""
7859
7860 #. type: Plain text
7861 #: build/C/man7/namespaces.7:215
7862 msgid "The POSIX message queue interfaces in I</proc/sys/fs/mqueue>."
7863 msgstr ""
7864
7865 #. type: Plain text
7866 #: build/C/man7/namespaces.7:228
7867 msgid ""
7868 "The System V IPC interfaces in I</proc/sys/kernel>, namely: I<msgmax>, "
7869 "I<msgmnb>, I<msgmni>, I<sem>, I<shmall>, I<shmmax>, I<shmmni>, and "
7870 "I<shm_rmid_forced>."
7871 msgstr ""
7872
7873 #. type: Plain text
7874 #: build/C/man7/namespaces.7:231
7875 msgid "The System V IPC interfaces in I</proc/sysvipc>."
7876 msgstr ""
7877
7878 #. type: Plain text
7879 #: build/C/man7/namespaces.7:235
7880 msgid ""
7881 "When an IPC namespace is destroyed (i.e., when the last process that is a "
7882 "member of the namespace terminates), all IPC objects in the namespace are "
7883 "automatically destroyed."
7884 msgstr ""
7885
7886 #
7887 #.  ==================== Network namespaces ====================
7888 #. type: Plain text
7889 #: build/C/man7/namespaces.7:242
7890 msgid ""
7891 "Use of IPC namespaces requires a kernel that is configured with the "
7892 "B<CONFIG_IPC_NS> option."
7893 msgstr ""
7894
7895 #. type: SS
7896 #: build/C/man7/namespaces.7:242
7897 #, no-wrap
7898 msgid "Network namespaces (CLONE_NEWNET)"
7899 msgstr ""
7900
7901 #.  FIXME Add pointer to veth(4) page when it is eventually completed
7902 #. type: Plain text
7903 #: build/C/man7/namespaces.7:257
7904 msgid ""
7905 "Network namespaces provide isolation of the system resources associated with "
7906 "networking: network devices, IPv4 and IPv6 protocol stacks, IP routing "
7907 "tables, firewalls, the I</proc/net> directory, the I</sys/class/net> "
7908 "directory, port numbers (sockets), and so on.  A physical network device can "
7909 "live in exactly one network namespace.  A virtual network device (\"veth\") "
7910 "pair provides a pipe-like abstraction that can be used to create tunnels "
7911 "between network namespaces, and can be used to create a bridge to a physical "
7912 "network device in another namespace."
7913 msgstr ""
7914
7915 #. type: Plain text
7916 #: build/C/man7/namespaces.7:262
7917 msgid ""
7918 "When a network namespace is freed (i.e., when the last process in the "
7919 "namespace terminates), its physical network devices are moved back to the "
7920 "initial network namespace (not to the parent of the process)."
7921 msgstr ""
7922
7923 #
7924 #.  ==================== Mount namespaces ====================
7925 #. type: Plain text
7926 #: build/C/man7/namespaces.7:269
7927 msgid ""
7928 "Use of network namespaces requires a kernel that is configured with the "
7929 "B<CONFIG_NET_NS> option."
7930 msgstr ""
7931
7932 #. type: SS
7933 #: build/C/man7/namespaces.7:269
7934 #, no-wrap
7935 msgid "Mount namespaces (CLONE_NEWNS)"
7936 msgstr ""
7937
7938 #. type: Plain text
7939 #: build/C/man7/namespaces.7:277
7940 msgid ""
7941 "Mount namespaces isolate the set of filesystem mount points, meaning that "
7942 "processes in different mount namespaces can have different views of the "
7943 "filesystem hierarchy.  The set of mounts in a mount namespace is modified "
7944 "using B<mount>(2)  and B<umount>(2)."
7945 msgstr ""
7946
7947 #. type: Plain text
7948 #: build/C/man7/namespaces.7:294
7949 msgid ""
7950 "The I</proc/[pid]/mounts> file (present since Linux 2.4.19)  lists all the "
7951 "filesystems currently mounted in the process's mount namespace.  The format "
7952 "of this file is documented in B<fstab>(5).  Since kernel version 2.6.15, "
7953 "this file is pollable: after opening the file for reading, a change in this "
7954 "file (i.e., a filesystem mount or unmount) causes B<select>(2)  to mark the "
7955 "file descriptor as readable, and B<poll>(2)  and B<epoll_wait>(2)  mark the "
7956 "file as having an error condition."
7957 msgstr ""
7958
7959 #. type: Plain text
7960 #: build/C/man7/namespaces.7:302
7961 msgid ""
7962 "The I</proc/[pid]/mountstats> file (present since Linux 2.6.17)  exports "
7963 "information (statistics, configuration information)  about the mount points "
7964 "in the process's mount namespace.  This file is only readable by the owner "
7965 "of the process.  Lines in this file have the form:"
7966 msgstr ""
7967
7968 #. type: Plain text
7969 #: build/C/man7/namespaces.7:308
7970 #, no-wrap
7971 msgid ""
7972 "device /dev/sda7 mounted on /home with fstype ext3 [statistics]\n"
7973 "(       1      )            ( 2 )             (3 ) (4)\n"
7974 msgstr ""
7975
7976 #. type: Plain text
7977 #: build/C/man7/namespaces.7:312
7978 msgid "The fields in each line are:"
7979 msgstr ""
7980
7981 #. type: IP
7982 #: build/C/man7/namespaces.7:312 build/C/man7/user_namespaces.7:371
7983 #, no-wrap
7984 msgid "(1)"
7985 msgstr ""
7986
7987 #. type: Plain text
7988 #: build/C/man7/namespaces.7:316
7989 msgid ""
7990 "The name of the mounted device (or \"nodevice\" if there is no corresponding "
7991 "device)."
7992 msgstr ""
7993
7994 #. type: IP
7995 #: build/C/man7/namespaces.7:316 build/C/man7/user_namespaces.7:375
7996 #, no-wrap
7997 msgid "(2)"
7998 msgstr ""
7999
8000 #. type: Plain text
8001 #: build/C/man7/namespaces.7:319
8002 msgid "The mount point within the filesystem tree."
8003 msgstr ""
8004
8005 #. type: IP
8006 #: build/C/man7/namespaces.7:319 build/C/man7/user_namespaces.7:401
8007 #, no-wrap
8008 msgid "(3)"
8009 msgstr ""
8010
8011 #. type: Plain text
8012 #: build/C/man7/namespaces.7:322
8013 msgid "The filesystem type."
8014 msgstr ""
8015
8016 #. type: TP
8017 #: build/C/man7/namespaces.7:322
8018 #, no-wrap
8019 msgid "(4)"
8020 msgstr ""
8021
8022 #. type: Plain text
8023 #: build/C/man7/namespaces.7:327
8024 msgid ""
8025 "Optional statistics and configuration information.  Currently (as at Linux "
8026 "2.6.26), only NFS filesystems export information via this field."
8027 msgstr ""
8028
8029 #
8030 #.  ==================== PID namespaces ====================
8031 #. type: SS
8032 #: build/C/man7/namespaces.7:331
8033 #, no-wrap
8034 msgid "PID namespaces (CLONE_NEWPID)"
8035 msgstr ""
8036
8037 #
8038 #.  ==================== User namespaces ====================
8039 #. type: Plain text
8040 #: build/C/man7/namespaces.7:337
8041 msgid "See B<pid_namespaces>(7)."
8042 msgstr ""
8043
8044 #. type: SS
8045 #: build/C/man7/namespaces.7:337
8046 #, no-wrap
8047 msgid "User namespaces (CLONE_NEWUSER)"
8048 msgstr ""
8049
8050 #. type: Plain text
8051 #: build/C/man7/namespaces.7:343 build/C/man7/namespaces.7:364 build/C/man7/pid_namespaces.7:356
8052 msgid "See B<user_namespaces>(7)."
8053 msgstr ""
8054
8055 #. type: SS
8056 #: build/C/man7/namespaces.7:343
8057 #, no-wrap
8058 msgid "UTS namespaces (CLONE_NEWUTS)"
8059 msgstr ""
8060
8061 #. type: Plain text
8062 #: build/C/man7/namespaces.7:355
8063 msgid ""
8064 "UTS namespaces provide isolation of two system identifiers: the hostname and "
8065 "the NIS domain name.  These identifiers are set using B<sethostname>(2)  and "
8066 "B<setdomainname>(2), and can be retrieved using B<uname>(2), "
8067 "B<gethostname>(2), and B<getdomainname>(2)."
8068 msgstr ""
8069
8070 #. type: Plain text
8071 #: build/C/man7/namespaces.7:359
8072 msgid ""
8073 "Use of UTS namespaces requires a kernel that is configured with the "
8074 "B<CONFIG_UTS_NS> option."
8075 msgstr ""
8076
8077 #. type: Plain text
8078 #: build/C/man7/namespaces.7:361 build/C/man7/pid_namespaces.7:353 build/C/man7/user_namespaces.7:648
8079 msgid "Namespaces are a Linux-specific feature."
8080 msgstr ""
8081
8082 #. type: Plain text
8083 #: build/C/man7/namespaces.7:377
8084 msgid ""
8085 "B<nsenter>(1), B<readlink>(1), B<unshare>(1), B<clone>(2), B<setns>(2), "
8086 "B<unshare>(2), B<proc>(5), B<credentials>(7), B<capabilities>(7), "
8087 "B<pid_namespaces>(7), B<user_namespaces>(7), B<switch_root>(8)"
8088 msgstr ""
8089
8090 #. type: TH
8091 #: build/C/man7/pid_namespaces.7:27
8092 #, no-wrap
8093 msgid "PID_NAMESPACES"
8094 msgstr ""
8095
8096 #. type: TH
8097 #: build/C/man7/pid_namespaces.7:27 build/C/man2/seccomp.2:27
8098 #, no-wrap
8099 msgid "2015-01-10"
8100 msgstr ""
8101
8102 #. type: Plain text
8103 #: build/C/man7/pid_namespaces.7:30
8104 msgid "pid_namespaces - overview of Linux PID namespaces"
8105 msgstr ""
8106
8107 #. type: Plain text
8108 #: build/C/man7/pid_namespaces.7:33 build/C/man7/user_namespaces.7:33
8109 msgid "For an overview of namespaces, see B<namespaces>(7)."
8110 msgstr ""
8111
8112 #. type: Plain text
8113 #: build/C/man7/pid_namespaces.7:40
8114 msgid ""
8115 "PID namespaces isolate the process ID number space, meaning that processes "
8116 "in different PID namespaces can have the same PID.  PID namespaces allow "
8117 "containers to provide functionality such as suspending/resuming the set of "
8118 "processes in the container and migrating the container to a new host while "
8119 "the processes inside the container maintain the same PIDs."
8120 msgstr ""
8121
8122 #. type: Plain text
8123 #: build/C/man7/pid_namespaces.7:48
8124 msgid ""
8125 "PIDs in a new PID namespace start at 1, somewhat like a standalone system, "
8126 "and calls to B<fork>(2), B<vfork>(2), or B<clone>(2)  will produce processes "
8127 "with PIDs that are unique within the namespace."
8128 msgstr ""
8129
8130 #
8131 #.  ============================================================
8132 #. type: Plain text
8133 #: build/C/man7/pid_namespaces.7:55
8134 msgid ""
8135 "Use of PID namespaces requires a kernel that is configured with the "
8136 "B<CONFIG_PID_NS> option."
8137 msgstr ""
8138
8139 #. type: SS
8140 #: build/C/man7/pid_namespaces.7:55
8141 #, no-wrap
8142 msgid "The namespace init process"
8143 msgstr ""
8144
8145 #. type: Plain text
8146 #: build/C/man7/pid_namespaces.7:75
8147 msgid ""
8148 "The first process created in a new namespace (i.e., the process created "
8149 "using B<clone>(2)  with the B<CLONE_NEWPID> flag, or the first child created "
8150 "by a process after a call to B<unshare>(2)  using the B<CLONE_NEWPID> flag) "
8151 "has the PID 1, and is the \"init\" process for the namespace (see "
8152 "B<init>(1)).  A child process that is orphaned within the namespace will be "
8153 "reparented to this process rather than B<init>(1)  (unless one of the "
8154 "ancestors of the child in the same PID namespace employed the B<prctl>(2)  "
8155 "B<PR_SET_CHILD_SUBREAPER> command to mark itself as the reaper of orphaned "
8156 "descendant processes)."
8157 msgstr ""
8158
8159 #. type: Plain text
8160 #: build/C/man7/pid_namespaces.7:102
8161 msgid ""
8162 "If the \"init\" process of a PID namespace terminates, the kernel terminates "
8163 "all of the processes in the namespace via a B<SIGKILL> signal.  This "
8164 "behavior reflects the fact that the \"init\" process is essential for the "
8165 "correct operation of a PID namespace.  In this case, a subsequent B<fork>(2)  "
8166 "into this PID namespace will fail with the error B<ENOMEM>; it is not "
8167 "possible to create a new processes in a PID namespace whose \"init\" process "
8168 "has terminated.  Such scenarios can occur when, for example, a process uses "
8169 "an open file descriptor for a I</proc/[pid]/ns/pid> file corresponding to a "
8170 "process that was in a namespace to B<setns>(2)  into that namespace after "
8171 "the \"init\" process has terminated.  Another possible scenario can occur "
8172 "after a call to B<unshare>(2): if the first child subsequently created by a "
8173 "B<fork>(2)  terminates, then subsequent calls to B<fork>(2)  will fail with "
8174 "B<ENOMEM>."
8175 msgstr ""
8176
8177 #. type: Plain text
8178 #: build/C/man7/pid_namespaces.7:108
8179 msgid ""
8180 "Only signals for which the \"init\" process has established a signal handler "
8181 "can be sent to the \"init\" process by other members of the PID namespace.  "
8182 "This restriction applies even to privileged processes, and prevents other "
8183 "members of the PID namespace from accidentally killing the \"init\" process."
8184 msgstr ""
8185
8186 #. type: Plain text
8187 #: build/C/man7/pid_namespaces.7:128
8188 msgid ""
8189 "Likewise, a process in an ancestor namespace can\\(emsubject to the usual "
8190 "permission checks described in B<kill>(2)\\(emsend signals to the \"init\" "
8191 "process of a child PID namespace only if the \"init\" process has "
8192 "established a handler for that signal.  (Within the handler, the "
8193 "I<siginfo_t> I<si_pid> field described in B<sigaction>(2)  will be zero.)  "
8194 "B<SIGKILL> or B<SIGSTOP> are treated exceptionally: these signals are "
8195 "forcibly delivered when sent from an ancestor PID namespace.  Neither of "
8196 "these signals can be caught by the \"init\" process, and so will result in "
8197 "the usual actions associated with those signals (respectively, terminating "
8198 "and stopping the process)."
8199 msgstr ""
8200
8201 #
8202 #.  ============================================================
8203 #. type: Plain text
8204 #: build/C/man7/pid_namespaces.7:138
8205 msgid ""
8206 "Starting with Linux 3.4, the B<reboot>(2)  system call causes a signal to be "
8207 "sent to the namespace \"init\" process.  See B<reboot>(2)  for more details."
8208 msgstr ""
8209
8210 #. type: SS
8211 #: build/C/man7/pid_namespaces.7:138
8212 #, no-wrap
8213 msgid "Nesting PID namespaces"
8214 msgstr ""
8215
8216 #. type: Plain text
8217 #: build/C/man7/pid_namespaces.7:149
8218 msgid ""
8219 "PID namespaces can be nested: each PID namespace has a parent, except for "
8220 "the initial (\"root\") PID namespace.  The parent of a PID namespace is the "
8221 "PID namespace of the process that created the namespace using B<clone>(2)  "
8222 "or B<unshare>(2).  PID namespaces thus form a tree, with all namespaces "
8223 "ultimately tracing their ancestry to the root namespace."
8224 msgstr ""
8225
8226 #. type: Plain text
8227 #: build/C/man7/pid_namespaces.7:164
8228 msgid ""
8229 "A process is visible to other processes in its PID namespace, and to the "
8230 "processes in each direct ancestor PID namespace going back to the root PID "
8231 "namespace.  In this context, \"visible\" means that one process can be the "
8232 "target of operations by another process using system calls that specify a "
8233 "process ID.  Conversely, the processes in a child PID namespace can't see "
8234 "processes in the parent and further removed ancestor namespaces.  More "
8235 "succinctly: a process can see (e.g., send signals with B<kill>(2), set nice "
8236 "values with B<setpriority>(2), etc.) only processes contained in its own PID "
8237 "namespace and in descendants of that namespace."
8238 msgstr ""
8239
8240 #. type: Plain text
8241 #: build/C/man7/pid_namespaces.7:176
8242 msgid ""
8243 "A process has one process ID in each of the layers of the PID namespace "
8244 "hierarchy in which is visible, and walking back though each direct ancestor "
8245 "namespace through to the root PID namespace.  System calls that operate on "
8246 "process IDs always operate using the process ID that is visible in the PID "
8247 "namespace of the caller.  A call to B<getpid>(2)  always returns the PID "
8248 "associated with the namespace in which the process was created."
8249 msgstr ""
8250
8251 #. type: Plain text
8252 #: build/C/man7/pid_namespaces.7:191
8253 msgid ""
8254 "Some processes in a PID namespace may have parents that are outside of the "
8255 "namespace.  For example, the parent of the initial process in the namespace "
8256 "(i.e., the B<init>(1)  process with PID 1) is necessarily in another "
8257 "namespace.  Likewise, the direct children of a process that uses B<setns>(2)  "
8258 "to cause its children to join a PID namespace are in a different PID "
8259 "namespace from the caller of B<setns>(2).  Calls to B<getppid>(2)  for such "
8260 "processes return 0."
8261 msgstr ""
8262
8263 #
8264 #.  ============================================================
8265 #. type: Plain text
8266 #: build/C/man7/pid_namespaces.7:204
8267 msgid ""
8268 "While processes may freely descend into child PID namespaces (e.g., using "
8269 "B<setns>(2)  with B<CLONE_NEWPID>), they may not move in the other "
8270 "direction.  That is to say, processes may not enter any ancestor namespaces "
8271 "(parent, grandparent, etc.).  Changing PID namespaces is a one way "
8272 "operation."
8273 msgstr ""
8274
8275 #. type: SS
8276 #: build/C/man7/pid_namespaces.7:204
8277 #, no-wrap
8278 msgid "setns(2) and unshare(2) semantics"
8279 msgstr ""
8280
8281 #. type: Plain text
8282 #: build/C/man7/pid_namespaces.7:220
8283 msgid ""
8284 "Calls to B<setns>(2)  that specify a PID namespace file descriptor and calls "
8285 "to B<unshare>(2)  with the B<CLONE_NEWPID> flag cause children subsequently "
8286 "created by the caller to be placed in a different PID namespace from the "
8287 "caller.  These calls do not, however, change the PID namespace of the "
8288 "calling process, because doing so would change the caller's idea of its own "
8289 "PID (as reported by B<getpid>()), which would break many applications and "
8290 "libraries."
8291 msgstr ""
8292
8293 #. type: Plain text
8294 #: build/C/man7/pid_namespaces.7:228
8295 msgid ""
8296 "To put things another way: a process's PID namespace membership is "
8297 "determined when the process is created and cannot be changed thereafter.  "
8298 "Among other things, this means that the parental relationship between "
8299 "processes mirrors the parental relationship between PID namespaces: the "
8300 "parent of a process is either in the same namespace or resides in the "
8301 "immediate parent PID namespace."
8302 msgstr ""
8303
8304 #. type: SS
8305 #: build/C/man7/pid_namespaces.7:228
8306 #, no-wrap
8307 msgid "Compatibility of CLONE_NEWPID with other CLONE_* flags"
8308 msgstr ""
8309
8310 #. type: Plain text
8311 #: build/C/man7/pid_namespaces.7:233
8312 msgid "B<CLONE_NEWPID> can't be combined with some other B<CLONE_*> flags:"
8313 msgstr ""
8314
8315 #. type: Plain text
8316 #: build/C/man7/pid_namespaces.7:241
8317 msgid ""
8318 "B<CLONE_THREAD> requires being in the same PID namespace in order that the "
8319 "threads in a process can send signals to each other.  Similarly, it must be "
8320 "possible to see all of the threads of a processes in the B<proc>(5)  "
8321 "filesystem."
8322 msgstr ""
8323
8324 #. type: Plain text
8325 #: build/C/man7/pid_namespaces.7:252
8326 msgid ""
8327 "B<CLONE_SIGHAND> requires being in the same PID namespace; otherwise the "
8328 "process ID of the process sending a signal could not be meaningfully encoded "
8329 "when a signal is sent (see the description of the I<siginfo_t> type in "
8330 "B<sigaction>(2)).  A signal queue shared by processes in multiple PID "
8331 "namespaces will defeat that."
8332 msgstr ""
8333
8334 #. type: Plain text
8335 #: build/C/man7/pid_namespaces.7:262
8336 msgid ""
8337 "B<CLONE_VM> requires all of the threads to be in the same PID namespace, "
8338 "because, from the point of view of a core dump, if two processes share the "
8339 "same address space then they are threads and will be core dumped together.  "
8340 "When a core dump is written, the PID of each thread is written into the core "
8341 "dump.  Writing the process IDs could not meaningfully succeed if some of the "
8342 "process IDs were in a parent PID namespace."
8343 msgstr ""
8344
8345 #. type: Plain text
8346 #: build/C/man7/pid_namespaces.7:280
8347 msgid ""
8348 "To summarize: there is a technical requirement for each of B<CLONE_THREAD>, "
8349 "B<CLONE_SIGHAND>, and B<CLONE_VM> to share a PID namespace.  (Note "
8350 "furthermore that in B<clone>(2)  requires B<CLONE_VM> to be specified if "
8351 "B<CLONE_THREAD> or B<CLONE_SIGHAND> is specified.)  Thus, call sequences "
8352 "such as the following will fail (with the error B<EINVAL>):"
8353 msgstr ""
8354
8355 #. type: Plain text
8356 #: build/C/man7/pid_namespaces.7:284
8357 #, no-wrap
8358 msgid ""
8359 "    unshare(CLONE_NEWPID);\n"
8360 "    clone(..., CLONE_VM, ...);    /* Fails */\n"
8361 msgstr ""
8362
8363 #. type: Plain text
8364 #: build/C/man7/pid_namespaces.7:287
8365 #, no-wrap
8366 msgid ""
8367 "    setns(fd, CLONE_NEWPID);\n"
8368 "    clone(..., CLONE_VM, ...);    /* Fails */\n"
8369 msgstr ""
8370
8371 #. type: Plain text
8372 #: build/C/man7/pid_namespaces.7:290
8373 #, no-wrap
8374 msgid ""
8375 "    clone(..., CLONE_VM, ...);\n"
8376 "    setns(fd, CLONE_NEWPID);      /* Fails */\n"
8377 msgstr ""
8378
8379 #. type: Plain text
8380 #: build/C/man7/pid_namespaces.7:293
8381 #, no-wrap
8382 msgid ""
8383 "    clone(..., CLONE_VM, ...);\n"
8384 "    unshare(CLONE_NEWPID);        /* Fails */\n"
8385 msgstr ""
8386
8387 #
8388 #.  ============================================================
8389 #. type: SS
8390 #: build/C/man7/pid_namespaces.7:297
8391 #, no-wrap
8392 msgid "/proc and PID namespaces"
8393 msgstr ""
8394
8395 #. type: Plain text
8396 #: build/C/man7/pid_namespaces.7:306
8397 msgid ""
8398 "A I</proc> filesystem shows (in the I</proc/PID> directories) only processes "
8399 "visible in the PID namespace of the process that performed the mount, even "
8400 "if the I</proc> filesystem is viewed from processes in other namespaces."
8401 msgstr ""
8402
8403 #. type: Plain text
8404 #: build/C/man7/pid_namespaces.7:325
8405 msgid ""
8406 "After creating a new PID namespace, it is useful for the child to change its "
8407 "root directory and mount a new procfs instance at I</proc> so that tools "
8408 "such as B<ps>(1)  work correctly.  If a new mount namespace is "
8409 "simultaneously created by including B<CLONE_NEWNS> in the I<flags> argument "
8410 "of B<clone>(2)  or B<unshare>(2), then it isn't necessary to change the root "
8411 "directory: a new procfs instance can be mounted directly over I</proc>."
8412 msgstr ""
8413
8414 #. type: Plain text
8415 #: build/C/man7/pid_namespaces.7:329
8416 msgid "From a shell, the command to mount I</proc> is:"
8417 msgstr ""
8418
8419 #. type: Plain text
8420 #: build/C/man7/pid_namespaces.7:331
8421 #, no-wrap
8422 msgid "    $ mount -t proc proc /proc\n"
8423 msgstr ""
8424
8425 #
8426 #.  ============================================================
8427 #. type: Plain text
8428 #: build/C/man7/pid_namespaces.7:343
8429 msgid ""
8430 "Calling B<readlink>(2)  on the path I</proc/self> yields the process ID of "
8431 "the caller in the PID namespace of the procfs mount (i.e., the PID namespace "
8432 "of the process that mounted the procfs).  This can be useful for "
8433 "introspection purposes, when a process wants to discover its PID in other "
8434 "namespaces."
8435 msgstr ""
8436
8437 #. type: SS
8438 #: build/C/man7/pid_namespaces.7:343 build/C/man7/user_namespaces.7:635
8439 #, no-wrap
8440 msgid "Miscellaneous"
8441 msgstr ""
8442
8443 #. type: Plain text
8444 #: build/C/man7/pid_namespaces.7:351
8445 msgid ""
8446 "When a process ID is passed over a UNIX domain socket to a process in a "
8447 "different PID namespace (see the description of B<SCM_CREDENTIALS> in "
8448 "B<unix>(7)), it is translated into the corresponding PID value in the "
8449 "receiving process's PID namespace."
8450 msgstr ""
8451
8452 #. type: Plain text
8453 #: build/C/man7/pid_namespaces.7:365
8454 msgid ""
8455 "B<clone>(2), B<setns>(2), B<unshare>(2), B<proc>(5), B<credentials>(7), "
8456 "B<capabilities>(7), B<user_namespaces>(7), B<switch_root>(8)"
8457 msgstr ""
8458
8459 #. type: TH
8460 #: build/C/man2/seteuid.2:29
8461 #, no-wrap
8462 msgid "SETEUID"
8463 msgstr ""
8464
8465 #. type: Plain text
8466 #: build/C/man2/seteuid.2:32
8467 msgid "seteuid, setegid - set effective user or group ID"
8468 msgstr ""
8469
8470 #. type: Plain text
8471 #: build/C/man2/seteuid.2:38
8472 msgid "B<int seteuid(uid_t >I<euid>B<);>"
8473 msgstr ""
8474
8475 #. type: Plain text
8476 #: build/C/man2/seteuid.2:40
8477 msgid "B<int setegid(gid_t >I<egid>B<);>"
8478 msgstr ""
8479
8480 #. type: Plain text
8481 #: build/C/man2/seteuid.2:49
8482 msgid "B<seteuid>(), B<setegid>():"
8483 msgstr ""
8484
8485 #. type: Plain text
8486 #: build/C/man2/seteuid.2:51
8487 msgid ""
8488 "_BSD_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ "
8489 "E<gt>=\\ 600"
8490 msgstr ""
8491
8492 #. type: Plain text
8493 #: build/C/man2/seteuid.2:58
8494 msgid ""
8495 "B<seteuid>()  sets the effective user ID of the calling process.  "
8496 "Unprivileged user processes may only set the effective user ID to the real "
8497 "user ID, the effective user ID or the saved set-user-ID."
8498 msgstr ""
8499
8500 #.  When
8501 #.  .I euid
8502 #.  equals \-1, nothing is changed.
8503 #.  (This is an artifact of the implementation in glibc of seteuid()
8504 #.  using setresuid(2).)
8505 #. type: Plain text
8506 #: build/C/man2/seteuid.2:67
8507 msgid ""
8508 "Precisely the same holds for B<setegid>()  with \"group\" instead of "
8509 "\"user\"."
8510 msgstr ""
8511
8512 #. type: Plain text
8513 #: build/C/man2/seteuid.2:79
8514 msgid ""
8515 "I<Note>: there are cases where B<seteuid>()  can fail even when the caller "
8516 "is UID 0; it is a grave security error to omit checking for a failure return "
8517 "from B<seteuid>()."
8518 msgstr ""
8519
8520 #. type: Plain text
8521 #: build/C/man2/seteuid.2:83
8522 msgid "The target user or group ID is not valid in this user namespace."
8523 msgstr ""
8524
8525 #. type: Plain text
8526 #: build/C/man2/seteuid.2:99
8527 msgid ""
8528 "The calling process is not privileged (Linux: does not have the "
8529 "B<CAP_SETUID> capability in the case of B<seteuid>(), or the B<CAP_SETGID> "
8530 "capability in the case of B<setegid>())  and I<euid> (respectively, I<egid>)  "
8531 "is not the real user (group) ID, the effective user (group) ID, or the saved "
8532 "set-user-ID (saved set-group-ID)."
8533 msgstr ""
8534
8535 #. type: Plain text
8536 #: build/C/man2/seteuid.2:101
8537 msgid "4.3BSD, POSIX.1-2001."
8538 msgstr ""
8539
8540 #. type: Plain text
8541 #: build/C/man2/seteuid.2:107
8542 msgid ""
8543 "Setting the effective user (group) ID to the saved set-user-ID (saved "
8544 "set-group-ID) is possible since Linux 1.1.37 (1.1.38).  On an arbitrary "
8545 "system one should check B<_POSIX_SAVED_IDS>."
8546 msgstr ""
8547
8548 #. type: Plain text
8549 #: build/C/man2/seteuid.2:123
8550 msgid ""
8551 "Under glibc 2.0 B<seteuid(>I<euid>B<)> is equivalent to B<setreuid(-1,>I< "
8552 "euid>B<)> and hence may change the saved set-user-ID.  Under glibc 2.1 and "
8553 "later it is equivalent to B<setresuid(-1,>I< euid>B<, -1)> and hence does "
8554 "not change the saved set-user-ID.  Analogous remarks hold for B<setegid>(), "
8555 "with the difference that the change in implementation from B<setregid(-1,>I< "
8556 "egid>B<)> to B<setresgid(-1,>I< egid>B<, -1)> occurred in glibc 2.2 or 2.3 "
8557 "(depending on the hardware architecture)."
8558 msgstr ""
8559
8560 #. type: Plain text
8561 #: build/C/man2/seteuid.2:132
8562 msgid ""
8563 "According to POSIX.1, B<seteuid>()  (B<setegid>())  need not permit I<euid> "
8564 "(I<egid>)  to be the same value as the current effective user (group) ID, "
8565 "and some implementations do not permit this."
8566 msgstr ""
8567
8568 #. type: Plain text
8569 #: build/C/man2/seteuid.2:141
8570 msgid ""
8571 "On Linux, B<seteuid>()  and B<setegid>()  are implemented as library "
8572 "functions that call, respectively, B<setreuid>(2)  and B<setresgid>(2)."
8573 msgstr ""
8574
8575 #. type: Plain text
8576 #: build/C/man2/seteuid.2:149
8577 msgid ""
8578 "B<geteuid>(2), B<setresuid>(2), B<setreuid>(2), B<setuid>(2), "
8579 "B<capabilities>(7), B<credentials>(7), B<user_namespaces>(7)"
8580 msgstr ""
8581
8582 #. type: TH
8583 #: build/C/man2/setfsgid.2:31
8584 #, no-wrap
8585 msgid "SETFSGID"
8586 msgstr ""
8587
8588 #. type: TH
8589 #: build/C/man2/setfsgid.2:31 build/C/man2/setfsuid.2:31
8590 #, no-wrap
8591 msgid "2013-08-08"
8592 msgstr ""
8593
8594 #. type: Plain text
8595 #: build/C/man2/setfsgid.2:34
8596 msgid "setfsgid - set group identity used for filesystem checks"
8597 msgstr ""
8598
8599 #. type: Plain text
8600 #: build/C/man2/setfsgid.2:36 build/C/man2/setfsuid.2:36
8601 msgid "B<#include E<lt>sys/fsuid.hE<gt>>"
8602 msgstr ""
8603
8604 #. type: Plain text
8605 #: build/C/man2/setfsgid.2:38
8606 msgid "B<int setfsgid(uid_t >I<fsgid>B<);>"
8607 msgstr ""
8608
8609 #. type: Plain text
8610 #: build/C/man2/setfsgid.2:51
8611 msgid ""
8612 "The system call B<setfsgid>()  changes the value of the caller's filesystem "
8613 "group ID\\(emthe group ID that the Linux kernel uses to check for all "
8614 "accesses to the filesystem.  Normally, the value of the filesystem group ID "
8615 "will shadow the value of the effective group ID.  In fact, whenever the "
8616 "effective group ID is changed, the filesystem group ID will also be changed "
8617 "to the new value of the effective group ID."
8618 msgstr ""
8619
8620 #. type: Plain text
8621 #: build/C/man2/setfsgid.2:62
8622 msgid ""
8623 "Explicit calls to B<setfsuid>(2)  and B<setfsgid>()  are usually used only "
8624 "by programs such as the Linux NFS server that need to change what user and "
8625 "group ID is used for file access without a corresponding change in the real "
8626 "and effective user and group IDs.  A change in the normal user IDs for a "
8627 "program such as the NFS server is a security hole that can expose it to "
8628 "unwanted signals.  (But see below.)"
8629 msgstr ""
8630
8631 #. type: Plain text
8632 #: build/C/man2/setfsgid.2:68
8633 msgid ""
8634 "B<setfsgid>()  will succeed only if the caller is the superuser or if "
8635 "I<fsgid> matches either the caller's real group ID, effective group ID, "
8636 "saved set-group-ID, or current the filesystem user ID."
8637 msgstr ""
8638
8639 #. type: Plain text
8640 #: build/C/man2/setfsgid.2:71
8641 msgid ""
8642 "On both success and failure, this call returns the previous filesystem group "
8643 "ID of the caller."
8644 msgstr ""
8645
8646 #.  This system call is present since Linux 1.1.44
8647 #.  and in libc since libc 4.7.6.
8648 #. type: Plain text
8649 #: build/C/man2/setfsgid.2:75 build/C/man2/setfsuid.2:75
8650 msgid "This system call is present in Linux since version 1.2."
8651 msgstr ""
8652
8653 #. type: Plain text
8654 #: build/C/man2/setfsgid.2:79
8655 msgid ""
8656 "B<setfsgid>()  is Linux-specific and should not be used in programs intended "
8657 "to be portable."
8658 msgstr ""
8659
8660 #. type: Plain text
8661 #: build/C/man2/setfsgid.2:85
8662 msgid ""
8663 "When glibc determines that the argument is not a valid group ID, it will "
8664 "return -1 and set I<errno> to B<EINVAL> without attempting the system call."
8665 msgstr ""
8666
8667 #. type: Plain text
8668 #: build/C/man2/setfsgid.2:96
8669 msgid ""
8670 "Note that at the time this system call was introduced, a process could send "
8671 "a signal to a process with the same effective user ID.  Today signal "
8672 "permission handling is slightly different.  See B<setfsuid>(2)  for a "
8673 "discussion of why the use of both B<setfsuid>(2)  and B<setfsgid>()  is "
8674 "nowadays unneeded."
8675 msgstr ""
8676
8677 #. type: Plain text
8678 #: build/C/man2/setfsgid.2:106
8679 msgid ""
8680 "The original Linux B<setfsgid>()  system call supported only 16-bit group "
8681 "IDs.  Subsequently, Linux 2.4 added B<setfsgid32>()  supporting 32-bit IDs.  "
8682 "The glibc B<setfsgid>()  wrapper function transparently deals with the "
8683 "variation across kernel versions."
8684 msgstr ""
8685
8686 #. type: Plain text
8687 #: build/C/man2/setfsgid.2:123
8688 msgid ""
8689 "No error indications of any kind are returned to the caller, and the fact "
8690 "that both successful and unsuccessful calls return the same value makes it "
8691 "impossible to directly determine whether the call succeeded or failed.  "
8692 "Instead, the caller must resort to looking at the return value from a "
8693 "further call such as I<setfsgid(-1)> (which will always fail), in order to "
8694 "determine if a preceding call to B<setfsgid>()  changed the filesystem group "
8695 "ID.  At the very least, B<EPERM> should be returned when the call fails "
8696 "(because the caller lacks the B<CAP_SETGID> capability)."
8697 msgstr ""
8698
8699 #. type: Plain text
8700 #: build/C/man2/setfsgid.2:128
8701 msgid "B<kill>(2), B<setfsuid>(2), B<capabilities>(7), B<credentials>(7)"
8702 msgstr ""
8703
8704 #. type: TH
8705 #: build/C/man2/setfsuid.2:31
8706 #, no-wrap
8707 msgid "SETFSUID"
8708 msgstr ""
8709
8710 #. type: Plain text
8711 #: build/C/man2/setfsuid.2:34
8712 msgid "setfsuid - set user identity used for filesystem checks"
8713 msgstr ""
8714
8715 #. type: Plain text
8716 #: build/C/man2/setfsuid.2:38
8717 msgid "B<int setfsuid(uid_t >I<fsuid>B<);>"
8718 msgstr ""
8719
8720 #. type: Plain text
8721 #: build/C/man2/setfsuid.2:51
8722 msgid ""
8723 "The system call B<setfsuid>()  changes the value of the caller's filesystem "
8724 "user ID\\(emthe user ID that the Linux kernel uses to check for all accesses "
8725 "to the filesystem.  Normally, the value of the filesystem user ID will "
8726 "shadow the value of the effective user ID.  In fact, whenever the effective "
8727 "user ID is changed, the filesystem user ID will also be changed to the new "
8728 "value of the effective user ID."
8729 msgstr ""
8730
8731 #. type: Plain text
8732 #: build/C/man2/setfsuid.2:62
8733 msgid ""
8734 "Explicit calls to B<setfsuid>()  and B<setfsgid>(2)  are usually used only "
8735 "by programs such as the Linux NFS server that need to change what user and "
8736 "group ID is used for file access without a corresponding change in the real "
8737 "and effective user and group IDs.  A change in the normal user IDs for a "
8738 "program such as the NFS server is a security hole that can expose it to "
8739 "unwanted signals.  (But see below.)"
8740 msgstr ""
8741
8742 #. type: Plain text
8743 #: build/C/man2/setfsuid.2:68
8744 msgid ""
8745 "B<setfsuid>()  will succeed only if the caller is the superuser or if "
8746 "I<fsuid> matches either the caller's real user ID, effective user ID, saved "
8747 "set-user-ID, or current filesystem user ID."
8748 msgstr ""
8749
8750 #. type: Plain text
8751 #: build/C/man2/setfsuid.2:71
8752 msgid ""
8753 "On both success and failure, this call returns the previous filesystem user "
8754 "ID of the caller."
8755 msgstr ""
8756
8757 #. type: Plain text
8758 #: build/C/man2/setfsuid.2:79
8759 msgid ""
8760 "B<setfsuid>()  is Linux-specific and should not be used in programs intended "
8761 "to be portable."
8762 msgstr ""
8763
8764 #. type: Plain text
8765 #: build/C/man2/setfsuid.2:85
8766 msgid ""
8767 "When glibc determines that the argument is not a valid user ID, it will "
8768 "return -1 and set I<errno> to B<EINVAL> without attempting the system call."
8769 msgstr ""
8770
8771 #. type: Plain text
8772 #: build/C/man2/setfsuid.2:104
8773 msgid ""
8774 "At the time when this system call was introduced, one process could send a "
8775 "signal to another process with the same effective user ID.  This meant that "
8776 "if a privileged process changed its effective user ID for the purpose of "
8777 "file permission checking, then it could become vulnerable to receiving "
8778 "signals sent by another (unprivileged) process with the same user ID.  The "
8779 "filesystem user ID attribute was thus added to allow a process to change its "
8780 "user ID for the purposes of file permission checking without at the same "
8781 "time becoming vulnerable to receiving unwanted signals.  Since Linux 2.0, "
8782 "signal permission handling is different (see B<kill>(2)), with the result "
8783 "that a process change can change its effective user ID without being "
8784 "vulnerable to receiving signals from unwanted processes.  Thus, "
8785 "B<setfsuid>()  is nowadays unneeded and should be avoided in new "
8786 "applications (likewise for B<setfsgid>(2))."
8787 msgstr ""
8788
8789 #. type: Plain text
8790 #: build/C/man2/setfsuid.2:114
8791 msgid ""
8792 "The original Linux B<setfsuid>()  system call supported only 16-bit user "
8793 "IDs.  Subsequently, Linux 2.4 added B<setfsuid32>()  supporting 32-bit IDs.  "
8794 "The glibc B<setfsuid>()  wrapper function transparently deals with the "
8795 "variation across kernel versions."
8796 msgstr ""
8797
8798 #. type: Plain text
8799 #: build/C/man2/setfsuid.2:131
8800 msgid ""
8801 "No error indications of any kind are returned to the caller, and the fact "
8802 "that both successful and unsuccessful calls return the same value makes it "
8803 "impossible to directly determine whether the call succeeded or failed.  "
8804 "Instead, the caller must resort to looking at the return value from a "
8805 "further call such as I<setfsuid(-1)> (which will always fail), in order to "
8806 "determine if a preceding call to B<setfsuid>()  changed the filesystem user "
8807 "ID.  At the very least, B<EPERM> should be returned when the call fails "
8808 "(because the caller lacks the B<CAP_SETUID> capability)."
8809 msgstr ""
8810
8811 #. type: Plain text
8812 #: build/C/man2/setfsuid.2:136
8813 msgid "B<kill>(2), B<setfsgid>(2), B<capabilities>(7), B<credentials>(7)"
8814 msgstr ""
8815
8816 #. type: TH
8817 #: build/C/man2/setgid.2:29
8818 #, no-wrap
8819 msgid "SETGID"
8820 msgstr ""
8821
8822 #. type: Plain text
8823 #: build/C/man2/setgid.2:32
8824 msgid "setgid - set group identity"
8825 msgstr ""
8826
8827 #. type: Plain text
8828 #: build/C/man2/setgid.2:38
8829 msgid "B<int setgid(gid_t >I<gid>B<);>"
8830 msgstr ""
8831
8832 #. type: Plain text
8833 #: build/C/man2/setgid.2:43
8834 msgid ""
8835 "B<setgid>()  sets the effective group ID of the calling process.  If the "
8836 "caller is the superuser, the real GID and saved set-group-ID are also set."
8837 msgstr ""
8838
8839 #. type: Plain text
8840 #: build/C/man2/setgid.2:53
8841 msgid ""
8842 "Under Linux, B<setgid>()  is implemented like the POSIX version with the "
8843 "B<_POSIX_SAVED_IDS> feature.  This allows a set-group-ID program that is not "
8844 "set-user-ID-root to drop all of its group privileges, do some un-privileged "
8845 "work, and then reengage the original effective group ID in a secure manner."
8846 msgstr ""
8847
8848 #. type: Plain text
8849 #: build/C/man2/setgid.2:64
8850 msgid "The group ID specified in I<gid> is not valid in this user namespace."
8851 msgstr ""
8852
8853 #. type: Plain text
8854 #: build/C/man2/setgid.2:71
8855 msgid ""
8856 "The calling process is not privileged (does not have the B<CAP_SETGID> "
8857 "capability), and I<gid> does not match the real group ID or saved "
8858 "set-group-ID of the calling process."
8859 msgstr ""
8860
8861 #. type: Plain text
8862 #: build/C/man2/setgid.2:83
8863 msgid ""
8864 "The original Linux B<setgid>()  system call supported only 16-bit group "
8865 "IDs.  Subsequently, Linux 2.4 added B<setgid32>()  supporting 32-bit IDs.  "
8866 "The glibc B<setgid>()  wrapper function transparently deals with the "
8867 "variation across kernel versions."
8868 msgstr ""
8869
8870 #. type: Plain text
8871 #: build/C/man2/setgid.2:90
8872 msgid ""
8873 "B<getgid>(2), B<setegid>(2), B<setregid>(2), B<capabilities>(7), "
8874 "B<credentials>(7), B<user_namespaces>(7)"
8875 msgstr ""
8876
8877 #. type: TH
8878 #: build/C/man2/setpgid.2:48
8879 #, no-wrap
8880 msgid "SETPGID"
8881 msgstr ""
8882
8883 #. type: TH
8884 #: build/C/man2/setpgid.2:48
8885 #, no-wrap
8886 msgid "2014-01-07"
8887 msgstr ""
8888
8889 #. type: Plain text
8890 #: build/C/man2/setpgid.2:51
8891 msgid "setpgid, getpgid, setpgrp, getpgrp - set/get process group"
8892 msgstr ""
8893
8894 #. type: Plain text
8895 #: build/C/man2/setpgid.2:55
8896 msgid "B<int setpgid(pid_t >I<pid>B<, pid_t >I<pgid>B<);>"
8897 msgstr ""
8898
8899 #. type: Plain text
8900 #: build/C/man2/setpgid.2:57
8901 msgid "B<pid_t getpgid(pid_t >I<pid>B<);>"
8902 msgstr ""
8903
8904 #. type: Plain text
8905 #: build/C/man2/setpgid.2:59
8906 msgid "B<pid_t getpgrp(void);> /* POSIX.1 version */"
8907 msgstr ""
8908
8909 #. type: Plain text
8910 #: build/C/man2/setpgid.2:62
8911 msgid ""
8912 "B<pid_t getpgrp(pid_t >I<pid>B<);\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ > /* BSD "
8913 "version */"
8914 msgstr ""
8915
8916 #. type: Plain text
8917 #: build/C/man2/setpgid.2:64
8918 msgid "B<int setpgrp(void);> /* System V version */"
8919 msgstr ""
8920
8921 #. type: Plain text
8922 #: build/C/man2/setpgid.2:67
8923 msgid "B<int setpgrp(pid_t >I<pid>B<, pid_t >I<pgid>B<);\\ > /* BSD version */"
8924 msgstr ""
8925
8926 #. type: Plain text
8927 #: build/C/man2/setpgid.2:76
8928 msgid "B<getpgid>():"
8929 msgstr ""
8930
8931 #. type: Plain text
8932 #: build/C/man2/setpgid.2:84
8933 msgid "B<setpgrp>() (POSIX.1):"
8934 msgstr ""
8935
8936 #. type: Plain text
8937 #: build/C/man2/setpgid.2:87
8938 #, no-wrap
8939 msgid ""
8940 "    _SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 ||\n"
8941 "    _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED\n"
8942 msgstr ""
8943
8944 #. type: Plain text
8945 #: build/C/man2/setpgid.2:89
8946 #, no-wrap
8947 msgid "    || /* Since glibc 2.19: */ _BSD_SOURCE\n"
8948 msgstr ""
8949
8950 #. type: Plain text
8951 #: build/C/man2/setpgid.2:93
8952 msgid "B<setpgrp>()\\ (BSD), B<getpgrp>()\\ (BSD) [before glibc 2.19]:"
8953 msgstr ""
8954
8955 #. type: Plain text
8956 #: build/C/man2/setpgid.2:97
8957 #, no-wrap
8958 msgid ""
8959 "    _BSD_SOURCE &&\n"
8960 "        !\\ (_POSIX_SOURCE || _POSIX_C_SOURCE || _XOPEN_SOURCE ||\n"
8961 "           _XOPEN_SOURCE_EXTENDED || _GNU_SOURCE || _SVID_SOURCE)\n"
8962 msgstr ""
8963
8964 #. type: Plain text
8965 #: build/C/man2/setpgid.2:109
8966 msgid ""
8967 "All of these interfaces are available on Linux, and are used for getting and "
8968 "setting the process group ID (PGID) of a process.  The preferred, "
8969 "POSIX.1-specified ways of doing this are: B<getpgrp>(void), for retrieving "
8970 "the calling process's PGID; and B<setpgid>(), for setting a process's PGID."
8971 msgstr ""
8972
8973 #. type: Plain text
8974 #: build/C/man2/setpgid.2:134
8975 msgid ""
8976 "B<setpgid>()  sets the PGID of the process specified by I<pid> to I<pgid>.  "
8977 "If I<pid> is zero, then the process ID of the calling process is used.  If "
8978 "I<pgid> is zero, then the PGID of the process specified by I<pid> is made "
8979 "the same as its process ID.  If B<setpgid>()  is used to move a process from "
8980 "one process group to another (as is done by some shells when creating "
8981 "pipelines), both process groups must be part of the same session (see "
8982 "B<setsid>(2)  and B<credentials>(7)).  In this case, the I<pgid> specifies "
8983 "an existing process group to be joined and the session ID of that group must "
8984 "match the session ID of the joining process."
8985 msgstr ""
8986
8987 #. type: Plain text
8988 #: build/C/man2/setpgid.2:139
8989 msgid ""
8990 "The POSIX.1 version of B<getpgrp>(), which takes no arguments, returns the "
8991 "PGID of the calling process."
8992 msgstr ""
8993
8994 #. type: Plain text
8995 #: build/C/man2/setpgid.2:150
8996 msgid ""
8997 "B<getpgid>()  returns the PGID of the process specified by I<pid>.  If "
8998 "I<pid> is zero, the process ID of the calling process is used.  (Retrieving "
8999 "the PGID of a process other than the caller is rarely necessary, and the "
9000 "POSIX.1 B<getpgrp>()  is preferred for that task.)"
9001 msgstr ""
9002
9003 #. type: Plain text
9004 #: build/C/man2/setpgid.2:155
9005 msgid ""
9006 "The System\\ V-style B<setpgrp>(), which takes no arguments, is equivalent "
9007 "to I<setpgid(0,\\ 0)>."
9008 msgstr ""
9009
9010 #. type: Plain text
9011 #: build/C/man2/setpgid.2:163
9012 msgid ""
9013 "The BSD-specific B<setpgrp>()  call, which takes arguments I<pid> and "
9014 "I<pgid>, is is a wrapper function that calls"
9015 msgstr ""
9016
9017 #. type: Plain text
9018 #: build/C/man2/setpgid.2:165
9019 #, no-wrap
9020 msgid "    setpgid(pid, pgid)\n"
9021 msgstr ""
9022
9023 #.  The true BSD setpgrp() system call differs in allowing the PGID
9024 #.  to be set to arbitrary values, rather than being restricted to
9025 #.  PGIDs in the same session.
9026 #. type: Plain text
9027 #: build/C/man2/setpgid.2:176
9028 msgid ""
9029 "Since glibc 2.19, the BSD-specific B<setpgrp>()  function is no longer "
9030 "exposed by I<E<lt>unistd.hE<gt>>; calls should be replaced with the "
9031 "B<setpgid>()  call shown above."
9032 msgstr ""
9033
9034 #. type: Plain text
9035 #: build/C/man2/setpgid.2:182
9036 msgid ""
9037 "The BSD-specific B<getpgrp>()  call, which takes a single I<pid> argument, "
9038 "is a wrapper function that calls"
9039 msgstr ""
9040
9041 #. type: Plain text
9042 #: build/C/man2/setpgid.2:184
9043 #, no-wrap
9044 msgid "    getpgid(pid)\n"
9045 msgstr ""
9046
9047 #. type: Plain text
9048 #: build/C/man2/setpgid.2:195
9049 msgid ""
9050 "Since glibc 2.19, the BSD-specific B<getpgrp>()  function is no longer "
9051 "exposed by I<E<lt>unistd.hE<gt>>; calls should be replaced with calls to the "
9052 "POSIX.1 B<getpgrp>()  which takes no arguments (if the intent is to obtain "
9053 "the caller's PGID), or with the B<getpgid>()  call shown above."
9054 msgstr ""
9055
9056 #. type: Plain text
9057 #: build/C/man2/setpgid.2:204
9058 msgid ""
9059 "On success, B<setpgid>()  and B<setpgrp>()  return zero.  On error, -1 is "
9060 "returned, and I<errno> is set appropriately."
9061 msgstr ""
9062
9063 #. type: Plain text
9064 #: build/C/man2/setpgid.2:208
9065 msgid "The POSIX.1 B<getpgrp>()  always returns the PGID of the caller."
9066 msgstr ""
9067
9068 #. type: Plain text
9069 #: build/C/man2/setpgid.2:216
9070 msgid ""
9071 "B<getpgid>(), and the BSD-specific B<getpgrp>()  return a process group on "
9072 "success.  On error, -1 is returned, and I<errno> is set appropriately."
9073 msgstr ""
9074
9075 #. type: Plain text
9076 #: build/C/man2/setpgid.2:225
9077 msgid ""
9078 "An attempt was made to change the process group ID of one of the children of "
9079 "the calling process and the child had already performed an B<execve>(2)  "
9080 "(B<setpgid>(), B<setpgrp>())."
9081 msgstr ""
9082
9083 #. type: Plain text
9084 #: build/C/man2/setpgid.2:231
9085 msgid "I<pgid> is less than 0 (B<setpgid>(), B<setpgrp>())."
9086 msgstr ""
9087
9088 #. type: Plain text
9089 #: build/C/man2/setpgid.2:240
9090 msgid ""
9091 "An attempt was made to move a process into a process group in a different "
9092 "session, or to change the process group ID of one of the children of the "
9093 "calling process and the child was in a different session, or to change the "
9094 "process group ID of a session leader (B<setpgid>(), B<setpgrp>())."
9095 msgstr ""
9096
9097 #. type: Plain text
9098 #: build/C/man2/setpgid.2:250
9099 msgid ""
9100 "For B<getpgid>(): I<pid> does not match any process.  For B<setpgid>(): "
9101 "I<pid> is not the calling process and not a child of the calling process."
9102 msgstr ""
9103
9104 #. type: Plain text
9105 #: build/C/man2/setpgid.2:256
9106 msgid ""
9107 "B<setpgid>()  and the version of B<getpgrp>()  with no arguments conform to "
9108 "POSIX.1-2001."
9109 msgstr ""
9110
9111 #. type: Plain text
9112 #: build/C/man2/setpgid.2:265
9113 msgid ""
9114 "POSIX.1-2001 also specifies B<getpgid>()  and the version of B<setpgrp>()  "
9115 "that takes no arguments.  (POSIX.1-2008 marks this B<setpgrp>()  "
9116 "specification as obsolete.)"
9117 msgstr ""
9118
9119 #. type: Plain text
9120 #: build/C/man2/setpgid.2:272
9121 msgid ""
9122 "The version of B<getpgrp>()  with one argument and the version of "
9123 "B<setpgrp>()  that takes two arguments derive from 4.2BSD, and are not "
9124 "specified by POSIX.1."
9125 msgstr ""
9126
9127 #. type: Plain text
9128 #: build/C/man2/setpgid.2:278
9129 msgid ""
9130 "A child created via B<fork>(2)  inherits its parent's process group ID.  The "
9131 "PGID is preserved across an B<execve>(2)."
9132 msgstr ""
9133
9134 #. type: Plain text
9135 #: build/C/man2/setpgid.2:281
9136 msgid ""
9137 "Each process group is a member of a session and each process is a member of "
9138 "the session of which its process group is a member."
9139 msgstr ""
9140
9141 #. type: Plain text
9142 #: build/C/man2/setpgid.2:308
9143 msgid ""
9144 "A session can have a controlling terminal.  At any time, one (and only one) "
9145 "of the process groups in the session can be the foreground process group for "
9146 "the terminal; the remaining process groups are in the background.  If a "
9147 "signal is generated from the terminal (e.g., typing the interrupt key to "
9148 "generate B<SIGINT>), that signal is sent to the foreground process group.  "
9149 "(See B<termios>(3)  for a description of the characters that generate "
9150 "signals.)  Only the foreground process group may B<read>(2)  from the "
9151 "terminal; if a background process group tries to B<read>(2)  from the "
9152 "terminal, then the group is sent a B<SIGTTIN> signal, which suspends it.  "
9153 "The B<tcgetpgrp>(3)  and B<tcsetpgrp>(3)  functions are used to get/set the "
9154 "foreground process group of the controlling terminal."
9155 msgstr ""
9156
9157 #. type: Plain text
9158 #: build/C/man2/setpgid.2:316
9159 msgid ""
9160 "The B<setpgid>()  and B<getpgrp>()  calls are used by programs such as "
9161 "B<bash>(1)  to create process groups in order to implement shell job "
9162 "control."
9163 msgstr ""
9164
9165 #. type: Plain text
9166 #: build/C/man2/setpgid.2:326
9167 msgid ""
9168 "If a session has a controlling terminal, and the B<CLOCAL> flag for that "
9169 "terminal is not set, and a terminal hangup occurs, then the session leader "
9170 "is sent a B<SIGHUP>.  If the session leader exits, then a B<SIGHUP> signal "
9171 "will also be sent to each process in the foreground process group of the "
9172 "controlling terminal."
9173 msgstr ""
9174
9175 #.  exit.3 refers to the following text:
9176 #. type: Plain text
9177 #: build/C/man2/setpgid.2:340
9178 msgid ""
9179 "If the exit of the process causes a process group to become orphaned, and if "
9180 "any member of the newly orphaned process group is stopped, then a B<SIGHUP> "
9181 "signal followed by a B<SIGCONT> signal will be sent to each process in the "
9182 "newly orphaned process group.  An orphaned process group is one in which the "
9183 "parent of every member of process group is either itself also a member of "
9184 "the process group or is a member of a process group in a different session "
9185 "(see also B<credentials>(7))."
9186 msgstr ""
9187
9188 #. type: Plain text
9189 #: build/C/man2/setpgid.2:347
9190 msgid ""
9191 "B<getuid>(2), B<setsid>(2), B<tcgetpgrp>(3), B<tcsetpgrp>(3), B<termios>(3), "
9192 "B<credentials>(7)"
9193 msgstr ""
9194
9195 #. type: TH
9196 #: build/C/man2/setresuid.2:26
9197 #, no-wrap
9198 msgid "SETRESUID"
9199 msgstr ""
9200
9201 #. type: Plain text
9202 #: build/C/man2/setresuid.2:29
9203 msgid "setresuid, setresgid - set real, effective and saved user or group ID"
9204 msgstr ""
9205
9206 #. type: Plain text
9207 #: build/C/man2/setresuid.2:35
9208 msgid "B<int setresuid(uid_t >I<ruid>B<, uid_t >I<euid>B<, uid_t >I<suid>B<);>"
9209 msgstr ""
9210
9211 #. type: Plain text
9212 #: build/C/man2/setresuid.2:37
9213 msgid "B<int setresgid(gid_t >I<rgid>B<, gid_t >I<egid>B<, gid_t >I<sgid>B<);>"
9214 msgstr ""
9215
9216 #. type: Plain text
9217 #: build/C/man2/setresuid.2:41
9218 msgid ""
9219 "B<setresuid>()  sets the real user ID, the effective user ID, and the saved "
9220 "set-user-ID of the calling process."
9221 msgstr ""
9222
9223 #. type: Plain text
9224 #: build/C/man2/setresuid.2:47
9225 msgid ""
9226 "Unprivileged user processes may change the real UID, effective UID, and "
9227 "saved set-user-ID, each to one of: the current real UID, the current "
9228 "effective UID or the current saved set-user-ID."
9229 msgstr ""
9230
9231 #. type: Plain text
9232 #: build/C/man2/setresuid.2:51
9233 msgid ""
9234 "Privileged processes (on Linux, those having the B<CAP_SETUID> capability)  "
9235 "may set the real UID, effective UID, and saved set-user-ID to arbitrary "
9236 "values."
9237 msgstr ""
9238
9239 #. type: Plain text
9240 #: build/C/man2/setresuid.2:53
9241 msgid "If one of the arguments equals -1, the corresponding value is not changed."
9242 msgstr ""
9243
9244 #. type: Plain text
9245 #: build/C/man2/setresuid.2:57
9246 msgid ""
9247 "Regardless of what changes are made to the real UID, effective UID, and "
9248 "saved set-user-ID, the filesystem UID is always set to the same value as the "
9249 "(possibly new) effective UID."
9250 msgstr ""
9251
9252 #. type: Plain text
9253 #: build/C/man2/setresuid.2:64
9254 msgid ""
9255 "Completely analogously, B<setresgid>()  sets the real GID, effective GID, "
9256 "and saved set-group-ID of the calling process (and always modifies the "
9257 "filesystem GID to be the same as the effective GID), with the same "
9258 "restrictions for unprivileged processes."
9259 msgstr ""
9260
9261 #. type: Plain text
9262 #: build/C/man2/setresuid.2:76
9263 msgid ""
9264 "I<Note>: there are cases where B<setresuid>()  can fail even when the caller "
9265 "is UID 0; it is a grave security error to omit checking for a failure return "
9266 "from B<setresuid>()."
9267 msgstr ""
9268
9269 #. type: TP
9270 #: build/C/man2/setresuid.2:77 build/C/man2/setresuid.2:84 build/C/man2/setreuid.2:106 build/C/man2/setreuid.2:113 build/C/man2/setuid.2:83 build/C/man2/setuid.2:90
9271 #, no-wrap
9272 msgid "B<EAGAIN>"
9273 msgstr ""
9274
9275 #. type: Plain text
9276 #: build/C/man2/setresuid.2:84 build/C/man2/setreuid.2:113
9277 msgid ""
9278 "The call would change the caller's real UID (i.e., I<ruid> does not match "
9279 "the caller's real UID), but there was a temporary failure allocating the "
9280 "necessary kernel data structures."
9281 msgstr ""
9282
9283 #. type: Plain text
9284 #: build/C/man2/setresuid.2:99 build/C/man2/setreuid.2:128
9285 msgid ""
9286 "I<ruid> does not match the caller's real UID and this call would bring the "
9287 "number of processes belonging to the real user ID I<ruid> over the caller's "
9288 "B<RLIMIT_NPROC> resource limit.  Since Linux 3.1, this error case no longer "
9289 "occurs (but robust applications should check for this error); see the "
9290 "description of B<EAGAIN> in B<execve>(2)."
9291 msgstr ""
9292
9293 #. type: Plain text
9294 #: build/C/man2/setresuid.2:103 build/C/man2/setreuid.2:132
9295 msgid ""
9296 "One or more of the target user or group IDs is not valid in this user "
9297 "namespace."
9298 msgstr ""
9299
9300 #. type: Plain text
9301 #: build/C/man2/setresuid.2:107
9302 msgid ""
9303 "The calling process is not privileged (did not have the B<CAP_SETUID> "
9304 "capability) and tried to change the IDs to values that are not permitted."
9305 msgstr ""
9306
9307 #. type: Plain text
9308 #: build/C/man2/setresuid.2:109
9309 msgid "These calls are available under Linux since Linux 2.1.44."
9310 msgstr ""
9311
9312 #. type: Plain text
9313 #: build/C/man2/setresuid.2:116
9314 msgid ""
9315 "Under HP-UX and FreeBSD, the prototype is found in I<E<lt>unistd.hE<gt>>.  "
9316 "Under Linux, the prototype is provided by glibc since version 2.3.2."
9317 msgstr ""
9318
9319 #. type: Plain text
9320 #: build/C/man2/setresuid.2:132
9321 msgid ""
9322 "The original Linux B<setresuid>()  and B<setresgid>()  system calls "
9323 "supported only 16-bit user and group IDs.  Subsequently, Linux 2.4 added "
9324 "B<setresuid32>()  and B<setresgid32>(), supporting 32-bit IDs.  The glibc "
9325 "B<setresuid>()  and B<setresgid>()  wrapper functions transparently deal "
9326 "with the variations across kernel versions."
9327 msgstr ""
9328
9329 #. type: Plain text
9330 #: build/C/man2/setresuid.2:142
9331 msgid ""
9332 "B<getresuid>(2), B<getuid>(2), B<setfsgid>(2), B<setfsuid>(2), "
9333 "B<setreuid>(2), B<setuid>(2), B<capabilities>(7), B<credentials>(7), "
9334 "B<user_namespaces>(7)"
9335 msgstr ""
9336
9337 #. type: TH
9338 #: build/C/man2/setreuid.2:45
9339 #, no-wrap
9340 msgid "SETREUID"
9341 msgstr ""
9342
9343 #. type: Plain text
9344 #: build/C/man2/setreuid.2:48
9345 msgid "setreuid, setregid - set real and/or effective user or group ID"
9346 msgstr ""
9347
9348 #. type: Plain text
9349 #: build/C/man2/setreuid.2:54
9350 msgid "B<int setreuid(uid_t >I<ruid>B<, uid_t >I<euid>B<);>"
9351 msgstr ""
9352
9353 #. type: Plain text
9354 #: build/C/man2/setreuid.2:56
9355 msgid "B<int setregid(gid_t >I<rgid>B<, gid_t >I<egid>B<);>"
9356 msgstr ""
9357
9358 #. type: Plain text
9359 #: build/C/man2/setreuid.2:64
9360 msgid "B<setreuid>(), B<setregid>():"
9361 msgstr ""
9362
9363 #. type: Plain text
9364 #: build/C/man2/setreuid.2:68
9365 msgid ""
9366 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
9367 "_XOPEN_SOURCE_EXTENDED"
9368 msgstr ""
9369
9370 #. type: Plain text
9371 #: build/C/man2/setreuid.2:73
9372 msgid "B<setreuid>()  sets real and effective user IDs of the calling process."
9373 msgstr ""
9374
9375 #. type: Plain text
9376 #: build/C/man2/setreuid.2:76
9377 msgid ""
9378 "Supplying a value of -1 for either the real or effective user ID forces the "
9379 "system to leave that ID unchanged."
9380 msgstr ""
9381
9382 #. type: Plain text
9383 #: build/C/man2/setreuid.2:79
9384 msgid ""
9385 "Unprivileged processes may only set the effective user ID to the real user "
9386 "ID, the effective user ID, or the saved set-user-ID."
9387 msgstr ""
9388
9389 #. type: Plain text
9390 #: build/C/man2/setreuid.2:82
9391 msgid ""
9392 "Unprivileged users may only set the real user ID to the real user ID or the "
9393 "effective user ID."
9394 msgstr ""
9395
9396 #. type: Plain text
9397 #: build/C/man2/setreuid.2:88
9398 msgid ""
9399 "If the real user ID is set (i.e., I<ruid> is not -1) or the effective user "
9400 "ID is set to a value not equal to the previous real user ID, the saved "
9401 "set-user-ID will be set to the new effective user ID."
9402 msgstr ""
9403
9404 #. type: Plain text
9405 #: build/C/man2/setreuid.2:93
9406 msgid ""
9407 "Completely analogously, B<setregid>()  sets real and effective group ID's of "
9408 "the calling process, and all of the above holds with \"group\" instead of "
9409 "\"user\"."
9410 msgstr ""
9411
9412 #. type: Plain text
9413 #: build/C/man2/setreuid.2:105
9414 msgid ""
9415 "I<Note>: there are cases where B<setreuid>()  can fail even when the caller "
9416 "is UID 0; it is a grave security error to omit checking for a failure return "
9417 "from B<setreuid>()."
9418 msgstr ""
9419
9420 #. type: Plain text
9421 #: build/C/man2/setreuid.2:148
9422 msgid ""
9423 "The calling process is not privileged (Linux: does not have the "
9424 "B<CAP_SETUID> capability in the case of B<setreuid>(), or the B<CAP_SETGID> "
9425 "capability in the case of B<setregid>())  and a change other than (i)  "
9426 "swapping the effective user (group) ID with the real user (group) ID, or "
9427 "(ii) setting one to the value of the other or (iii) setting the effective "
9428 "user (group) ID to the value of the saved set-user-ID (saved set-group-ID) "
9429 "was specified."
9430 msgstr ""
9431
9432 #. type: Plain text
9433 #: build/C/man2/setreuid.2:154
9434 msgid ""
9435 "POSIX.1-2001, 4.3BSD (the B<setreuid>()  and B<setregid>()  function calls "
9436 "first appeared in 4.2BSD)."
9437 msgstr ""
9438
9439 #. type: Plain text
9440 #: build/C/man2/setreuid.2:158
9441 msgid ""
9442 "Setting the effective user (group) ID to the saved set-user-ID (saved "
9443 "set-group-ID) is possible since Linux 1.1.37 (1.1.38)."
9444 msgstr ""
9445
9446 #. type: Plain text
9447 #: build/C/man2/setreuid.2:175
9448 msgid ""
9449 "POSIX.1 does not specify all of possible ID changes that are permitted on "
9450 "Linux for an unprivileged process.  For B<setreuid>(), the effective user ID "
9451 "can be made the same as the real user ID or the save set-user-ID, and it is "
9452 "unspecified whether unprivileged processes may set the real user ID to the "
9453 "real user ID, the effective user ID, or the saved set-user-ID.  For "
9454 "B<setregid>(), the real group ID can be changed to the value of the saved "
9455 "set-group-ID, and the effective group ID can be changed to the value of the "
9456 "real group ID or the saved set-group-ID.  The precise details of what ID "
9457 "changes are permitted vary across implementations."
9458 msgstr ""
9459
9460 #. type: Plain text
9461 #: build/C/man2/setreuid.2:178
9462 msgid ""
9463 "POSIX.1 makes no specification about the effect of these calls on the saved "
9464 "set-user-ID and saved set-group-ID."
9465 msgstr ""
9466
9467 #. type: Plain text
9468 #: build/C/man2/setreuid.2:194
9469 msgid ""
9470 "The original Linux B<setreuid>()  and B<setregid>()  system calls supported "
9471 "only 16-bit user and group IDs.  Subsequently, Linux 2.4 added "
9472 "B<setreuid32>()  and B<setregid32>(), supporting 32-bit IDs.  The glibc "
9473 "B<setreuid>()  and B<setregid>()  wrapper functions transparently deal with "
9474 "the variations across kernel versions."
9475 msgstr ""
9476
9477 #. type: Plain text
9478 #: build/C/man2/setreuid.2:203
9479 msgid ""
9480 "B<getgid>(2), B<getuid>(2), B<seteuid>(2), B<setgid>(2), B<setresuid>(2), "
9481 "B<setuid>(2), B<capabilities>(7), B<user_namespaces>(7)"
9482 msgstr ""
9483
9484 #. type: TH
9485 #: build/C/man2/setsid.2:31
9486 #, no-wrap
9487 msgid "SETSID"
9488 msgstr ""
9489
9490 #. type: Plain text
9491 #: build/C/man2/setsid.2:34
9492 msgid "setsid - creates a session and sets the process group ID"
9493 msgstr ""
9494
9495 #. type: Plain text
9496 #: build/C/man2/setsid.2:39
9497 msgid "B<pid_t setsid(void);>"
9498 msgstr ""
9499
9500 #. type: Plain text
9501 #: build/C/man2/setsid.2:50
9502 msgid ""
9503 "B<setsid>()  creates a new session if the calling process is not a process "
9504 "group leader.  The calling process is the leader of the new session (i.e., "
9505 "its session ID is made the same as it process ID).  The calling process also "
9506 "becomes the process group leader of a new process group in the session "
9507 "(i.e., its process group ID is made the same as it process ID)."
9508 msgstr ""
9509
9510 #. type: Plain text
9511 #: build/C/man2/setsid.2:54
9512 msgid ""
9513 "The calling process will be the only process in the new process group and in "
9514 "the new session.  The new session has no controlling terminal."
9515 msgstr ""
9516
9517 #. type: Plain text
9518 #: build/C/man2/setsid.2:61
9519 msgid ""
9520 "On success, the (new) session ID of the calling process is returned.  On "
9521 "error, I<(pid_t)\\ -1> is returned, and I<errno> is set to indicate the "
9522 "error."
9523 msgstr ""
9524
9525 #. type: Plain text
9526 #: build/C/man2/setsid.2:68
9527 msgid ""
9528 "The process group ID of any process equals the PID of the calling process.  "
9529 "Thus, in particular, B<setsid>()  fails if the calling process is already a "
9530 "process group leader."
9531 msgstr ""
9532
9533 #. type: Plain text
9534 #: build/C/man2/setsid.2:76
9535 msgid ""
9536 "A child created via B<fork>(2)  inherits its parent's session ID.  The "
9537 "session ID is preserved across an B<execve>(2)."
9538 msgstr ""
9539
9540 #. type: Plain text
9541 #: build/C/man2/setsid.2:93
9542 msgid ""
9543 "A process group leader is a process whose process group ID equals its PID.  "
9544 "Disallowing a process group leader from calling B<setsid>()  prevents the "
9545 "possibility that a process group leader places itself in a new session while "
9546 "other processes in the process group remain in the original session; such a "
9547 "scenario would break the strict two-level hierarchy of sessions and process "
9548 "groups.  In order to be sure that B<setsid>()  will succeed, B<fork>(2)  and "
9549 "B<_exit>(2), and have the child do B<setsid>()."
9550 msgstr ""
9551
9552 #. type: Plain text
9553 #: build/C/man2/setsid.2:100
9554 msgid ""
9555 "B<setsid>(1), B<getsid>(2), B<setpgid>(2), B<setpgrp>(2), B<tcgetsid>(3), "
9556 "B<credentials>(7)"
9557 msgstr ""
9558
9559 #. type: TH
9560 #: build/C/man2/setuid.2:30
9561 #, no-wrap
9562 msgid "SETUID"
9563 msgstr ""
9564
9565 #. type: Plain text
9566 #: build/C/man2/setuid.2:33
9567 msgid "setuid - set user identity"
9568 msgstr ""
9569
9570 #. type: Plain text
9571 #: build/C/man2/setuid.2:39
9572 msgid "B<int setuid(uid_t >I<uid>B<);>"
9573 msgstr ""
9574
9575 #. type: Plain text
9576 #: build/C/man2/setuid.2:44
9577 msgid ""
9578 "B<setuid>()  sets the effective user ID of the calling process.  If the "
9579 "effective UID of the caller is root, the real UID and saved set-user-ID are "
9580 "also set."
9581 msgstr ""
9582
9583 #. type: Plain text
9584 #: build/C/man2/setuid.2:53
9585 msgid ""
9586 "Under Linux, B<setuid>()  is implemented like the POSIX version with the "
9587 "B<_POSIX_SAVED_IDS> feature.  This allows a set-user-ID (other than root) "
9588 "program to drop all of its user privileges, do some un-privileged work, and "
9589 "then reengage the original effective user ID in a secure manner."
9590 msgstr ""
9591
9592 #. type: Plain text
9593 #: build/C/man2/setuid.2:63
9594 msgid ""
9595 "If the user is root or the program is set-user-ID-root, special care must be "
9596 "taken.  The B<setuid>()  function checks the effective user ID of the caller "
9597 "and if it is the superuser, all process-related user ID's are set to "
9598 "I<uid>.  After this has occurred, it is impossible for the program to regain "
9599 "root privileges."
9600 msgstr ""
9601
9602 #. type: Plain text
9603 #: build/C/man2/setuid.2:70
9604 msgid ""
9605 "Thus, a set-user-ID-root program wishing to temporarily drop root "
9606 "privileges, assume the identity of an unprivileged user, and then regain "
9607 "root privileges afterward cannot use B<setuid>().  You can accomplish this "
9608 "with B<seteuid>(2)."
9609 msgstr ""
9610
9611 #. type: Plain text
9612 #: build/C/man2/setuid.2:82
9613 msgid ""
9614 "I<Note>: there are cases where B<setuid>()  can fail even when the caller is "
9615 "UID 0; it is a grave security error to omit checking for a failure return "
9616 "from B<setuid>()."
9617 msgstr ""
9618
9619 #. type: Plain text
9620 #: build/C/man2/setuid.2:90
9621 msgid ""
9622 "The call would change the caller's real UID (i.e., I<uid> does not match the "
9623 "caller's real UID), but there was a temporary failure allocating the "
9624 "necessary kernel data structures."
9625 msgstr ""
9626
9627 #. type: Plain text
9628 #: build/C/man2/setuid.2:105
9629 msgid ""
9630 "I<uid> does not match the real user ID of the caller and this call would "
9631 "bring the number of processes belonging to the real user ID I<uid> over the "
9632 "caller's B<RLIMIT_NPROC> resource limit.  Since Linux 3.1, this error case "
9633 "no longer occurs (but robust applications should check for this error); see "
9634 "the description of B<EAGAIN> in B<execve>(2)."
9635 msgstr ""
9636
9637 #. type: Plain text
9638 #: build/C/man2/setuid.2:110
9639 msgid "The user ID specified in I<uid> is not valid in this user namespace."
9640 msgstr ""
9641
9642 #. type: Plain text
9643 #: build/C/man2/setuid.2:117
9644 msgid ""
9645 "The user is not privileged (Linux: does not have the B<CAP_SETUID> "
9646 "capability) and I<uid> does not match the real UID or saved set-user-ID of "
9647 "the calling process."
9648 msgstr ""
9649
9650 #.  SVr4 documents an additional EINVAL error condition.
9651 #. type: Plain text
9652 #: build/C/man2/setuid.2:122
9653 msgid ""
9654 "SVr4, POSIX.1-2001.  Not quite compatible with the 4.4BSD call, which sets "
9655 "all of the real, saved, and effective user IDs."
9656 msgstr ""
9657
9658 #. type: Plain text
9659 #: build/C/man2/setuid.2:130
9660 msgid ""
9661 "Linux has the concept of the filesystem user ID, normally equal to the "
9662 "effective user ID.  The B<setuid>()  call also sets the filesystem user ID "
9663 "of the calling process.  See B<setfsuid>(2)."
9664 msgstr ""
9665
9666 #. type: Plain text
9667 #: build/C/man2/setuid.2:135
9668 msgid ""
9669 "If I<uid> is different from the old effective UID, the process will be "
9670 "forbidden from leaving core dumps."
9671 msgstr ""
9672
9673 #. type: Plain text
9674 #: build/C/man2/setuid.2:145
9675 msgid ""
9676 "The original Linux B<setuid>()  system call supported only 16-bit user IDs.  "
9677 "Subsequently, Linux 2.4 added B<setuid32>()  supporting 32-bit IDs.  The "
9678 "glibc B<setuid>()  wrapper function transparently deals with the variation "
9679 "across kernel versions."
9680 msgstr ""
9681
9682 #. type: Plain text
9683 #: build/C/man2/setuid.2:153
9684 msgid ""
9685 "B<getuid>(2), B<seteuid>(2), B<setfsuid>(2), B<setreuid>(2), "
9686 "B<capabilities>(7), B<credentials>(7), B<user_namespaces>(7)"
9687 msgstr ""
9688
9689 #. type: TH
9690 #: build/C/man7/svipc.7:40
9691 #, no-wrap
9692 msgid "SVIPC"
9693 msgstr ""
9694
9695 #. type: Plain text
9696 #: build/C/man7/svipc.7:43
9697 msgid "svipc - System V interprocess communication mechanisms"
9698 msgstr ""
9699
9700 #. type: Plain text
9701 #: build/C/man7/svipc.7:48
9702 #, no-wrap
9703 msgid ""
9704 "B<#include E<lt>sys/msg.hE<gt>>\n"
9705 "B<#include E<lt>sys/sem.hE<gt>>\n"
9706 "B<#include E<lt>sys/shm.hE<gt>>\n"
9707 msgstr ""
9708
9709 #. type: Plain text
9710 #: build/C/man7/svipc.7:56
9711 msgid ""
9712 "This manual page refers to the Linux implementation of the System V "
9713 "interprocess communication (IPC) mechanisms: message queues, semaphore sets, "
9714 "and shared memory segments.  In the following, the word I<resource> means an "
9715 "instantiation of one among such mechanisms."
9716 msgstr ""
9717
9718 #. type: SS
9719 #: build/C/man7/svipc.7:56
9720 #, no-wrap
9721 msgid "Resource access permissions"
9722 msgstr ""
9723
9724 #. type: Plain text
9725 #: build/C/man7/svipc.7:64
9726 msgid ""
9727 "For each resource, the system uses a common structure of type I<struct "
9728 "ipc_perm> to store information needed in determining permissions to perform "
9729 "an IPC operation.  The I<ipc_perm> structure includes the following members:"
9730 msgstr ""
9731
9732 #. type: Plain text
9733 #: build/C/man7/svipc.7:74
9734 #, no-wrap
9735 msgid ""
9736 "struct ipc_perm {\n"
9737 "    uid_t          cuid;   /* creator user ID */\n"
9738 "    gid_t          cgid;   /* creator group ID */\n"
9739 "    uid_t          uid;    /* owner user ID */\n"
9740 "    gid_t          gid;    /* owner group ID */\n"
9741 "    unsigned short mode;   /* r/w permissions */\n"
9742 "};\n"
9743 msgstr ""
9744
9745 #. type: Plain text
9746 #: build/C/man7/svipc.7:84
9747 msgid ""
9748 "The I<mode> member of the I<ipc_perm> structure defines, with its lower 9 "
9749 "bits, the access permissions to the resource for a process executing an IPC "
9750 "system call.  The permissions are interpreted as follows:"
9751 msgstr ""
9752
9753 #. type: Plain text
9754 #: build/C/man7/svipc.7:88
9755 #, no-wrap
9756 msgid ""
9757 "    0400    Read by user.\n"
9758 "    0200    Write by user.\n"
9759 msgstr ""
9760
9761 #. type: Plain text
9762 #: build/C/man7/svipc.7:91
9763 #, no-wrap
9764 msgid ""
9765 "    0040    Read by group.\n"
9766 "    0020    Write by group.\n"
9767 msgstr ""
9768
9769 #. type: Plain text
9770 #: build/C/man7/svipc.7:94
9771 #, no-wrap
9772 msgid ""
9773 "    0004    Read by others.\n"
9774 "    0002    Write by others.\n"
9775 msgstr ""
9776
9777 #. type: Plain text
9778 #: build/C/man7/svipc.7:102
9779 msgid ""
9780 "Bits 0100, 0010, and 0001 (the execute bits) are unused by the system.  "
9781 "Furthermore, \"write\" effectively means \"alter\" for a semaphore set."
9782 msgstr ""
9783
9784 #. type: Plain text
9785 #: build/C/man7/svipc.7:105
9786 msgid "The same system header file also defines the following symbolic constants:"
9787 msgstr ""
9788
9789 #. type: TP
9790 #: build/C/man7/svipc.7:105
9791 #, no-wrap
9792 msgid "B<IPC_CREAT>"
9793 msgstr ""
9794
9795 #. type: Plain text
9796 #: build/C/man7/svipc.7:108
9797 msgid "Create entry if key doesn't exist."
9798 msgstr ""
9799
9800 #. type: TP
9801 #: build/C/man7/svipc.7:108
9802 #, no-wrap
9803 msgid "B<IPC_EXCL>"
9804 msgstr ""
9805
9806 #. type: Plain text
9807 #: build/C/man7/svipc.7:111
9808 msgid "Fail if key exists."
9809 msgstr ""
9810
9811 #. type: TP
9812 #: build/C/man7/svipc.7:111
9813 #, no-wrap
9814 msgid "B<IPC_NOWAIT>"
9815 msgstr ""
9816
9817 #. type: Plain text
9818 #: build/C/man7/svipc.7:114
9819 msgid "Error if request must wait."
9820 msgstr ""
9821
9822 #. type: TP
9823 #: build/C/man7/svipc.7:114
9824 #, no-wrap
9825 msgid "B<IPC_PRIVATE>"
9826 msgstr ""
9827
9828 #. type: Plain text
9829 #: build/C/man7/svipc.7:117
9830 msgid "Private key."
9831 msgstr ""
9832
9833 #. type: TP
9834 #: build/C/man7/svipc.7:117
9835 #, no-wrap
9836 msgid "B<IPC_RMID>"
9837 msgstr ""
9838
9839 #. type: Plain text
9840 #: build/C/man7/svipc.7:120
9841 msgid "Remove resource."
9842 msgstr ""
9843
9844 #. type: TP
9845 #: build/C/man7/svipc.7:120
9846 #, no-wrap
9847 msgid "B<IPC_SET>"
9848 msgstr ""
9849
9850 #. type: Plain text
9851 #: build/C/man7/svipc.7:123
9852 msgid "Set resource options."
9853 msgstr ""
9854
9855 #. type: TP
9856 #: build/C/man7/svipc.7:123
9857 #, no-wrap
9858 msgid "B<IPC_STAT>"
9859 msgstr ""
9860
9861 #. type: Plain text
9862 #: build/C/man7/svipc.7:126
9863 msgid "Get resource options."
9864 msgstr ""
9865
9866 #. type: Plain text
9867 #: build/C/man7/svipc.7:135
9868 msgid ""
9869 "Note that B<IPC_PRIVATE> is a I<key_t> type, while all the other symbolic "
9870 "constants are flag fields and can be OR'ed into an I<int> type variable."
9871 msgstr ""
9872
9873 #. type: SS
9874 #: build/C/man7/svipc.7:135
9875 #, no-wrap
9876 msgid "Message queues"
9877 msgstr ""
9878
9879 #. type: Plain text
9880 #: build/C/man7/svipc.7:143
9881 msgid ""
9882 "A message queue is uniquely identified by a positive integer (its I<msqid>)  "
9883 "and has an associated data structure of type I<struct msqid_ds>, defined in "
9884 "I<E<lt>sys/msg.hE<gt>>, containing the following members:"
9885 msgstr ""
9886
9887 #. type: Plain text
9888 #: build/C/man7/svipc.7:156
9889 #, no-wrap
9890 msgid ""
9891 "struct msqid_ds {\n"
9892 "    struct ipc_perm msg_perm;\n"
9893 "    msgqnum_t       msg_qnum;    /* no of messages on queue */\n"
9894 "    msglen_t        msg_qbytes;  /* bytes max on a queue */\n"
9895 "    pid_t           msg_lspid;   /* PID of last msgsnd(2) call */\n"
9896 "    pid_t           msg_lrpid;   /* PID of last msgrcv(2) call */\n"
9897 "    time_t          msg_stime;   /* last msgsnd(2) time */\n"
9898 "    time_t          msg_rtime;   /* last msgrcv(2) time */\n"
9899 "    time_t          msg_ctime;   /* last change time */\n"
9900 "};\n"
9901 msgstr ""
9902
9903 #. type: TP
9904 #: build/C/man7/svipc.7:158
9905 #, no-wrap
9906 msgid "I<msg_perm>"
9907 msgstr ""
9908
9909 #. type: Plain text
9910 #: build/C/man7/svipc.7:163
9911 msgid ""
9912 "I<ipc_perm> structure that specifies the access permissions on the message "
9913 "queue."
9914 msgstr ""
9915
9916 #. type: TP
9917 #: build/C/man7/svipc.7:163
9918 #, no-wrap
9919 msgid "I<msg_qnum>"
9920 msgstr ""
9921
9922 #. type: Plain text
9923 #: build/C/man7/svipc.7:166
9924 msgid "Number of messages currently on the message queue."
9925 msgstr ""
9926
9927 #. type: TP
9928 #: build/C/man7/svipc.7:166
9929 #, no-wrap
9930 msgid "I<msg_qbytes>"
9931 msgstr ""
9932
9933 #. type: Plain text
9934 #: build/C/man7/svipc.7:170
9935 msgid "Maximum number of bytes of message text allowed on the message queue."
9936 msgstr ""
9937
9938 #. type: TP
9939 #: build/C/man7/svipc.7:170
9940 #, no-wrap
9941 msgid "I<msg_lspid>"
9942 msgstr ""
9943
9944 #. type: Plain text
9945 #: build/C/man7/svipc.7:175
9946 msgid "ID of the process that performed the last B<msgsnd>(2)  system call."
9947 msgstr ""
9948
9949 #. type: TP
9950 #: build/C/man7/svipc.7:175
9951 #, no-wrap
9952 msgid "I<msg_lrpid>"
9953 msgstr ""
9954
9955 #. type: Plain text
9956 #: build/C/man7/svipc.7:180
9957 msgid "ID of the process that performed the last B<msgrcv>(2)  system call."
9958 msgstr ""
9959
9960 #. type: TP
9961 #: build/C/man7/svipc.7:180
9962 #, no-wrap
9963 msgid "I<msg_stime>"
9964 msgstr ""
9965
9966 #. type: Plain text
9967 #: build/C/man7/svipc.7:185
9968 msgid "Time of the last B<msgsnd>(2)  system call."
9969 msgstr ""
9970
9971 #. type: TP
9972 #: build/C/man7/svipc.7:185
9973 #, no-wrap
9974 msgid "I<msg_rtime>"
9975 msgstr ""
9976
9977 #. type: Plain text
9978 #: build/C/man7/svipc.7:190
9979 msgid "Time of the last B<msgrcv>(2)  system call."
9980 msgstr ""
9981
9982 #. type: TP
9983 #: build/C/man7/svipc.7:190
9984 #, no-wrap
9985 msgid "I<msg_ctime>"
9986 msgstr ""
9987
9988 #. type: Plain text
9989 #: build/C/man7/svipc.7:196
9990 msgid ""
9991 "Time of the last system call that changed a member of the I<msqid_ds> "
9992 "structure."
9993 msgstr ""
9994
9995 #. type: SS
9996 #: build/C/man7/svipc.7:196
9997 #, no-wrap
9998 msgid "Semaphore sets"
9999 msgstr ""
10000
10001 #. type: Plain text
10002 #: build/C/man7/svipc.7:204
10003 msgid ""
10004 "A semaphore set is uniquely identified by a positive integer (its I<semid>)  "
10005 "and has an associated data structure of type I<struct semid_ds>, defined in "
10006 "I<E<lt>sys/sem.hE<gt>>, containing the following members:"
10007 msgstr ""
10008
10009 #. type: Plain text
10010 #: build/C/man7/svipc.7:213
10011 #, no-wrap
10012 msgid ""
10013 "struct semid_ds {\n"
10014 "    struct ipc_perm sem_perm;\n"
10015 "    time_t          sem_otime;   /* last operation time */\n"
10016 "    time_t          sem_ctime;   /* last change time */\n"
10017 "    unsigned long   sem_nsems;   /* count of sems in set */\n"
10018 "};\n"
10019 msgstr ""
10020
10021 #. type: TP
10022 #: build/C/man7/svipc.7:215
10023 #, no-wrap
10024 msgid "I<sem_perm>"
10025 msgstr ""
10026
10027 #. type: Plain text
10028 #: build/C/man7/svipc.7:220
10029 msgid ""
10030 "I<ipc_perm> structure that specifies the access permissions on the semaphore "
10031 "set."
10032 msgstr ""
10033
10034 #. type: TP
10035 #: build/C/man7/svipc.7:220
10036 #, no-wrap
10037 msgid "I<sem_otime>"
10038 msgstr ""
10039
10040 #. type: Plain text
10041 #: build/C/man7/svipc.7:225
10042 msgid "Time of last B<semop>(2)  system call."
10043 msgstr ""
10044
10045 #. type: TP
10046 #: build/C/man7/svipc.7:225
10047 #, no-wrap
10048 msgid "I<sem_ctime>"
10049 msgstr ""
10050
10051 #. type: Plain text
10052 #: build/C/man7/svipc.7:231
10053 msgid ""
10054 "Time of last B<semctl>(2)  system call that changed a member of the above "
10055 "structure or of one semaphore belonging to the set."
10056 msgstr ""
10057
10058 #. type: TP
10059 #: build/C/man7/svipc.7:231
10060 #, no-wrap
10061 msgid "I<sem_nsems>"
10062 msgstr ""
10063
10064 #. type: Plain text
10065 #: build/C/man7/svipc.7:239
10066 msgid ""
10067 "Number of semaphores in the set.  Each semaphore of the set is referenced by "
10068 "a nonnegative integer ranging from B<0> to I<sem_nsems-1>."
10069 msgstr ""
10070
10071 #. type: Plain text
10072 #: build/C/man7/svipc.7:243
10073 msgid ""
10074 "A semaphore is a data structure of type I<struct sem> containing the "
10075 "following members:"
10076 msgstr ""
10077
10078 #.     unsigned short semncnt; /* nr awaiting semval to increase */
10079 #.     unsigned short semzcnt; /* nr awaiting semval = 0 */
10080 #. type: Plain text
10081 #: build/C/man7/svipc.7:252
10082 #, no-wrap
10083 msgid ""
10084 "struct sem {\n"
10085 "    int semval;  /* semaphore value */\n"
10086 "    int sempid;  /* PID for last operation */\n"
10087 "};\n"
10088 msgstr ""
10089
10090 #. type: TP
10091 #: build/C/man7/svipc.7:254
10092 #, no-wrap
10093 msgid "I<semval>"
10094 msgstr ""
10095
10096 #. type: Plain text
10097 #: build/C/man7/svipc.7:257
10098 msgid "Semaphore value: a nonnegative integer."
10099 msgstr ""
10100
10101 #. type: TP
10102 #: build/C/man7/svipc.7:257
10103 #, no-wrap
10104 msgid "I<sempid>"
10105 msgstr ""
10106
10107 #. .TP
10108 #. .I semncnt
10109 #. Number of processes suspended awaiting for
10110 #. .I semval
10111 #. to increase.
10112 #. .TP
10113 #. .I semznt
10114 #. Number of processes suspended awaiting for
10115 #. .I semval
10116 #. to become zero.
10117 #. type: Plain text
10118 #: build/C/man7/svipc.7:271
10119 msgid ""
10120 "ID of the last process that performed a semaphore operation on this "
10121 "semaphore."
10122 msgstr ""
10123
10124 #. type: SS
10125 #: build/C/man7/svipc.7:271
10126 #, no-wrap
10127 msgid "Shared memory segments"
10128 msgstr ""
10129
10130 #. type: Plain text
10131 #: build/C/man7/svipc.7:279
10132 msgid ""
10133 "A shared memory segment is uniquely identified by a positive integer (its "
10134 "I<shmid>)  and has an associated data structure of type I<struct shmid_ds>, "
10135 "defined in I<E<lt>sys/shm.hE<gt>>, containing the following members:"
10136 msgstr ""
10137
10138 #. type: Plain text
10139 #: build/C/man7/svipc.7:292
10140 #, no-wrap
10141 msgid ""
10142 "struct shmid_ds {\n"
10143 "    struct ipc_perm shm_perm;\n"
10144 "    size_t          shm_segsz;   /* size of segment */\n"
10145 "    pid_t           shm_cpid;    /* PID of creator */\n"
10146 "    pid_t           shm_lpid;    /* PID, last operation */\n"
10147 "    shmatt_t        shm_nattch;  /* no. of current attaches */\n"
10148 "    time_t          shm_atime;   /* time of last attach */\n"
10149 "    time_t          shm_dtime;   /* time of last detach */\n"
10150 "    time_t          shm_ctime;   /* time of last change */\n"
10151 "};\n"
10152 msgstr ""
10153
10154 #. type: TP
10155 #: build/C/man7/svipc.7:294
10156 #, no-wrap
10157 msgid "I<shm_perm>"
10158 msgstr ""
10159
10160 #. type: Plain text
10161 #: build/C/man7/svipc.7:299
10162 msgid ""
10163 "I<ipc_perm> structure that specifies the access permissions on the shared "
10164 "memory segment."
10165 msgstr ""
10166
10167 #. type: TP
10168 #: build/C/man7/svipc.7:299
10169 #, no-wrap
10170 msgid "I<shm_segsz>"
10171 msgstr ""
10172
10173 #. type: Plain text
10174 #: build/C/man7/svipc.7:302
10175 msgid "Size in bytes of the shared memory segment."
10176 msgstr ""
10177
10178 #. type: TP
10179 #: build/C/man7/svipc.7:302
10180 #, no-wrap
10181 msgid "I<shm_cpid>"
10182 msgstr ""
10183
10184 #. type: Plain text
10185 #: build/C/man7/svipc.7:305
10186 msgid "ID of the process that created the shared memory segment."
10187 msgstr ""
10188
10189 #. type: TP
10190 #: build/C/man7/svipc.7:305
10191 #, no-wrap
10192 msgid "I<shm_lpid>"
10193 msgstr ""
10194
10195 #. type: Plain text
10196 #: build/C/man7/svipc.7:312
10197 msgid ""
10198 "ID of the last process that executed a B<shmat>(2)  or B<shmdt>(2)  system "
10199 "call."
10200 msgstr ""
10201
10202 #. type: TP
10203 #: build/C/man7/svipc.7:312
10204 #, no-wrap
10205 msgid "I<shm_nattch>"
10206 msgstr ""
10207
10208 #. type: Plain text
10209 #: build/C/man7/svipc.7:315
10210 msgid "Number of current alive attaches for this shared memory segment."
10211 msgstr ""
10212
10213 #. type: TP
10214 #: build/C/man7/svipc.7:315
10215 #, no-wrap
10216 msgid "I<shm_atime>"
10217 msgstr ""
10218
10219 #. type: Plain text
10220 #: build/C/man7/svipc.7:320
10221 msgid "Time of the last B<shmat>(2)  system call."
10222 msgstr ""
10223
10224 #. type: TP
10225 #: build/C/man7/svipc.7:320
10226 #, no-wrap
10227 msgid "I<shm_dtime>"
10228 msgstr ""
10229
10230 #. type: Plain text
10231 #: build/C/man7/svipc.7:325
10232 msgid "Time of the last B<shmdt>(2)  system call."
10233 msgstr ""
10234
10235 #. type: TP
10236 #: build/C/man7/svipc.7:325
10237 #, no-wrap
10238 msgid "I<shm_ctime>"
10239 msgstr ""
10240
10241 #. type: Plain text
10242 #: build/C/man7/svipc.7:331
10243 msgid "Time of the last B<shmctl>(2)  system call that changed I<shmid_ds>."
10244 msgstr ""
10245
10246 #. type: SS
10247 #: build/C/man7/svipc.7:331
10248 #, no-wrap
10249 msgid "IPC namespaces"
10250 msgstr ""
10251
10252 #. type: Plain text
10253 #: build/C/man7/svipc.7:335
10254 msgid ""
10255 "For a discussion of the interaction of System V IPC objects and IPC "
10256 "namespaces, see B<namespaces>(7)."
10257 msgstr ""
10258
10259 #. type: Plain text
10260 #: build/C/man7/svipc.7:353
10261 msgid ""
10262 "B<ipcmk>(1), B<ipcrm>(1), B<ipcs>(1), B<ipc>(2), B<msgctl>(2), B<msgget>(2), "
10263 "B<msgrcv>(2), B<msgsnd>(2), B<semctl>(2), B<semget>(2), B<semop>(2), "
10264 "B<shmat>(2), B<shmctl>(2), B<shmdt>(2), B<shmget>(2), B<ftok>(3), "
10265 "B<namespaces>(7)"
10266 msgstr ""
10267
10268 #. type: TH
10269 #: build/C/man3/ulimit.3:27
10270 #, no-wrap
10271 msgid "ULIMIT"
10272 msgstr ""
10273
10274 #. type: TH
10275 #: build/C/man3/ulimit.3:27
10276 #, no-wrap
10277 msgid "2008-08-06"
10278 msgstr ""
10279
10280 #. type: Plain text
10281 #: build/C/man3/ulimit.3:30
10282 msgid "ulimit - get and set user limits"
10283 msgstr ""
10284
10285 #. type: Plain text
10286 #: build/C/man3/ulimit.3:32
10287 msgid "B<#include E<lt>ulimit.hE<gt>>"
10288 msgstr ""
10289
10290 #. type: Plain text
10291 #: build/C/man3/ulimit.3:34
10292 msgid "B<long ulimit(int >I<cmd>B<, long >I<newlimit>B<);>"
10293 msgstr ""
10294
10295 #. type: Plain text
10296 #: build/C/man3/ulimit.3:46
10297 msgid ""
10298 "Warning: This routine is obsolete.  Use B<getrlimit>(2), B<setrlimit>(2), "
10299 "and B<sysconf>(3)  instead.  For the shell command B<ulimit>(), see "
10300 "B<bash>(1)."
10301 msgstr ""
10302
10303 #. type: Plain text
10304 #: build/C/man3/ulimit.3:53
10305 msgid ""
10306 "The B<ulimit>()  call will get or set some limit for the calling process.  "
10307 "The I<cmd> argument can have one of the following values."
10308 msgstr ""
10309
10310 #. type: TP
10311 #: build/C/man3/ulimit.3:53
10312 #, no-wrap
10313 msgid "B<UL_GETFSIZE>"
10314 msgstr ""
10315
10316 #. type: Plain text
10317 #: build/C/man3/ulimit.3:56
10318 msgid "Return the limit on the size of a file, in units of 512 bytes."
10319 msgstr ""
10320
10321 #. type: TP
10322 #: build/C/man3/ulimit.3:56
10323 #, no-wrap
10324 msgid "B<UL_SETFSIZE>"
10325 msgstr ""
10326
10327 #. type: Plain text
10328 #: build/C/man3/ulimit.3:59
10329 msgid "Set the limit on the size of a file."
10330 msgstr ""
10331
10332 #. type: TP
10333 #: build/C/man3/ulimit.3:59
10334 #, no-wrap
10335 msgid "B<3>"
10336 msgstr ""
10337
10338 #. type: Plain text
10339 #: build/C/man3/ulimit.3:63
10340 msgid ""
10341 "(Not implemented for Linux.)  Return the maximum possible address of the "
10342 "data segment."
10343 msgstr ""
10344
10345 #. type: TP
10346 #: build/C/man3/ulimit.3:63
10347 #, no-wrap
10348 msgid "B<4>"
10349 msgstr ""
10350
10351 #. type: Plain text
10352 #: build/C/man3/ulimit.3:67
10353 msgid ""
10354 "(Implemented but no symbolic constant provided.)  Return the maximum number "
10355 "of files that the calling process can open."
10356 msgstr ""
10357
10358 #. type: Plain text
10359 #: build/C/man3/ulimit.3:74
10360 msgid ""
10361 "On success, B<ulimit>()  returns a nonnegative value.  On error, -1 is "
10362 "returned, and I<errno> is set appropriately."
10363 msgstr ""
10364
10365 #. type: Plain text
10366 #: build/C/man3/ulimit.3:78
10367 msgid "A unprivileged process tried to increase a limit."
10368 msgstr ""
10369
10370 #. type: Plain text
10371 #: build/C/man3/ulimit.3:83
10372 msgid "SVr4, POSIX.1-2001.  POSIX.1-2008 marks B<ulimit>()  as obsolete."
10373 msgstr ""
10374
10375 #. type: Plain text
10376 #: build/C/man3/ulimit.3:88
10377 msgid "B<bash>(1), B<getrlimit>(2), B<setrlimit>(2), B<sysconf>(3)"
10378 msgstr ""
10379
10380 #. type: TH
10381 #: build/C/man7/user_namespaces.7:27
10382 #, no-wrap
10383 msgid "USER_NAMESPACES"
10384 msgstr ""
10385
10386 #. type: Plain text
10387 #: build/C/man7/user_namespaces.7:30
10388 msgid "user_namespaces - overview of Linux user namespaces"
10389 msgstr ""
10390
10391 #.  FIXME: This page says very little about the interaction
10392 #.  of user namespaces and keys. Add something on this topic.
10393 #
10394 #.  ============================================================
10395 #. type: Plain text
10396 #: build/C/man7/user_namespaces.7:56
10397 msgid ""
10398 "User namespaces isolate security-related identifiers and attributes, in "
10399 "particular, user IDs and group IDs (see B<credentials>(7)), the root "
10400 "directory, keys (see B<keyctl>(2)), and capabilities (see "
10401 "B<capabilities>(7)).  A process's user and group IDs can be different inside "
10402 "and outside a user namespace.  In particular, a process can have a normal "
10403 "unprivileged user ID outside a user namespace while at the same time having "
10404 "a user ID of 0 inside the namespace; in other words, the process has full "
10405 "privileges for operations inside the user namespace, but is unprivileged for "
10406 "operations outside the namespace."
10407 msgstr ""
10408
10409 #. type: SS
10410 #: build/C/man7/user_namespaces.7:56
10411 #, no-wrap
10412 msgid "Nested namespaces, namespace membership"
10413 msgstr ""
10414
10415 #. type: Plain text
10416 #: build/C/man7/user_namespaces.7:69
10417 msgid ""
10418 "User namespaces can be nested; that is, each user namespace\\(emexcept the "
10419 "initial (\"root\")  namespace\\(emhas a parent user namespace, and can have "
10420 "zero or more child user namespaces.  The parent user namespace is the user "
10421 "namespace of the process that creates the user namespace via a call to "
10422 "B<unshare>(2)  or B<clone>(2)  with the B<CLONE_NEWUSER> flag."
10423 msgstr ""
10424
10425 #.  commit 8742f229b635bf1c1c84a3dfe5e47c814c20b5c8
10426 #.  FIXME Explain the rationale for this limit. (What is the rationale?)
10427 #. type: Plain text
10428 #: build/C/man7/user_namespaces.7:80
10429 msgid ""
10430 "The kernel imposes (since version 3.11) a limit of 32 nested levels of user "
10431 "namespaces.  Calls to B<unshare>(2)  or B<clone>(2)  that would cause this "
10432 "limit to be exceeded fail with the error B<EUSERS>."
10433 msgstr ""
10434
10435 #. type: Plain text
10436 #: build/C/man7/user_namespaces.7:95
10437 msgid ""
10438 "Each process is a member of exactly one user namespace.  A process created "
10439 "via B<fork>(2)  or B<clone>(2)  without the B<CLONE_NEWUSER> flag is a "
10440 "member of the same user namespace as its parent.  A single-threaded process "
10441 "can join another user namespace with B<setns>(2)  if it has the "
10442 "B<CAP_SYS_ADMIN> in that namespace; upon doing so, it gains a full set of "
10443 "capabilities in that namespace."
10444 msgstr ""
10445
10446 #
10447 #.  ============================================================
10448 #. type: Plain text
10449 #: build/C/man7/user_namespaces.7:110
10450 msgid ""
10451 "A call to B<clone>(2)  or B<unshare>(2)  with the B<CLONE_NEWUSER> flag "
10452 "makes the new child process (for B<clone>(2))  or the caller (for "
10453 "B<unshare>(2))  a member of the new user namespace created by the call."
10454 msgstr ""
10455
10456 #. type: SS
10457 #: build/C/man7/user_namespaces.7:110
10458 #, no-wrap
10459 msgid "Capabilities"
10460 msgstr ""
10461
10462 #. type: Plain text
10463 #: build/C/man7/user_namespaces.7:132
10464 msgid ""
10465 "The child process created by B<clone>(2)  with the B<CLONE_NEWUSER> flag "
10466 "starts out with a complete set of capabilities in the new user namespace.  "
10467 "Likewise, a process that creates a new user namespace using B<unshare>(2)  "
10468 "or joins an existing user namespace using B<setns>(2)  gains a full set of "
10469 "capabilities in that namespace.  On the other hand, that process has no "
10470 "capabilities in the parent (in the case of B<clone>(2))  or previous (in the "
10471 "case of B<unshare>(2)  and B<setns>(2))  user namespace, even if the new "
10472 "namespace is created or joined by the root user (i.e., a process with user "
10473 "ID 0 in the root namespace)."
10474 msgstr ""
10475
10476 #. type: Plain text
10477 #: build/C/man7/user_namespaces.7:142
10478 msgid ""
10479 "Note that a call to B<execve>(2)  will cause a process's capabilities to be "
10480 "recalculated in the usual way (see B<capabilities>(7)), so that usually, "
10481 "unless it has a user ID of 0 within the namespace or the executable file has "
10482 "a nonempty inheritable capabilities mask, it will lose all capabilities.  "
10483 "See the discussion of user and group ID mappings, below."
10484 msgstr ""
10485
10486 #. type: Plain text
10487 #: build/C/man7/user_namespaces.7:167
10488 msgid ""
10489 "A call to B<clone>(2), B<unshare>(2), or B<setns>(2)  using the "
10490 "B<CLONE_NEWUSER> flag sets the \"securebits\" flags (see B<capabilities>(7))  "
10491 "to their default values (all flags disabled) in the child (for B<clone>(2))  "
10492 "or caller (for B<unshare>(2), or B<setns>(2)).  Note that because the caller "
10493 "no longer has capabilities in its original user namespace after a call to "
10494 "B<setns>(2), it is not possible for a process to reset its \"securebits\" "
10495 "flags while retaining its user namespace membership by using a pair of "
10496 "B<setns>(2)  calls to move to another user namespace and then return to its "
10497 "original user namespace."
10498 msgstr ""
10499
10500 #. type: Plain text
10501 #: build/C/man7/user_namespaces.7:173
10502 msgid ""
10503 "Having a capability inside a user namespace permits a process to perform "
10504 "operations (that require privilege)  only on resources governed by that "
10505 "namespace.  The rules for determining whether or not a process has a "
10506 "capability in a particular user namespace are as follows:"
10507 msgstr ""
10508
10509 #.  In the 3.8 sources, see security/commoncap.c::cap_capable():
10510 #. type: Plain text
10511 #: build/C/man7/user_namespaces.7:189
10512 msgid ""
10513 "A process has a capability inside a user namespace if it is a member of that "
10514 "namespace and it has the capability in its effective capability set.  A "
10515 "process can gain capabilities in its effective capability set in various "
10516 "ways.  For example, it may execute a set-user-ID program or an executable "
10517 "with associated file capabilities.  In addition, a process may gain "
10518 "capabilities via the effect of B<clone>(2), B<unshare>(2), or B<setns>(2), "
10519 "as already described."
10520 msgstr ""
10521
10522 #. type: Plain text
10523 #: build/C/man7/user_namespaces.7:193
10524 msgid ""
10525 "If a process has a capability in a user namespace, then it has that "
10526 "capability in all child (and further removed descendant)  namespaces as "
10527 "well."
10528 msgstr ""
10529
10530 #.  * The owner of the user namespace in the parent of the
10531 #.  * user namespace has all caps.
10532 #.  (and likewise associates the effective group ID of the creating process
10533 #.  with the namespace).
10534 #.  See kernel commit 520d9eabce18edfef76a60b7b839d54facafe1f9 for a fix
10535 #.  on this point
10536 #.      This includes the case where the process executes a set-user-ID
10537 #.      program that confers the effective UID of the creator of the namespace.
10538 #
10539 #.  ============================================================
10540 #. type: Plain text
10541 #: build/C/man7/user_namespaces.7:214
10542 msgid ""
10543 "When a user namespace is created, the kernel records the effective user ID "
10544 "of the creating process as being the \"owner\" of the namespace.  A process "
10545 "that resides in the parent of the user namespace and whose effective user ID "
10546 "matches the owner of the namespace has all capabilities in the namespace.  "
10547 "By virtue of the previous rule, this means that the process has all "
10548 "capabilities in all further removed descendant user namespaces as well."
10549 msgstr ""
10550
10551 #. type: SS
10552 #: build/C/man7/user_namespaces.7:214
10553 #, no-wrap
10554 msgid "Interaction of user namespaces and other types of namespaces"
10555 msgstr ""
10556
10557 #. type: Plain text
10558 #: build/C/man7/user_namespaces.7:219
10559 msgid ""
10560 "Starting in Linux 3.8, unprivileged processes can create user namespaces, "
10561 "and mount, PID, IPC, network, and UTS namespaces can be created with just "
10562 "the B<CAP_SYS_ADMIN> capability in the caller's user namespace."
10563 msgstr ""
10564
10565 #. type: Plain text
10566 #: build/C/man7/user_namespaces.7:225
10567 msgid ""
10568 "When a non-user-namespace is created, it is owned by the user namespace in "
10569 "which the creating process was a member at the time of the creation of the "
10570 "namespace.  Actions on the non-user-namespace require capabilities in the "
10571 "corresponding user namespace."
10572 msgstr ""
10573
10574 #. type: Plain text
10575 #: build/C/man7/user_namespaces.7:242
10576 msgid ""
10577 "If B<CLONE_NEWUSER> is specified along with other B<CLONE_NEW*> flags in a "
10578 "single B<clone>(2)  or B<unshare>(2)  call, the user namespace is guaranteed "
10579 "to be created first, giving the child (B<clone>(2))  or caller "
10580 "(B<unshare>(2))  privileges over the remaining namespaces created by the "
10581 "call.  Thus, it is possible for an unprivileged caller to specify this "
10582 "combination of flags."
10583 msgstr ""
10584
10585 #
10586 #.  ============================================================
10587 #. type: Plain text
10588 #: build/C/man7/user_namespaces.7:258
10589 msgid ""
10590 "When a new IPC, mount, network, PID, or UTS namespace is created via "
10591 "B<clone>(2)  or B<unshare>(2), the kernel records the user namespace of the "
10592 "creating process against the new namespace.  (This association can't be "
10593 "changed.)  When a process in the new namespace subsequently performs "
10594 "privileged operations that operate on global resources isolated by the "
10595 "namespace, the permission checks are performed according to the process's "
10596 "capabilities in the user namespace that the kernel associated with the new "
10597 "namespace."
10598 msgstr ""
10599
10600 #. type: SS
10601 #: build/C/man7/user_namespaces.7:258
10602 #, no-wrap
10603 msgid "Restrictions on mount namespaces"
10604 msgstr ""
10605
10606 #. type: Plain text
10607 #: build/C/man7/user_namespaces.7:261
10608 msgid "Note the following points with respect to mount namespaces:"
10609 msgstr ""
10610
10611 #. type: Plain text
10612 #: build/C/man7/user_namespaces.7:266
10613 msgid ""
10614 "A mount namespace has an owner user namespace.  A mount namespace whose "
10615 "owner user namespace is different from the owner user namespace of its "
10616 "parent mount namespace is considered a less privileged mount namespace."
10617 msgstr ""
10618
10619 #. type: Plain text
10620 #: build/C/man7/user_namespaces.7:272
10621 msgid ""
10622 "When creating a less privileged mount namespace, shared mounts are reduced "
10623 "to slave mounts.  This ensures that mappings performed in less privileged "
10624 "mount namespaces will not propagate to more privileged mount namespaces."
10625 msgstr ""
10626
10627 #.  FIXME .
10628 #.      What does "come as a single unit from more privileged mount" mean?
10629 #. type: Plain text
10630 #: build/C/man7/user_namespaces.7:285
10631 msgid ""
10632 "Mounts that come as a single unit from more privileged mount are locked "
10633 "together and may not be separated in a less privileged mount namespace.  "
10634 "(The B<unshare>(2)  B<CLONE_NEWNS> operation brings across all of the mounts "
10635 "from the original mount namespace as a single unit, and recursive mounts "
10636 "that propagate between mount namespaces propagate as a single unit.)"
10637 msgstr ""
10638
10639 #.  commit 9566d6742852c527bf5af38af5cbb878dad75705
10640 #.  Author: Eric W. Biederman <ebiederm@xmission.com>
10641 #.  Date:   Mon Jul 28 17:26:07 2014 -0700
10642 #
10643 #.       mnt: Correct permission checks in do_remount
10644 #. type: Plain text
10645 #: build/C/man7/user_namespaces.7:306
10646 msgid ""
10647 "The B<mount>(2)  flags B<MS_RDONLY>, B<MS_NOSUID>, B<MS_NOEXEC>, and the "
10648 "\"atime\" flags (B<MS_NOATIME>, B<MS_NODIRATIME>, B<MS_RELATIME>)  settings "
10649 "become locked when propagated from a more privileged to a less privileged "
10650 "mount namespace, and may not be changed in the less privileged mount "
10651 "namespace."
10652 msgstr ""
10653
10654 #.  (As of 3.18-rc1 (in Al Viro's 2014-08-30 vfs.git#for-next tree))
10655 #. type: Plain text
10656 #: build/C/man7/user_namespaces.7:313
10657 msgid ""
10658 "A file or directory that is a mount point in one namespace that is not a "
10659 "mount point in another namespace, may be renamed, unlinked, or removed "
10660 "(B<rmdir>(2))  in the mount namespace in which it is not a mount point "
10661 "(subject to the usual permission checks)."
10662 msgstr ""
10663
10664 #
10665 #.  ============================================================
10666 #. type: Plain text
10667 #: build/C/man7/user_namespaces.7:324
10668 msgid ""
10669 "Previously, attempting to unlink, rename, or remove a file or directory that "
10670 "was a mount point in another mount namespace would result in the error "
10671 "B<EBUSY>.  That behavior had technical problems of enforcement (e.g., for "
10672 "NFS)  and permitted denial-of-service attacks against more privileged "
10673 "users.  (i.e., preventing individual files from being updated by bind "
10674 "mounting on top of them)."
10675 msgstr ""
10676
10677 #. type: SS
10678 #: build/C/man7/user_namespaces.7:324
10679 #, no-wrap
10680 msgid "User and group ID mappings: uid_map and gid_map"
10681 msgstr ""
10682
10683 #.  commit 22d917d80e842829d0ca0a561967d728eb1d6303
10684 #. type: Plain text
10685 #: build/C/man7/user_namespaces.7:339
10686 msgid ""
10687 "When a user namespace is created, it starts out without a mapping of user "
10688 "IDs (group IDs)  to the parent user namespace.  The I</proc/[pid]/uid_map> "
10689 "and I</proc/[pid]/gid_map> files (available since Linux 3.5)  expose the "
10690 "mappings for user and group IDs inside the user namespace for the process "
10691 "I<pid>.  These files can be read to view the mappings in a user namespace "
10692 "and written to (once) to define the mappings."
10693 msgstr ""
10694
10695 #. type: Plain text
10696 #: build/C/man7/user_namespaces.7:345
10697 msgid ""
10698 "The description in the following paragraphs explains the details for "
10699 "I<uid_map>; I<gid_map> is exactly the same, but each instance of \"user ID\" "
10700 "is replaced by \"group ID\"."
10701 msgstr ""
10702
10703 #. type: Plain text
10704 #: build/C/man7/user_namespaces.7:359
10705 msgid ""
10706 "The I<uid_map> file exposes the mapping of user IDs from the user namespace "
10707 "of the process I<pid> to the user namespace of the process that opened "
10708 "I<uid_map> (but see a qualification to this point below).  In other words, "
10709 "processes that are in different user namespaces will potentially see "
10710 "different values when reading from a particular I<uid_map> file, depending "
10711 "on the user ID mappings for the user namespaces of the reading processes."
10712 msgstr ""
10713
10714 #. type: Plain text
10715 #: build/C/man7/user_namespaces.7:371
10716 msgid ""
10717 "Each line in the I<uid_map> file specifies a 1-to-1 mapping of a range of "
10718 "contiguous user IDs between two user namespaces.  (When a user namespace is "
10719 "first created, this file is empty.)  The specification in each line takes "
10720 "the form of three numbers delimited by white space.  The first two numbers "
10721 "specify the starting user ID in each of the two user namespaces.  The third "
10722 "number specifies the length of the mapped range.  In detail, the fields are "
10723 "interpreted as follows:"
10724 msgstr ""
10725
10726 #. type: Plain text
10727 #: build/C/man7/user_namespaces.7:375
10728 msgid ""
10729 "The start of the range of user IDs in the user namespace of the process "
10730 "I<pid>."
10731 msgstr ""
10732
10733 #. type: Plain text
10734 #: build/C/man7/user_namespaces.7:383
10735 msgid ""
10736 "The start of the range of user IDs to which the user IDs specified by field "
10737 "one map.  How field two is interpreted depends on whether the process that "
10738 "opened I<uid_map> and the process I<pid> are in the same user namespace, as "
10739 "follows:"
10740 msgstr ""
10741
10742 #. type: Plain text
10743 #: build/C/man7/user_namespaces.7:389
10744 msgid ""
10745 "If the two processes are in different user namespaces: field two is the "
10746 "start of a range of user IDs in the user namespace of the process that "
10747 "opened I<uid_map>."
10748 msgstr ""
10749
10750 #. type: Plain text
10751 #: build/C/man7/user_namespaces.7:400
10752 msgid ""
10753 "If the two processes are in the same user namespace: field two is the start "
10754 "of the range of user IDs in the parent user namespace of the process "
10755 "I<pid>.  This case enables the opener of I<uid_map> (the common case here is "
10756 "opening I</proc/self/uid_map>)  to see the mapping of user IDs into the user "
10757 "namespace of the process that created this user namespace."
10758 msgstr ""
10759
10760 #. type: Plain text
10761 #: build/C/man7/user_namespaces.7:404
10762 msgid ""
10763 "The length of the range of user IDs that is mapped between the two user "
10764 "namespaces."
10765 msgstr ""
10766
10767 #. type: Plain text
10768 #: build/C/man7/user_namespaces.7:411
10769 msgid ""
10770 "System calls that return user IDs (group IDs)\\(emfor example, B<getuid>(2), "
10771 "B<getgid>(2), and the credential fields in the structure returned by "
10772 "B<stat>(2)\\(emreturn the user ID (group ID) mapped into the caller's user "
10773 "namespace."
10774 msgstr ""
10775
10776 #. type: Plain text
10777 #: build/C/man7/user_namespaces.7:419
10778 msgid ""
10779 "When a process accesses a file, its user and group IDs are mapped into the "
10780 "initial user namespace for the purpose of permission checking and assigning "
10781 "IDs when creating a file.  When a process retrieves file user and group IDs "
10782 "via B<stat>(2), the IDs are mapped in the opposite direction, to produce "
10783 "values relative to the process user and group ID mappings."
10784 msgstr ""
10785
10786 #. type: Plain text
10787 #: build/C/man7/user_namespaces.7:428
10788 msgid ""
10789 "The initial user namespace has no parent namespace, but, for consistency, "
10790 "the kernel provides dummy user and group ID mapping files for this "
10791 "namespace.  Looking at the I<uid_map> file (I<gid_map> is the same) from a "
10792 "shell in the initial namespace shows:"
10793 msgstr ""
10794
10795 #. type: Plain text
10796 #: build/C/man7/user_namespaces.7:433
10797 #, no-wrap
10798 msgid ""
10799 "$ B<cat /proc/$$/uid_map>\n"
10800 "         0          0 4294967295\n"
10801 msgstr ""
10802
10803 #
10804 #.  ============================================================
10805 #. type: Plain text
10806 #: build/C/man7/user_namespaces.7:453
10807 msgid ""
10808 "This mapping tells us that the range starting at user ID 0 in this namespace "
10809 "maps to a range starting at 0 in the (nonexistent) parent namespace, and the "
10810 "length of the range is the largest 32-bit unsigned integer.  (This "
10811 "deliberately leaves 4294967295 (the 32-bit signed -1 value) unmapped.  This "
10812 "is deliberate: I<(uid_t)\\ -\\1> is used in several interfaces (e.g., "
10813 "B<setreuid>(2))  as a way to specify \"no user ID\".  Leaving I<(uid_t)\\ "
10814 "-\\1> unmapped and unusable guarantees that there will be no confusion when "
10815 "using these interfaces."
10816 msgstr ""
10817
10818 #. type: SS
10819 #: build/C/man7/user_namespaces.7:453
10820 #, no-wrap
10821 msgid "Defining user and group ID mappings: writing to uid_map and gid_map"
10822 msgstr ""
10823
10824 #. type: Plain text
10825 #: build/C/man7/user_namespaces.7:469
10826 msgid ""
10827 "After the creation of a new user namespace, the I<uid_map> file of I<one> of "
10828 "the processes in the namespace may be written to I<once> to define the "
10829 "mapping of user IDs in the new user namespace.  An attempt to write more "
10830 "than once to a I<uid_map> file in a user namespace fails with the error "
10831 "B<EPERM>.  Similar rules apply for I<gid_map> files."
10832 msgstr ""
10833
10834 #. type: Plain text
10835 #: build/C/man7/user_namespaces.7:474
10836 msgid ""
10837 "The lines written to I<uid_map> (I<gid_map>)  must conform to the following "
10838 "rules:"
10839 msgstr ""
10840
10841 #. type: Plain text
10842 #: build/C/man7/user_namespaces.7:477
10843 msgid ""
10844 "The three fields must be valid numbers, and the last field must be greater "
10845 "than 0."
10846 msgstr ""
10847
10848 #. type: Plain text
10849 #: build/C/man7/user_namespaces.7:479
10850 msgid "Lines are terminated by newline characters."
10851 msgstr ""
10852
10853 #.  FIXME(Eric): the restriction "less than" rather than "less than or equal"
10854 #.  seems strangely arbitrary. Furthermore, the comment does not agree
10855 #.  with the code in kernel/user_namespace.c. Which is correct?
10856 #. type: Plain text
10857 #: build/C/man7/user_namespaces.7:492
10858 msgid ""
10859 "There is an (arbitrary) limit on the number of lines in the file.  As at "
10860 "Linux 3.8, the limit is five lines.  In addition, the number of bytes "
10861 "written to the file must be less than the system page size, and the write "
10862 "must be performed at the start of the file (i.e., B<lseek>(2)  and "
10863 "B<pwrite>(2)  can't be used to write to nonzero offsets in the file)."
10864 msgstr ""
10865
10866 #.  commit 0bd14b4fd72afd5df41e9fd59f356740f22fceba
10867 #. type: Plain text
10868 #: build/C/man7/user_namespaces.7:505
10869 msgid ""
10870 "The range of user IDs (group IDs)  specified in each line cannot overlap "
10871 "with the ranges in any other lines.  In the initial implementation (Linux "
10872 "3.8), this requirement was satisfied by a simplistic implementation that "
10873 "imposed the further requirement that the values in both field 1 and field 2 "
10874 "of successive lines must be in ascending numerical order, which prevented "
10875 "some otherwise valid maps from being created.  Linux 3.9 and later fix this "
10876 "limitation, allowing any valid set of nonoverlapping maps."
10877 msgstr ""
10878
10879 #. type: Plain text
10880 #: build/C/man7/user_namespaces.7:507
10881 msgid "At least one line must be written to the file."
10882 msgstr ""
10883
10884 #. type: Plain text
10885 #: build/C/man7/user_namespaces.7:510
10886 msgid "Writes that violate the above rules fail with the error B<EINVAL>."
10887 msgstr ""
10888
10889 #. type: Plain text
10890 #: build/C/man7/user_namespaces.7:515
10891 msgid ""
10892 "In order for a process to write to the I</proc/[pid]/uid_map> "
10893 "(I</proc/[pid]/gid_map>)  file, all of the following requirements must be "
10894 "met:"
10895 msgstr ""
10896
10897 #. type: Plain text
10898 #: build/C/man7/user_namespaces.7:521
10899 msgid ""
10900 "The writing process must have the B<CAP_SETUID> (B<CAP_SETGID>)  capability "
10901 "in the user namespace of the process I<pid>."
10902 msgstr ""
10903
10904 #. type: Plain text
10905 #: build/C/man7/user_namespaces.7:526
10906 msgid ""
10907 "The writing process must be in either the user namespace of the process "
10908 "I<pid> or inside the parent user namespace of the process I<pid>."
10909 msgstr ""
10910
10911 #. type: Plain text
10912 #: build/C/man7/user_namespaces.7:529
10913 msgid ""
10914 "The mapped user IDs (group IDs) must in turn have a mapping in the parent "
10915 "user namespace."
10916 msgstr ""
10917
10918 #. type: Plain text
10919 #: build/C/man7/user_namespaces.7:531
10920 msgid "One of the following is true:"
10921 msgstr ""
10922
10923 #. type: Plain text
10924 #: build/C/man7/user_namespaces.7:541
10925 msgid ""
10926 "The data written to I<uid_map> (I<gid_map>)  consists of a single line that "
10927 "maps the writing process's filesystem user ID (group ID) in the parent user "
10928 "namespace to a user ID (group ID)  in the user namespace.  The usual case "
10929 "here is that this single line provides a mapping for user ID of the process "
10930 "that created the namespace."
10931 msgstr ""
10932
10933 #. type: Plain text
10934 #: build/C/man7/user_namespaces.7:548
10935 msgid ""
10936 "The opening process has the B<CAP_SETUID> (B<CAP_SETGID>)  capability in the "
10937 "parent user namespace.  Thus, a privileged process can make mappings to "
10938 "arbitrary user IDs (group IDs)  in the parent user namespace."
10939 msgstr ""
10940
10941 #
10942 #.  ============================================================
10943 #. type: Plain text
10944 #: build/C/man7/user_namespaces.7:555
10945 msgid "Writes that violate the above rules fail with the error B<EPERM>."
10946 msgstr ""
10947
10948 #. type: SS
10949 #: build/C/man7/user_namespaces.7:555
10950 #, no-wrap
10951 msgid "Unmapped user and group IDs"
10952 msgstr ""
10953
10954 #.  from_kuid_munged(), from_kgid_munged()
10955 #. type: Plain text
10956 #: build/C/man7/user_namespaces.7:572
10957 msgid ""
10958 "There are various places where an unmapped user ID (group ID)  may be "
10959 "exposed to user space.  For example, the first process in a new user "
10960 "namespace may call B<getuid>()  before a user ID mapping has been defined "
10961 "for the namespace.  In most such cases, an unmapped user ID is converted to "
10962 "the overflow user ID (group ID); the default value for the overflow user ID "
10963 "(group ID) is 65534.  See the descriptions of "
10964 "I</proc/sys/kernel/overflowuid> and I</proc/sys/kernel/overflowgid> in "
10965 "B<proc>(5)."
10966 msgstr ""
10967
10968 #.  also SO_PEERCRED
10969 #. type: Plain text
10970 #: build/C/man7/user_namespaces.7:600
10971 msgid ""
10972 "The cases where unmapped IDs are mapped in this fashion include system calls "
10973 "that return user IDs (B<getuid>(2), B<getgid>(2), and similar), credentials "
10974 "passed over a UNIX domain socket, credentials returned by B<stat>(2), "
10975 "B<waitid>(2), and the System V IPC \"ctl\" B<IPC_STAT> operations, "
10976 "credentials exposed by I</proc/PID/status> and the files in "
10977 "I</proc/sysvipc/*>, credentials returned via the I<si_uid> field in the "
10978 "I<siginfo_t> received with a signal (see B<sigaction>(2)), credentials "
10979 "written to the process accounting file (see B<acct>(5)), and credentials "
10980 "returned with POSIX message queue notifications (see B<mq_notify>(3))."
10981 msgstr ""
10982
10983 #.  from_kuid(), from_kgid()
10984 #.  Also F_GETOWNER_UIDS is an exception
10985 #
10986 #.  ============================================================
10987 #. type: Plain text
10988 #: build/C/man7/user_namespaces.7:615
10989 msgid ""
10990 "There is one notable case where unmapped user and group IDs are I<not> "
10991 "converted to the corresponding overflow ID value.  When viewing a I<uid_map> "
10992 "or I<gid_map> file in which there is no mapping for the second field, that "
10993 "field is displayed as 4294967295 (-1 as an unsigned integer);"
10994 msgstr ""
10995
10996 #. type: SS
10997 #: build/C/man7/user_namespaces.7:615
10998 #, no-wrap
10999 msgid "Set-user-ID and set-group-ID programs"
11000 msgstr ""
11001
11002 #
11003 #.  ============================================================
11004 #. type: Plain text
11005 #: build/C/man7/user_namespaces.7:635
11006 msgid ""
11007 "When a process inside a user namespace executes a set-user-ID (set-group-ID) "
11008 "program, the process's effective user (group) ID inside the namespace is "
11009 "changed to whatever value is mapped for the user (group) ID of the file.  "
11010 "However, if either the user I<or> the group ID of the file has no mapping "
11011 "inside the namespace, the set-user-ID (set-group-ID) bit is silently "
11012 "ignored: the new program is executed, but the process's effective user "
11013 "(group) ID is left unchanged.  (This mirrors the semantics of executing a "
11014 "set-user-ID or set-group-ID program that resides on a filesystem that was "
11015 "mounted with the B<MS_NOSUID> flag, as described in B<mount>(2).)"
11016 msgstr ""
11017
11018 #. type: Plain text
11019 #: build/C/man7/user_namespaces.7:645
11020 msgid ""
11021 "When a process's user and group IDs are passed over a UNIX domain socket to "
11022 "a process in a different user namespace (see the description of "
11023 "B<SCM_CREDENTIALS> in B<unix>(7)), they are translated into the "
11024 "corresponding values as per the receiving process's user and group ID "
11025 "mappings."
11026 msgstr ""
11027
11028 #
11029 #.  ============================================================
11030 #. type: Plain text
11031 #: build/C/man7/user_namespaces.7:658
11032 msgid ""
11033 "Over the years, there have been a lot of features that have been added to "
11034 "the Linux kernel that have been made available only to privileged users "
11035 "because of their potential to confuse set-user-ID-root applications.  In "
11036 "general, it becomes safe to allow the root user in a user namespace to use "
11037 "those features because it is impossible, while in a user namespace, to gain "
11038 "more privilege than the root user of a user namespace has."
11039 msgstr ""
11040
11041 #. type: SS
11042 #: build/C/man7/user_namespaces.7:658
11043 #, no-wrap
11044 msgid "Availability"
11045 msgstr ""
11046
11047 #. type: Plain text
11048 #: build/C/man7/user_namespaces.7:666
11049 msgid ""
11050 "Use of user namespaces requires a kernel that is configured with the "
11051 "B<CONFIG_USER_NS> option.  User namespaces require support in a range of "
11052 "subsystems across the kernel.  When an unsupported subsystem is configured "
11053 "into the kernel, it is not possible to configure user namespaces support."
11054 msgstr ""
11055
11056 #.  commit d6970d4b726cea6d7a9bc4120814f95c09571fc3
11057 #. type: Plain text
11058 #: build/C/man7/user_namespaces.7:677
11059 msgid ""
11060 "As at Linux 3.8, most relevant subsystems supported user namespaces, but a "
11061 "number of filesystems did not have the infrastructure needed to map user and "
11062 "group IDs between user namespaces.  Linux 3.9 added the required "
11063 "infrastructure support for many of the remaining unsupported filesystems "
11064 "(Plan 9 (9P), Andrew File System (AFS), Ceph, CIFS, CODA, NFS, and OCFS2).  "
11065 "Linux 3.11 added support the last of the unsupported major filesystems, XFS."
11066 msgstr ""
11067
11068 #. type: Plain text
11069 #: build/C/man7/user_namespaces.7:686
11070 msgid ""
11071 "The program below is designed to allow experimenting with user namespaces, "
11072 "as well as other types of namespaces.  It creates namespaces as specified by "
11073 "command-line options and then executes a command inside those namespaces.  "
11074 "The comments and I<usage()> function inside the program provide a full "
11075 "explanation of the program.  The following shell session demonstrates its "
11076 "use."
11077 msgstr ""
11078
11079 #. type: Plain text
11080 #: build/C/man7/user_namespaces.7:688
11081 msgid "First, we look at the run-time environment:"
11082 msgstr ""
11083
11084 #. type: Plain text
11085 #: build/C/man7/user_namespaces.7:697
11086 #, no-wrap
11087 msgid ""
11088 "$ B<uname -rs>     # Need Linux 3.8 or later\n"
11089 "Linux 3.8.0\n"
11090 "$ B<id -u>         # Running as unprivileged user\n"
11091 "1000\n"
11092 "$ B<id -g>\n"
11093 "1000\n"
11094 msgstr ""
11095
11096 #. type: Plain text
11097 #: build/C/man7/user_namespaces.7:711
11098 msgid ""
11099 "Now start a new shell in new user (I<-U>), mount (I<-m>), and PID (I<-p>)  "
11100 "namespaces, with user ID (I<-M>)  and group ID (I<-G>)  1000 mapped to 0 "
11101 "inside the user namespace:"
11102 msgstr ""
11103
11104 #. type: Plain text
11105 #: build/C/man7/user_namespaces.7:715
11106 #, no-wrap
11107 msgid "$ B<./userns_child_exec -p -m -U -M '0 1000 1' -G '0 1000 1' bash>\n"
11108 msgstr ""
11109
11110 #. type: Plain text
11111 #: build/C/man7/user_namespaces.7:720
11112 msgid ""
11113 "The shell has PID 1, because it is the first process in the new PID "
11114 "namespace:"
11115 msgstr ""
11116
11117 #. type: Plain text
11118 #: build/C/man7/user_namespaces.7:725
11119 #, no-wrap
11120 msgid ""
11121 "bash$ B<echo $$>\n"
11122 "1\n"
11123 msgstr ""
11124
11125 #. type: Plain text
11126 #: build/C/man7/user_namespaces.7:730
11127 msgid ""
11128 "Inside the user namespace, the shell has user and group ID 0, and a full set "
11129 "of permitted and effective capabilities:"
11130 msgstr ""
11131
11132 #. type: Plain text
11133 #: build/C/man7/user_namespaces.7:740
11134 #, no-wrap
11135 msgid ""
11136 "bash$ B<cat /proc/$$/status | egrep '^[UG]id'>\n"
11137 "Uid:\t0\t0\t0\t0\n"
11138 "Gid:\t0\t0\t0\t0\n"
11139 "bash$ B<cat /proc/$$/status | egrep '^Cap(Prm|Inh|Eff)'>\n"
11140 "CapInh:\t0000000000000000\n"
11141 "CapPrm:\t0000001fffffffff\n"
11142 "CapEff:\t0000001fffffffff\n"
11143 msgstr ""
11144
11145 #. type: Plain text
11146 #: build/C/man7/user_namespaces.7:748
11147 msgid ""
11148 "Mounting a new I</proc> filesystem and listing all of the processes visible "
11149 "in the new PID namespace shows that the shell can't see any processes "
11150 "outside the PID namespace:"
11151 msgstr ""
11152
11153 #. type: Plain text
11154 #: build/C/man7/user_namespaces.7:756
11155 #, no-wrap
11156 msgid ""
11157 "bash$ B<mount -t proc proc /proc>\n"
11158 "bash$ B<ps ax>\n"
11159 "  PID TTY      STAT   TIME COMMAND\n"
11160 "    1 pts/3    S      0:00 bash\n"
11161 "   22 pts/3    R+     0:00 ps ax\n"
11162 msgstr ""
11163
11164 #. type: SS
11165 #: build/C/man7/user_namespaces.7:758 build/C/man2/seccomp.2:574
11166 #, no-wrap
11167 msgid "Program source"
11168 msgstr ""
11169
11170 #. type: Plain text
11171 #: build/C/man7/user_namespaces.7:762
11172 #, no-wrap
11173 msgid "/* userns_child_exec.c\n"
11174 msgstr ""
11175
11176 #. type: Plain text
11177 #: build/C/man7/user_namespaces.7:764
11178 #, no-wrap
11179 msgid "   Licensed under GNU General Public License v2 or later\n"
11180 msgstr ""
11181
11182 #. type: Plain text
11183 #: build/C/man7/user_namespaces.7:780
11184 #, no-wrap
11185 msgid ""
11186 "   Create a child process that executes a shell command in new\n"
11187 "   namespace(s); allow UID and GID mappings to be specified when\n"
11188 "   creating a user namespace.\n"
11189 "*/\n"
11190 "#define _GNU_SOURCE\n"
11191 "#include E<lt>sched.hE<gt>\n"
11192 "#include E<lt>unistd.hE<gt>\n"
11193 "#include E<lt>stdlib.hE<gt>\n"
11194 "#include E<lt>sys/wait.hE<gt>\n"
11195 "#include E<lt>signal.hE<gt>\n"
11196 "#include E<lt>fcntl.hE<gt>\n"
11197 "#include E<lt>stdio.hE<gt>\n"
11198 "#include E<lt>string.hE<gt>\n"
11199 "#include E<lt>limits.hE<gt>\n"
11200 "#include E<lt>errno.hE<gt>\n"
11201 msgstr ""
11202
11203 #. type: Plain text
11204 #: build/C/man7/user_namespaces.7:783
11205 #, no-wrap
11206 msgid ""
11207 "/* A simple error-handling function: print an error message based\n"
11208 "   on the value in \\(aqerrno\\(aq and terminate the calling process */\n"
11209 msgstr ""
11210
11211 #. type: Plain text
11212 #: build/C/man7/user_namespaces.7:786
11213 #, no-wrap
11214 msgid ""
11215 "#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\e\n"
11216 "                        } while (0)\n"
11217 msgstr ""
11218
11219 #. type: Plain text
11220 #: build/C/man7/user_namespaces.7:791
11221 #, no-wrap
11222 msgid ""
11223 "struct child_args {\n"
11224 "    char **argv;        /* Command to be executed by child, with args */\n"
11225 "    int    pipe_fd[2];  /* Pipe used to synchronize parent and child */\n"
11226 "};\n"
11227 msgstr ""
11228
11229 #. type: Plain text
11230 #: build/C/man7/user_namespaces.7:793
11231 #, no-wrap
11232 msgid "static int verbose;\n"
11233 msgstr ""
11234
11235 #. type: Plain text
11236 #: build/C/man7/user_namespaces.7:826
11237 #, no-wrap
11238 msgid ""
11239 "static void\n"
11240 "usage(char *pname)\n"
11241 "{\n"
11242 "    fprintf(stderr, \"Usage: %s [options] cmd [arg...]\\en\\en\", pname);\n"
11243 "    fprintf(stderr, \"Create a child process that executes a shell \"\n"
11244 "            \"command in a new user namespace,\\en\"\n"
11245 "            \"and possibly also other new namespace(s).\\en\\en\");\n"
11246 "    fprintf(stderr, \"Options can be:\\en\\en\");\n"
11247 "#define fpe(str) fprintf(stderr, \"    %s\", str);\n"
11248 "    fpe(\"-i          New IPC namespace\\en\");\n"
11249 "    fpe(\"-m          New mount namespace\\en\");\n"
11250 "    fpe(\"-n          New network namespace\\en\");\n"
11251 "    fpe(\"-p          New PID namespace\\en\");\n"
11252 "    fpe(\"-u          New UTS namespace\\en\");\n"
11253 "    fpe(\"-U          New user namespace\\en\");\n"
11254 "    fpe(\"-M uid_map  Specify UID map for user namespace\\en\");\n"
11255 "    fpe(\"-G gid_map  Specify GID map for user namespace\\en\");\n"
11256 "    fpe(\"-z          Map user\\(aqs UID and GID to 0 in user "
11257 "namespace\\en\");\n"
11258 "    fpe(\"            (equivalent to: -M \\(aq0 E<lt>uidE<gt> 1\\(aq -G "
11259 "\\(aq0 E<lt>gidE<gt> 1\\(aq)\\en\");\n"
11260 "    fpe(\"-v          Display verbose messages\\en\");\n"
11261 "    fpe(\"\\en\");\n"
11262 "    fpe(\"If -z, -M, or -G is specified, -U is required.\\en\");\n"
11263 "    fpe(\"It is not permitted to specify both -z and either -M or "
11264 "-G.\\en\");\n"
11265 "    fpe(\"\\en\");\n"
11266 "    fpe(\"Map strings for -M and -G consist of records of the "
11267 "form:\\en\");\n"
11268 "    fpe(\"\\en\");\n"
11269 "    fpe(\"    ID-inside-ns   ID-outside-ns   len\\en\");\n"
11270 "    fpe(\"\\en\");\n"
11271 "    fpe(\"A map string can contain multiple records, separated\"\n"
11272 "        \" by commas;\\en\");\n"
11273 "    fpe(\"the commas are replaced by newlines before writing\"\n"
11274 "        \" to map files.\\en\");\n"
11275 msgstr ""
11276
11277 #. type: Plain text
11278 #: build/C/man7/user_namespaces.7:834
11279 #, no-wrap
11280 msgid ""
11281 "/* Update the mapping file \\(aqmap_file\\(aq, with the value provided in\n"
11282 "   \\(aqmapping\\(aq, a string that defines a UID or GID mapping. A UID or\n"
11283 "   GID mapping consists of one or more newline-delimited records\n"
11284 "   of the form:\n"
11285 msgstr ""
11286
11287 #. type: Plain text
11288 #: build/C/man7/user_namespaces.7:836
11289 #, no-wrap
11290 msgid "       ID_inside-ns    ID-outside-ns   length\n"
11291 msgstr ""
11292
11293 #. type: Plain text
11294 #: build/C/man7/user_namespaces.7:841
11295 #, no-wrap
11296 msgid ""
11297 "   Requiring the user to supply a string that contains newlines is\n"
11298 "   of course inconvenient for command-line use. Thus, we permit the\n"
11299 "   use of commas to delimit records in this string, and replace them\n"
11300 "   with newlines before writing the string to the file. */\n"
11301 msgstr ""
11302
11303 #. type: Plain text
11304 #: build/C/man7/user_namespaces.7:847
11305 #, no-wrap
11306 msgid ""
11307 "static void\n"
11308 "update_map(char *mapping, char *map_file)\n"
11309 "{\n"
11310 "    int fd, j;\n"
11311 "    size_t map_len;     /* Length of \\(aqmapping\\(aq */\n"
11312 msgstr ""
11313
11314 #. type: Plain text
11315 #: build/C/man7/user_namespaces.7:849
11316 #, no-wrap
11317 msgid "    /* Replace commas in mapping string with newlines */\n"
11318 msgstr ""
11319
11320 #. type: Plain text
11321 #: build/C/man7/user_namespaces.7:854
11322 #, no-wrap
11323 msgid ""
11324 "    map_len = strlen(mapping);\n"
11325 "    for (j = 0; j E<lt> map_len; j++)\n"
11326 "        if (mapping[j] == \\(aq,\\(aq)\n"
11327 "            mapping[j] = \\(aq\\en\\(aq;\n"
11328 msgstr ""
11329
11330 #. type: Plain text
11331 #: build/C/man7/user_namespaces.7:861
11332 #, no-wrap
11333 msgid ""
11334 "    fd = open(map_file, O_RDWR);\n"
11335 "    if (fd == -1) {\n"
11336 "        fprintf(stderr, \"ERROR: open %s: %s\\en\", map_file,\n"
11337 "                strerror(errno));\n"
11338 "        exit(EXIT_FAILURE);\n"
11339 "    }\n"
11340 msgstr ""
11341
11342 #. type: Plain text
11343 #: build/C/man7/user_namespaces.7:867
11344 #, no-wrap
11345 msgid ""
11346 "    if (write(fd, mapping, map_len) != map_len) {\n"
11347 "        fprintf(stderr, \"ERROR: write %s: %s\\en\", map_file,\n"
11348 "                strerror(errno));\n"
11349 "        exit(EXIT_FAILURE);\n"
11350 "    }\n"
11351 msgstr ""
11352
11353 #. type: Plain text
11354 #: build/C/man7/user_namespaces.7:870
11355 #, no-wrap
11356 msgid ""
11357 "    close(fd);\n"
11358 "}\n"
11359 msgstr ""
11360
11361 #. type: Plain text
11362 #: build/C/man7/user_namespaces.7:876
11363 #, no-wrap
11364 msgid ""
11365 "static int              /* Start function for cloned child */\n"
11366 "childFunc(void *arg)\n"
11367 "{\n"
11368 "    struct child_args *args = (struct child_args *) arg;\n"
11369 "    char ch;\n"
11370 msgstr ""
11371
11372 #. type: Plain text
11373 #: build/C/man7/user_namespaces.7:881
11374 #, no-wrap
11375 msgid ""
11376 "    /* Wait until the parent has updated the UID and GID mappings.\n"
11377 "       See the comment in main(). We wait for end of file on a\n"
11378 "       pipe that will be closed by the parent process once it has\n"
11379 "       updated the mappings. */\n"
11380 msgstr ""
11381
11382 #. type: Plain text
11383 #: build/C/man7/user_namespaces.7:890
11384 #, no-wrap
11385 msgid ""
11386 "    close(args-E<gt>pipe_fd[1]);    /* Close our descriptor for the write\n"
11387 "                                   end of the pipe so that we see EOF\n"
11388 "                                   when parent closes its descriptor */\n"
11389 "    if (read(args-E<gt>pipe_fd[0], &ch, 1) != 0) {\n"
11390 "        fprintf(stderr,\n"
11391 "                \"Failure in child: read from pipe returned != 0\\en\");\n"
11392 "        exit(EXIT_FAILURE);\n"
11393 "    }\n"
11394 msgstr ""
11395
11396 #. type: Plain text
11397 #: build/C/man7/user_namespaces.7:892
11398 #, no-wrap
11399 msgid "    /* Execute a shell command */\n"
11400 msgstr ""
11401
11402 #. type: Plain text
11403 #: build/C/man7/user_namespaces.7:897
11404 #, no-wrap
11405 msgid ""
11406 "    printf(\"About to exec %s\\en\", args-E<gt>argv[0]);\n"
11407 "    execvp(args-E<gt>argv[0], args-E<gt>argv);\n"
11408 "    errExit(\"execvp\");\n"
11409 "}\n"
11410 msgstr ""
11411
11412 #. type: Plain text
11413 #: build/C/man7/user_namespaces.7:899
11414 #, no-wrap
11415 msgid "#define STACK_SIZE (1024 * 1024)\n"
11416 msgstr ""
11417
11418 #. type: Plain text
11419 #: build/C/man7/user_namespaces.7:901
11420 #, no-wrap
11421 msgid "static char child_stack[STACK_SIZE];    /* Space for child\\(aqs stack */\n"
11422 msgstr ""
11423
11424 #. type: Plain text
11425 #: build/C/man7/user_namespaces.7:912
11426 #, no-wrap
11427 msgid ""
11428 "int\n"
11429 "main(int argc, char *argv[])\n"
11430 "{\n"
11431 "    int flags, opt, map_zero;\n"
11432 "    pid_t child_pid;\n"
11433 "    struct child_args args;\n"
11434 "    char *uid_map, *gid_map;\n"
11435 "    const int MAP_BUF_SIZE = 100;\n"
11436 "    char map_buf[MAP_BUF_SIZE];\n"
11437 "    char map_path[PATH_MAX];\n"
11438 msgstr ""
11439
11440 #. type: Plain text
11441 #: build/C/man7/user_namespaces.7:919
11442 #, no-wrap
11443 msgid ""
11444 "    /* Parse command-line options. The initial \\(aq+\\(aq character in\n"
11445 "       the final getopt() argument prevents GNU-style permutation\n"
11446 "       of command-line options. That\\(aqs useful, since sometimes\n"
11447 "       the \\(aqcommand\\(aq to be executed by this program itself\n"
11448 "       has command-line options. We don\\(aqt want getopt() to treat\n"
11449 "       those as options to this program. */\n"
11450 msgstr ""
11451
11452 #. type: Plain text
11453 #: build/C/man7/user_namespaces.7:940
11454 #, no-wrap
11455 msgid ""
11456 "    flags = 0;\n"
11457 "    verbose = 0;\n"
11458 "    gid_map = NULL;\n"
11459 "    uid_map = NULL;\n"
11460 "    map_zero = 0;\n"
11461 "    while ((opt = getopt(argc, argv, \"+imnpuUM:G:zv\")) != -1) {\n"
11462 "        switch (opt) {\n"
11463 "        case \\(aqi\\(aq: flags |= CLONE_NEWIPC;        break;\n"
11464 "        case \\(aqm\\(aq: flags |= CLONE_NEWNS;         break;\n"
11465 "        case \\(aqn\\(aq: flags |= CLONE_NEWNET;        break;\n"
11466 "        case \\(aqp\\(aq: flags |= CLONE_NEWPID;        break;\n"
11467 "        case \\(aqu\\(aq: flags |= CLONE_NEWUTS;        break;\n"
11468 "        case \\(aqv\\(aq: verbose = 1;                  break;\n"
11469 "        case \\(aqz\\(aq: map_zero = 1;                 break;\n"
11470 "        case \\(aqM\\(aq: uid_map = optarg;             break;\n"
11471 "        case \\(aqG\\(aq: gid_map = optarg;             break;\n"
11472 "        case \\(aqU\\(aq: flags |= CLONE_NEWUSER;       break;\n"
11473 "        default:  usage(argv[0]);\n"
11474 "        }\n"
11475 "    }\n"
11476 msgstr ""
11477
11478 #. type: Plain text
11479 #: build/C/man7/user_namespaces.7:942
11480 #, no-wrap
11481 msgid "    /* -M or -G without -U is nonsensical */\n"
11482 msgstr ""
11483
11484 #. type: Plain text
11485 #: build/C/man7/user_namespaces.7:947
11486 #, no-wrap
11487 msgid ""
11488 "    if (((uid_map != NULL || gid_map != NULL || map_zero) &&\n"
11489 "                !(flags & CLONE_NEWUSER)) ||\n"
11490 "            (map_zero && (uid_map != NULL || gid_map != NULL)))\n"
11491 "        usage(argv[0]);\n"
11492 msgstr ""
11493
11494 #. type: Plain text
11495 #: build/C/man7/user_namespaces.7:949
11496 #, no-wrap
11497 msgid "    args.argv = &argv[optind];\n"
11498 msgstr ""
11499
11500 #. type: Plain text
11501 #: build/C/man7/user_namespaces.7:959
11502 #, no-wrap
11503 msgid ""
11504 "    /* We use a pipe to synchronize the parent and child, in order to\n"
11505 "       ensure that the parent sets the UID and GID maps before the child\n"
11506 "       calls execve(). This ensures that the child maintains its\n"
11507 "       capabilities during the execve() in the common case where we\n"
11508 "       want to map the child\\(aqs effective user ID to 0 in the new user\n"
11509 "       namespace. Without this synchronization, the child would lose\n"
11510 "       its capabilities if it performed an execve() with nonzero\n"
11511 "       user IDs (see the capabilities(7) man page for details of the\n"
11512 "       transformation of a process\\(aqs capabilities during execve()). */\n"
11513 msgstr ""
11514
11515 #. type: Plain text
11516 #: build/C/man7/user_namespaces.7:962
11517 #, no-wrap
11518 msgid ""
11519 "    if (pipe(args.pipe_fd) == -1)\n"
11520 "        errExit(\"pipe\");\n"
11521 msgstr ""
11522
11523 #. type: Plain text
11524 #: build/C/man7/user_namespaces.7:964
11525 #, no-wrap
11526 msgid "    /* Create the child in new namespace(s) */\n"
11527 msgstr ""
11528
11529 #. type: Plain text
11530 #: build/C/man7/user_namespaces.7:969
11531 #, no-wrap
11532 msgid ""
11533 "    child_pid = clone(childFunc, child_stack + STACK_SIZE,\n"
11534 "                      flags | SIGCHLD, &args);\n"
11535 "    if (child_pid == -1)\n"
11536 "        errExit(\"clone\");\n"
11537 msgstr ""
11538
11539 #. type: Plain text
11540 #: build/C/man7/user_namespaces.7:971
11541 #, no-wrap
11542 msgid "    /* Parent falls through to here */\n"
11543 msgstr ""
11544
11545 #. type: Plain text
11546 #: build/C/man7/user_namespaces.7:975
11547 #, no-wrap
11548 msgid ""
11549 "    if (verbose)\n"
11550 "        printf(\"%s: PID of child created by clone() is %ld\\en\",\n"
11551 "                argv[0], (long) child_pid);\n"
11552 msgstr ""
11553
11554 #. type: Plain text
11555 #: build/C/man7/user_namespaces.7:977
11556 #, no-wrap
11557 msgid "    /* Update the UID and GID maps in the child */\n"
11558 msgstr ""
11559
11560 #. type: Plain text
11561 #: build/C/man7/user_namespaces.7:996
11562 #, no-wrap
11563 msgid ""
11564 "    if (uid_map != NULL || map_zero) {\n"
11565 "        snprintf(map_path, PATH_MAX, \"/proc/%ld/uid_map\",\n"
11566 "                (long) child_pid);\n"
11567 "        if (map_zero) {\n"
11568 "            snprintf(map_buf, MAP_BUF_SIZE, \"0 %ld 1\", (long) getuid());\n"
11569 "            uid_map = map_buf;\n"
11570 "        }\n"
11571 "        update_map(uid_map, map_path);\n"
11572 "    }\n"
11573 "    if (gid_map != NULL || map_zero) {\n"
11574 "        snprintf(map_path, PATH_MAX, \"/proc/%ld/gid_map\",\n"
11575 "                (long) child_pid);\n"
11576 "        if (map_zero) {\n"
11577 "            snprintf(map_buf, MAP_BUF_SIZE, \"0 %ld 1\", (long) getgid());\n"
11578 "            gid_map = map_buf;\n"
11579 "        }\n"
11580 "        update_map(gid_map, map_path);\n"
11581 "    }\n"
11582 msgstr ""
11583
11584 #. type: Plain text
11585 #: build/C/man7/user_namespaces.7:999
11586 #, no-wrap
11587 msgid ""
11588 "    /* Close the write end of the pipe, to signal to the child that we\n"
11589 "       have updated the UID and GID maps */\n"
11590 msgstr ""
11591
11592 #. type: Plain text
11593 #: build/C/man7/user_namespaces.7:1001
11594 #, no-wrap
11595 msgid "    close(args.pipe_fd[1]);\n"
11596 msgstr ""
11597
11598 #. type: Plain text
11599 #: build/C/man7/user_namespaces.7:1004
11600 #, no-wrap
11601 msgid ""
11602 "    if (waitpid(child_pid, NULL, 0) == -1)      /* Wait for child */\n"
11603 "        errExit(\"waitpid\");\n"
11604 msgstr ""
11605
11606 #. type: Plain text
11607 #: build/C/man7/user_namespaces.7:1007
11608 #, no-wrap
11609 msgid ""
11610 "    if (verbose)\n"
11611 "        printf(\"%s: terminating\\en\", argv[0]);\n"
11612 msgstr ""
11613
11614 #. type: Plain text
11615 #: build/C/man7/user_namespaces.7:1010
11616 #, no-wrap
11617 msgid ""
11618 "    exit(EXIT_SUCCESS);\n"
11619 "}\n"
11620 msgstr ""
11621
11622 #.  From the shadow package
11623 #.  From the shadow package
11624 #.  From the shadow package
11625 #.  From the shadow package
11626 #. type: Plain text
11627 #: build/C/man7/user_namespaces.7:1024
11628 msgid ""
11629 "B<newgidmap>(1), B<newuidmap>(1), B<clone>(2), B<setns>(2), B<unshare>(2), "
11630 "B<proc>(5), B<subgid>(5), B<subuid>(5), B<credentials>(7), "
11631 "B<capabilities>(7), B<namespaces>(7), B<pid_namespaces>(7)"
11632 msgstr ""
11633
11634 #. type: Plain text
11635 #: build/C/man7/user_namespaces.7:1027
11636 msgid "The kernel source file I<Documentation/namespaces/resource-control.txt>."
11637 msgstr ""
11638
11639 #. type: TH
11640 #: build/C/man2/seccomp.2:27
11641 #, no-wrap
11642 msgid "SECCOMP"
11643 msgstr ""
11644
11645 #. type: Plain text
11646 #: build/C/man2/seccomp.2:30
11647 msgid "seccomp - operate on Secure Computing state of the process"
11648 msgstr ""
11649
11650 #.  Kees Cook noted: Anything that uses SECCOMP_RET_TRACE returns will
11651 #.                   need <sys/ptrace.h>
11652 #. type: Plain text
11653 #: build/C/man2/seccomp.2:39
11654 #, no-wrap
11655 msgid ""
11656 "B<#include E<lt>linux/seccomp.hE<gt>>\n"
11657 "B<#include E<lt>linux/filter.hE<gt>>\n"
11658 "B<#include E<lt>linux/audit.hE<gt>>\n"
11659 "B<#include E<lt>linux/signal.hE<gt>>\n"
11660 "B<#include E<lt>sys/ptrace.hE<gt>>\n"
11661 msgstr ""
11662
11663 #. type: Plain text
11664 #: build/C/man2/seccomp.2:42
11665 #, no-wrap
11666 msgid ""
11667 "B<int seccomp(unsigned int >I<operation>B<, unsigned int >I<flags>B<, void "
11668 "*>I<args>B<);>\n"
11669 msgstr ""
11670
11671 #. type: Plain text
11672 #: build/C/man2/seccomp.2:48
11673 msgid ""
11674 "The B<seccomp>()  system call operates on the Secure Computing (seccomp) "
11675 "state of the calling process."
11676 msgstr ""
11677
11678 #. type: Plain text
11679 #: build/C/man2/seccomp.2:52
11680 msgid "Currently, Linux supports the following I<operation> values:"
11681 msgstr ""
11682
11683 #. type: TP
11684 #: build/C/man2/seccomp.2:52
11685 #, no-wrap
11686 msgid "B<SECCOMP_SET_MODE_STRICT>"
11687 msgstr ""
11688
11689 #. type: Plain text
11690 #: build/C/man2/seccomp.2:66
11691 msgid ""
11692 "The only system calls that the calling thread is permitted to make are "
11693 "B<read>(2), B<write>(2), B<_exit>(2), and B<sigreturn>(2).  Other system "
11694 "calls result in the delivery of a B<SIGKILL> signal.  Strict secure "
11695 "computing mode is useful for number-crunching applications that may need to "
11696 "execute untrusted byte code, perhaps obtained by reading from a pipe or "
11697 "socket."
11698 msgstr ""
11699
11700 #. type: Plain text
11701 #: build/C/man2/seccomp.2:70
11702 msgid ""
11703 "This operation is available only if the kernel is configured with "
11704 "B<CONFIG_SECCOMP> enabled."
11705 msgstr ""
11706
11707 #. type: Plain text
11708 #: build/C/man2/seccomp.2:76
11709 msgid "The value of I<flags> must be 0, and I<args> must be NULL."
11710 msgstr ""
11711
11712 #. type: Plain text
11713 #: build/C/man2/seccomp.2:78
11714 msgid "This operation is functionally identical to the call:"
11715 msgstr ""
11716
11717 #. type: Plain text
11718 #: build/C/man2/seccomp.2:80
11719 #, no-wrap
11720 msgid "    prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT);\n"
11721 msgstr ""
11722
11723 #. type: TP
11724 #: build/C/man2/seccomp.2:80
11725 #, no-wrap
11726 msgid "B<SECCOMP_SET_MODE_FILTER>"
11727 msgstr ""
11728
11729 #. type: Plain text
11730 #: build/C/man2/seccomp.2:95
11731 msgid ""
11732 "The system calls allowed are defined by a pointer to a Berkeley Packet "
11733 "Filter (BPF) passed via I<args>.  This argument is a pointer to a I<struct\\ "
11734 "sock_fprog>; it can be designed to filter arbitrary system calls and system "
11735 "call arguments.  If the filter is invalid, B<seccomp>()  fails, returning "
11736 "B<EINVAL> in I<errno>."
11737 msgstr ""
11738
11739 #. type: Plain text
11740 #: build/C/man2/seccomp.2:107
11741 msgid ""
11742 "If B<fork>(2)  or B<clone>(2)  is allowed by the filter, any child processes "
11743 "will be constrained to the same system call filters as the parent.  If "
11744 "B<execve>(2)  is allowed, the existing filters will be preserved across a "
11745 "call to B<execve>(2)."
11746 msgstr ""
11747
11748 #. type: Plain text
11749 #: build/C/man2/seccomp.2:117
11750 msgid ""
11751 "In order to use the B<SECCOMP_SET_MODE_FILTER> operation, either the caller "
11752 "must have the B<CAP_SYS_ADMIN> capability, or the thread must already have "
11753 "the I<no_new_privs> bit set.  If that bit was not already set by an ancestor "
11754 "of this thread, the thread must make the following call:"
11755 msgstr ""
11756
11757 #. type: Plain text
11758 #: build/C/man2/seccomp.2:119
11759 #, no-wrap
11760 msgid "    prctl(PR_SET_NO_NEW_PRIVS, 1);\n"
11761 msgstr ""
11762
11763 #. type: Plain text
11764 #: build/C/man2/seccomp.2:138
11765 msgid ""
11766 "Otherwise, the B<SECCOMP_SET_MODE_FILTER> operation will fail and return "
11767 "B<EACCES> in I<errno>.  This requirement ensures that an unprivileged "
11768 "process cannot apply a malicious filter and then invoke a set-user-ID or "
11769 "other privileged program using B<execve>(2), thus potentially compromising "
11770 "that program.  (Such a malicious filter might, for example, cause an attempt "
11771 "to use B<setuid>(2)  to set the caller's user IDs to non-zero values to "
11772 "instead return 0 without actually making the system call.  Thus, the program "
11773 "might be tricked into retaining superuser privileges in circumstances where "
11774 "it is possible to influence it to do dangerous things because it did not "
11775 "actually drop privileges.)"
11776 msgstr ""
11777
11778 #. type: Plain text
11779 #: build/C/man2/seccomp.2:146
11780 msgid ""
11781 "If B<prctl>(2)  or B<seccomp>(2)  is allowed by the attached filter, further "
11782 "filters may be added.  This will increase evaluation time, but allows for "
11783 "further reduction of the attack surface during execution of a thread."
11784 msgstr ""
11785
11786 #. type: Plain text
11787 #: build/C/man2/seccomp.2:152
11788 msgid ""
11789 "The B<SECCOMP_SET_MODE_FILTER> operation is available only if the kernel is "
11790 "configured with B<CONFIG_SECCOMP_FILTER> enabled."
11791 msgstr ""
11792
11793 #. type: Plain text
11794 #: build/C/man2/seccomp.2:156
11795 msgid "When I<flags> is 0, this operation is functionally identical to the call:"
11796 msgstr ""
11797
11798 #. type: Plain text
11799 #: build/C/man2/seccomp.2:158
11800 #, no-wrap
11801 msgid "    prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, args);\n"
11802 msgstr ""
11803
11804 #. type: Plain text
11805 #: build/C/man2/seccomp.2:162
11806 msgid "The recognized I<flags> are:"
11807 msgstr ""
11808
11809 #. type: TP
11810 #: build/C/man2/seccomp.2:163
11811 #, no-wrap
11812 msgid "B<SECCOMP_FILTER_FLAG_TSYNC>"
11813 msgstr ""
11814
11815 #. type: Plain text
11816 #: build/C/man2/seccomp.2:171
11817 msgid ""
11818 "When adding a new filter, synchronize all other threads of the calling "
11819 "process to the same seccomp filter tree.  A \"filter tree\" is the ordered "
11820 "list of filters attached to a thread.  (Attaching identical filters in "
11821 "separate B<seccomp>()  calls results in different filters from this "
11822 "perspective.)"
11823 msgstr ""
11824
11825 #. type: Plain text
11826 #: build/C/man2/seccomp.2:179
11827 msgid ""
11828 "If any thread cannot synchronize to the same filter tree, the call will not "
11829 "attach the new seccomp filter, and will fail, returning the first thread ID "
11830 "found that cannot synchronize.  Synchronization will fail if another thread "
11831 "in the same process is in B<SECCOMP_MODE_STRICT> or if it has attached new "
11832 "seccomp filters to itself, diverging from the calling thread's filter tree."
11833 msgstr ""
11834
11835 #. type: SS
11836 #: build/C/man2/seccomp.2:180
11837 #, no-wrap
11838 msgid "Filters"
11839 msgstr ""
11840
11841 #. type: Plain text
11842 #: build/C/man2/seccomp.2:185
11843 msgid ""
11844 "When adding filters via B<SECCOMP_SET_MODE_FILTER>, I<args> points to a "
11845 "filter program:"
11846 msgstr ""
11847
11848 #. type: Plain text
11849 #: build/C/man2/seccomp.2:193
11850 #, no-wrap
11851 msgid ""
11852 "struct sock_fprog {\n"
11853 "    unsigned short      len;    /* Number of BPF instructions */\n"
11854 "    struct sock_filter *filter; /* Pointer to array of\n"
11855 "                                   BPF instructions */\n"
11856 "};\n"
11857 msgstr ""
11858
11859 #. type: Plain text
11860 #: build/C/man2/seccomp.2:197
11861 msgid "Each program must contain one or more BPF instructions:"
11862 msgstr ""
11863
11864 #. type: Plain text
11865 #: build/C/man2/seccomp.2:206
11866 #, no-wrap
11867 msgid ""
11868 "struct sock_filter {            /* Filter block */\n"
11869 "    __u16 code;                 /* Actual filter code */\n"
11870 "    __u8  jt;                   /* Jump true */\n"
11871 "    __u8  jf;                   /* Jump false */\n"
11872 "    __u32 k;                    /* Generic multiuse field */\n"
11873 "};\n"
11874 msgstr ""
11875
11876 #. type: Plain text
11877 #: build/C/man2/seccomp.2:213
11878 msgid ""
11879 "When executing the instructions, the BPF program operates on the system call "
11880 "information made available (i.e., use the B<BPF_ABS> addressing mode) as a "
11881 "buffer of the following form:"
11882 msgstr ""
11883
11884 #. type: Plain text
11885 #: build/C/man2/seccomp.2:223
11886 #, no-wrap
11887 msgid ""
11888 "struct seccomp_data {\n"
11889 "    int   nr;                   /* System call number */\n"
11890 "    __u32 arch;                 /* AUDIT_ARCH_* value\n"
11891 "                                   (see E<lt>linux/audit.hE<gt>) */\n"
11892 "    __u64 instruction_pointer;  /* CPU instruction pointer */\n"
11893 "    __u64 args[6];              /* Up to 6 system call arguments */\n"
11894 "};\n"
11895 msgstr ""
11896
11897 #. type: Plain text
11898 #: build/C/man2/seccomp.2:234
11899 msgid ""
11900 "A seccomp filter returns a 32-bit value consisting of two parts: the most "
11901 "significant 16 bits (corresponding to the mask defined by the constant "
11902 "B<SECCOMP_RET_ACTION>)  contain one of the \"action\" values listed below; "
11903 "the least significant 16-bits (defined by the constant B<SECCOMP_RET_DATA>)  "
11904 "are \"data\" to be associated with this return value."
11905 msgstr ""
11906
11907 #. type: Plain text
11908 #: build/C/man2/seccomp.2:242
11909 msgid ""
11910 "If multiple filters exist, they are all executed, in reverse order of their "
11911 "addition to the filter tree (i.e., the most recently installed filter is "
11912 "executed first).  The return value for the evaluation of a given system call "
11913 "is the first-seen B<SECCOMP_RET_ACTION> value of highest precedence (along "
11914 "with its accompanying data)  returned by execution of all of the filters."
11915 msgstr ""
11916
11917 #. type: Plain text
11918 #: build/C/man2/seccomp.2:245
11919 msgid ""
11920 "In decreasing order of precedence, the values that may be returned by a "
11921 "seccomp filter are:"
11922 msgstr ""
11923
11924 #. type: TP
11925 #: build/C/man2/seccomp.2:245
11926 #, no-wrap
11927 msgid "B<SECCOMP_RET_KILL>"
11928 msgstr ""
11929
11930 #. type: Plain text
11931 #: build/C/man2/seccomp.2:254
11932 msgid ""
11933 "This value results in the process exiting immediately without executing the "
11934 "system call.  The process terminates as though killed by a B<SIGSYS> signal "
11935 "(I<not> B<SIGKILL>)."
11936 msgstr ""
11937
11938 #. type: TP
11939 #: build/C/man2/seccomp.2:254
11940 #, no-wrap
11941 msgid "B<SECCOMP_RET_TRAP>"
11942 msgstr ""
11943
11944 #. type: Plain text
11945 #: build/C/man2/seccomp.2:264
11946 msgid ""
11947 "This value results in the kernel sending a B<SIGSYS> signal to the "
11948 "triggering process without executing the system call.  Various fields will "
11949 "be set in the I<siginfo_t> structure (see B<sigaction>(2))  associated with "
11950 "signal:"
11951 msgstr ""
11952
11953 #. type: Plain text
11954 #: build/C/man2/seccomp.2:269
11955 msgid "I<si_signo> will contain B<SIGSYS>."
11956 msgstr ""
11957
11958 #. type: Plain text
11959 #: build/C/man2/seccomp.2:272
11960 msgid "I<si_call_addr> will show the address of the system call instruction."
11961 msgstr ""
11962
11963 #. type: Plain text
11964 #: build/C/man2/seccomp.2:277
11965 msgid "I<si_syscall> and I<si_arch> will indicate which system call was attempted."
11966 msgstr ""
11967
11968 #. type: Plain text
11969 #: build/C/man2/seccomp.2:281
11970 msgid "I<si_code> will contain B<SYS_SECCOMP>."
11971 msgstr ""
11972
11973 #. type: Plain text
11974 #: build/C/man2/seccomp.2:286
11975 msgid ""
11976 "I<si_errno> will contain the B<SECCOMP_RET_DATA> portion of the filter "
11977 "return value."
11978 msgstr ""
11979
11980 #. type: Plain text
11981 #: build/C/man2/seccomp.2:295
11982 msgid ""
11983 "The program counter will be as though the system call happened (i.e., it "
11984 "will not point to the system call instruction).  The return value register "
11985 "will contain an architecture-dependent value; if resuming execution, set it "
11986 "to something appropriate for the system call.  (The architecture dependency "
11987 "is because replacing it with B<ENOSYS> could overwrite some useful "
11988 "information.)"
11989 msgstr ""
11990
11991 #. type: TP
11992 #: build/C/man2/seccomp.2:295
11993 #, no-wrap
11994 msgid "B<SECCOMP_RET_ERRNO>"
11995 msgstr ""
11996
11997 #. type: Plain text
11998 #: build/C/man2/seccomp.2:302
11999 msgid ""
12000 "This value results in the B<SECCOMP_RET_DATA> portion of the filter's return "
12001 "value being passed to user space as the I<errno> value without executing the "
12002 "system call."
12003 msgstr ""
12004
12005 #. type: TP
12006 #: build/C/man2/seccomp.2:302
12007 #, no-wrap
12008 msgid "B<SECCOMP_RET_TRACE>"
12009 msgstr ""
12010
12011 #. type: Plain text
12012 #: build/C/man2/seccomp.2:312
12013 msgid ""
12014 "When returned, this value will cause the kernel to attempt to notify a "
12015 "B<ptrace>(2)-based tracer prior to executing the system call.  If there is "
12016 "no tracer present, the system call is not executed and returns a failure "
12017 "status with I<errno> set to B<ENOSYS>."
12018 msgstr ""
12019
12020 #. type: Plain text
12021 #: build/C/man2/seccomp.2:323
12022 msgid ""
12023 "A tracer will be notified if it requests B<PTRACE_O_TRACESECCOMP> using "
12024 "I<ptrace(PTRACE_SETOPTIONS)>.  The tracer will be notified of a "
12025 "B<PTRACE_EVENT_SECCOMP> and the B<SECCOMP_RET_DATA> portion of the filter's "
12026 "return value will be available to the tracer via B<PTRACE_GETEVENTMSG>."
12027 msgstr ""
12028
12029 #. type: Plain text
12030 #: build/C/man2/seccomp.2:330
12031 msgid ""
12032 "The tracer can skip the system call by changing the system call number to "
12033 "-1.  Alternatively, the tracer can change the system call requested by "
12034 "changing the system call to a valid system call number.  If the tracer asks "
12035 "to skip the system call, then the system call will appear to return the "
12036 "value that the tracer puts in the return value register."
12037 msgstr ""
12038
12039 #. type: Plain text
12040 #: build/C/man2/seccomp.2:339
12041 msgid ""
12042 "The seccomp check will not be run again after the tracer is notified.  (This "
12043 "means that seccomp-based sandboxes B<must not> allow use of "
12044 "B<ptrace>(2)\\(emeven of other sandboxed processes\\(emwithout extreme care; "
12045 "ptracers can use this mechanism to escape from the seccomp sandbox.)"
12046 msgstr ""
12047
12048 #. type: TP
12049 #: build/C/man2/seccomp.2:339
12050 #, no-wrap
12051 msgid "B<SECCOMP_RET_ALLOW>"
12052 msgstr ""
12053
12054 #. type: Plain text
12055 #: build/C/man2/seccomp.2:342
12056 msgid "This value results in the system call being executed."
12057 msgstr ""
12058
12059 #. type: Plain text
12060 #: build/C/man2/seccomp.2:358
12061 msgid ""
12062 "On success, B<seccomp>()  returns 0.  On error, if "
12063 "B<SECCOMP_FILTER_FLAG_TSYNC> was used, the return value is the ID of the "
12064 "thread that caused the synchronization failure.  (This ID is a kernel thread "
12065 "ID of the type returned by B<clone>(2)  and B<gettid>(2).)  On other errors, "
12066 "-1 is returned, and I<errno> is set to indicate the cause of the error."
12067 msgstr ""
12068
12069 #. type: Plain text
12070 #: build/C/man2/seccomp.2:361
12071 msgid "B<seccomp>()  can fail for the following reasons:"
12072 msgstr ""
12073
12074 #. type: TP
12075 #: build/C/man2/seccomp.2:361
12076 #, no-wrap
12077 msgid "B<EACCESS>"
12078 msgstr ""
12079
12080 #. type: Plain text
12081 #: build/C/man2/seccomp.2:369
12082 msgid ""
12083 "The caller did not have the B<CAP_SYS_ADMIN> capability, or had not set "
12084 "I<no_new_privs> before using B<SECCOMP_SET_MODE_FILTER>."
12085 msgstr ""
12086
12087 #. type: Plain text
12088 #: build/C/man2/seccomp.2:373
12089 msgid "I<args> was not a valid address."
12090 msgstr ""
12091
12092 #. type: Plain text
12093 #: build/C/man2/seccomp.2:380
12094 msgid "I<operation> is unknown; or I<flags> are invalid for the given I<operation>."
12095 msgstr ""
12096
12097 #. type: Plain text
12098 #: build/C/man2/seccomp.2:387
12099 msgid ""
12100 "I<operation> included B<BPF_ABS>, but the specified offset was not aligned "
12101 "to a 32-bit boundary or exceeded I<sizeof(struct\\ seccomp_data)>."
12102 msgstr ""
12103
12104 #.  See kernel/seccomp.c::seccomp_may_assign_mode() in 3.18 sources
12105 #. type: Plain text
12106 #: build/C/man2/seccomp.2:393
12107 msgid ""
12108 "A secure computing mode has already been set, and I<operation> differs from "
12109 "the existing setting."
12110 msgstr ""
12111
12112 #.  See stub kernel/seccomp.c::seccomp_set_mode_filter() in 3.18 sources
12113 #. type: Plain text
12114 #: build/C/man2/seccomp.2:402
12115 msgid ""
12116 "I<operation> specified B<SECCOMP_SET_MODE_FILTER>, but the kernel was not "
12117 "built with B<CONFIG_SECCOMP_FILTER> enabled."
12118 msgstr ""
12119
12120 #. type: Plain text
12121 #: build/C/man2/seccomp.2:413
12122 msgid ""
12123 "I<operation> specified B<SECCOMP_SET_MODE_FILTER>, but the filter program "
12124 "pointed to by I<args> was not valid or the length of the filter program was "
12125 "zero or exceeded B<BPF_MAXINSNS> (4096) instructions.  B<EINVAL>"
12126 msgstr ""
12127
12128 #.  ENOMEM in kernel/seccomp.c::seccomp_attach_filter() in 3.18 sources
12129 #. type: Plain text
12130 #: build/C/man2/seccomp.2:426
12131 msgid ""
12132 "The total length of all filter programs attached to the calling thread would "
12133 "exceed B<MAX_INSNS_PER_PATH> (32768) instructions.  Note that for the "
12134 "purposes of calculating this limit, each already existing filter program "
12135 "incurs an overhead penalty of 4 instructions."
12136 msgstr ""
12137
12138 #. type: Plain text
12139 #: build/C/man2/seccomp.2:430
12140 msgid ""
12141 "Another thread caused a failure during thread sync, but its ID could not be "
12142 "determined."
12143 msgstr ""
12144
12145 #.  FIXME . Add glibc version
12146 #. type: Plain text
12147 #: build/C/man2/seccomp.2:435
12148 msgid "The B<seccomp>()  system call first appeared in Linux 3.17."
12149 msgstr ""
12150
12151 #. type: Plain text
12152 #: build/C/man2/seccomp.2:439
12153 msgid "The B<seccomp>()  system call is a nonstandard Linux extension."
12154 msgstr ""
12155
12156 #. type: Plain text
12157 #: build/C/man2/seccomp.2:446
12158 msgid ""
12159 "The I<Seccomp> field of the I</proc/[pid]/status> file provides a method of "
12160 "viewing the seccomp mode of a process; see B<proc>(5)."
12161 msgstr ""
12162
12163 #. type: Plain text
12164 #: build/C/man2/seccomp.2:453
12165 msgid ""
12166 "B<seccomp>()  provides a superset of the functionality provided by the "
12167 "B<prctl>(2)  B<PR_SET_SECCOMP> operation (which does not support I<flags>)."
12168 msgstr ""
12169
12170 #. type: SS
12171 #: build/C/man2/seccomp.2:453
12172 #, no-wrap
12173 msgid "Seccomp-specific BPF details"
12174 msgstr ""
12175
12176 #. type: Plain text
12177 #: build/C/man2/seccomp.2:455
12178 msgid "Note the following BPF details specific to seccomp filters:"
12179 msgstr ""
12180
12181 #. type: Plain text
12182 #: build/C/man2/seccomp.2:463
12183 msgid ""
12184 "The B<BPF_H> and B<BPF_B> size modifiers are not supported: all operations "
12185 "must load and store (4-byte) words (B<BPF_W>)."
12186 msgstr ""
12187
12188 #. type: Plain text
12189 #: build/C/man2/seccomp.2:469
12190 msgid ""
12191 "To access the contents of the I<seccomp_data> buffer, use the B<BPF_ABS> "
12192 "addressing mode modifier."
12193 msgstr ""
12194
12195 #. type: Plain text
12196 #: build/C/man2/seccomp.2:476
12197 msgid ""
12198 "The B<BPF_LEN> addressing mode modifier yields an immediate mode operand "
12199 "whose value is the size of the I<seccomp_data> buffer."
12200 msgstr ""
12201
12202 #. type: Plain text
12203 #: build/C/man2/seccomp.2:482
12204 msgid ""
12205 "The program below accepts four or more arguments.  The first three arguments "
12206 "are a system call number, a numeric architecture identifier, and an error "
12207 "number.  The program uses these values to construct a BPF filter that is "
12208 "used at run time to perform the following checks:"
12209 msgstr ""
12210
12211 #. type: IP
12212 #: build/C/man2/seccomp.2:482
12213 #, no-wrap
12214 msgid "[1]"
12215 msgstr ""
12216
12217 #. type: Plain text
12218 #: build/C/man2/seccomp.2:486
12219 msgid ""
12220 "If the program is not running on the specified architecture, the BPF filter "
12221 "causes system calls to fail with the error B<ENOSYS>."
12222 msgstr ""
12223
12224 #. type: IP
12225 #: build/C/man2/seccomp.2:486
12226 #, no-wrap
12227 msgid "[2]"
12228 msgstr ""
12229
12230 #. type: Plain text
12231 #: build/C/man2/seccomp.2:491
12232 msgid ""
12233 "If the program attempts to execute the system call with the specified "
12234 "number, the BPF filter causes the system call to fail, with I<errno> being "
12235 "set to the specified error number."
12236 msgstr ""
12237
12238 #. type: Plain text
12239 #: build/C/man2/seccomp.2:500
12240 msgid ""
12241 "The remaining command-line arguments specify the pathname and additional "
12242 "arguments of a program that the example program should attempt to execute "
12243 "using B<execve>(3)  (a library function that employs the B<execve>(2)  "
12244 "system call).  Some example runs of the program are shown below."
12245 msgstr ""
12246
12247 #. type: Plain text
12248 #: build/C/man2/seccomp.2:504
12249 msgid ""
12250 "First, we display the architecture that we are running on (x86-64)  and then "
12251 "construct a shell function that looks up system call numbers on this "
12252 "architecture:"
12253 msgstr ""
12254
12255 #. type: Plain text
12256 #: build/C/man2/seccomp.2:513
12257 #, no-wrap
12258 msgid ""
12259 "$ B<uname -m>\n"
12260 "x86_64\n"
12261 "$ B<syscall_nr() {\n"
12262 "    cat /usr/src/linux/arch/x86/syscalls/syscall_64.tbl | \\e\n"
12263 "    awk '$2 != \"x32\" && $3 == \"'$1'\" { print $1 }'\n"
12264 "}>\n"
12265 msgstr ""
12266
12267 #. type: Plain text
12268 #: build/C/man2/seccomp.2:520
12269 msgid ""
12270 "When the BPF filter rejects a system call (case [2] above), it causes the "
12271 "system call to fail with the error number specified on the command line.  In "
12272 "the experiments shown here, we'll use error number 99:"
12273 msgstr ""
12274
12275 #. type: Plain text
12276 #: build/C/man2/seccomp.2:525
12277 #, no-wrap
12278 msgid ""
12279 "$ B<errno 99>\n"
12280 "EADDRNOTAVAIL 99 Cannot assign requested address\n"
12281 msgstr ""
12282
12283 #. type: Plain text
12284 #: build/C/man2/seccomp.2:533
12285 msgid ""
12286 "In the following example, we attempt to run the command B<whoami>(1), but "
12287 "the BPF filter rejects the B<execve>(2)  system call, so that the command is "
12288 "not even executed:"
12289 msgstr ""
12290
12291 #. type: Plain text
12292 #: build/C/man2/seccomp.2:544
12293 #, no-wrap
12294 msgid ""
12295 "$ B<syscall_nr execve>\n"
12296 "59\n"
12297 "$ B<./a.out>\n"
12298 "Usage: ./a.out E<lt>syscall_nrE<gt> E<lt>archE<gt> E<lt>errnoE<gt> "
12299 "E<lt>progE<gt> [E<lt>argsE<gt>]\n"
12300 "Hint for E<lt>archE<gt>: AUDIT_ARCH_I386: 0x40000003\n"
12301 "                 AUDIT_ARCH_X86_64: 0xC000003E\n"
12302 "$ B<./a.out 59 0xC000003E 99 /bin/whoami>\n"
12303 "execv: Cannot assign requested address\n"
12304 msgstr ""
12305
12306 #. type: Plain text
12307 #: build/C/man2/seccomp.2:552
12308 msgid ""
12309 "In the next example, the BPF filter rejects the B<write>(2)  system call, so "
12310 "that, although it is successfully started, the B<whoami>(1)  command is not "
12311 "able to write output:"
12312 msgstr ""
12313
12314 #. type: Plain text
12315 #: build/C/man2/seccomp.2:558
12316 #, no-wrap
12317 msgid ""
12318 "$ B<syscall_nr write>\n"
12319 "1\n"
12320 "$ B<./a.out 1 0xC000003E 99 /bin/whoami>\n"
12321 msgstr ""
12322
12323 #. type: Plain text
12324 #: build/C/man2/seccomp.2:565
12325 msgid ""
12326 "In the final example, the BPF filter rejects a system call that is not used "
12327 "by the B<whoami>(1)  command, so it is able to successfully execute and "
12328 "produce output:"
12329 msgstr ""
12330
12331 #. type: Plain text
12332 #: build/C/man2/seccomp.2:572
12333 #, no-wrap
12334 msgid ""
12335 "$ B<syscall_nr preadv>\n"
12336 "295\n"
12337 "$ B<./a.out 295 0xC000003E 99 /bin/whoami>\n"
12338 "cecilia\n"
12339 msgstr ""
12340
12341 #. type: Plain text
12342 #: build/C/man2/seccomp.2:586
12343 #, no-wrap
12344 msgid ""
12345 "#include E<lt>errno.hE<gt>\n"
12346 "#include E<lt>stddef.hE<gt>\n"
12347 "#include E<lt>stdio.hE<gt>\n"
12348 "#include E<lt>stdlib.hE<gt>\n"
12349 "#include E<lt>unistd.hE<gt>\n"
12350 "#include E<lt>linux/audit.hE<gt>\n"
12351 "#include E<lt>linux/filter.hE<gt>\n"
12352 "#include E<lt>linux/seccomp.hE<gt>\n"
12353 "#include E<lt>sys/prctl.hE<gt>\n"
12354 msgstr ""
12355
12356 #. type: Plain text
12357 #: build/C/man2/seccomp.2:595
12358 #, no-wrap
12359 msgid ""
12360 "static int\n"
12361 "install_filter(int syscall_nr, int t_arch, int f_errno)\n"
12362 "{\n"
12363 "    struct sock_filter filter[] = {\n"
12364 "        /* [0] Load architecture from 'seccomp_data' buffer into\n"
12365 "               accumulator */\n"
12366 "        BPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n"
12367 "                 (offsetof(struct seccomp_data, arch))),\n"
12368 msgstr ""
12369
12370 #. type: Plain text
12371 #: build/C/man2/seccomp.2:599
12372 #, no-wrap
12373 msgid ""
12374 "        /* [1] Jump forward 4 instructions if architecture does not\n"
12375 "               match 't_arch' */\n"
12376 "        BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, t_arch, 0, 4),\n"
12377 msgstr ""
12378
12379 #. type: Plain text
12380 #: build/C/man2/seccomp.2:604
12381 #, no-wrap
12382 msgid ""
12383 "        /* [2] Load system call number from 'seccomp_data' buffer into\n"
12384 "               accumulator */\n"
12385 "        BPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n"
12386 "                 (offsetof(struct seccomp_data, nr))),\n"
12387 msgstr ""
12388
12389 #. type: Plain text
12390 #: build/C/man2/seccomp.2:608
12391 #, no-wrap
12392 msgid ""
12393 "        /* [3] Jump forward 1 instruction if system call number\n"
12394 "               does not match 'syscall_nr' */\n"
12395 "        BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, syscall_nr, 0, 1),\n"
12396 msgstr ""
12397
12398 #. type: Plain text
12399 #: build/C/man2/seccomp.2:613
12400 #, no-wrap
12401 msgid ""
12402 "        /* [4] Matching architecture and system call: don't execute\n"
12403 "\t       the system call, and return 'f_errno' in 'errno' */\n"
12404 "        BPF_STMT(BPF_RET | BPF_K,\n"
12405 "                 SECCOMP_RET_ERRNO | (f_errno & SECCOMP_RET_DATA)),\n"
12406 msgstr ""
12407
12408 #. type: Plain text
12409 #: build/C/man2/seccomp.2:617
12410 #, no-wrap
12411 msgid ""
12412 "        /* [5] Destination of system call number mismatch: allow other\n"
12413 "               system calls */\n"
12414 "        BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),\n"
12415 msgstr ""
12416
12417 #. type: Plain text
12418 #: build/C/man2/seccomp.2:621
12419 #, no-wrap
12420 msgid ""
12421 "        /* [6] Destination of architecture mismatch: kill process */\n"
12422 "        BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_KILL),\n"
12423 "    };\n"
12424 msgstr ""
12425
12426 #. type: Plain text
12427 #: build/C/man2/seccomp.2:626
12428 #, no-wrap
12429 msgid ""
12430 "    struct sock_fprog prog = {\n"
12431 "        .len = (unsigned short) (sizeof(filter) / sizeof(filter[0])),\n"
12432 "        .filter = filter,\n"
12433 "    };\n"
12434 msgstr ""
12435
12436 #. type: Plain text
12437 #: build/C/man2/seccomp.2:631
12438 #, no-wrap
12439 msgid ""
12440 "    if (seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog)) {\n"
12441 "        perror(\"seccomp\");\n"
12442 "        return 1;\n"
12443 "    }\n"
12444 msgstr ""
12445
12446 #. type: Plain text
12447 #: build/C/man2/seccomp.2:634
12448 #, no-wrap
12449 msgid ""
12450 "    return 0;\n"
12451 "}\n"
12452 msgstr ""
12453
12454 #. type: Plain text
12455 #: build/C/man2/seccomp.2:646
12456 #, no-wrap
12457 msgid ""
12458 "int\n"
12459 "main(int argc, char **argv)\n"
12460 "{\n"
12461 "    if (argc E<lt> 5) {\n"
12462 "        fprintf(stderr, \"Usage: \"\n"
12463 "                \"%s E<lt>syscall_nrE<gt> E<lt>archE<gt> E<lt>errnoE<gt> "
12464 "E<lt>progE<gt> [E<lt>argsE<gt>]\\en\"\n"
12465 "                \"Hint for E<lt>archE<gt>: AUDIT_ARCH_I386: 0x%X\\en\"\n"
12466 "                \"                 AUDIT_ARCH_X86_64: 0x%X\\en\"\n"
12467 "                \"\\en\", argv[0], AUDIT_ARCH_I386, AUDIT_ARCH_X86_64);\n"
12468 "        exit(EXIT_FAILURE);\n"
12469 "    }\n"
12470 msgstr ""
12471
12472 #. type: Plain text
12473 #: build/C/man2/seccomp.2:651
12474 #, no-wrap
12475 msgid ""
12476 "    if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) {\n"
12477 "        perror(\"prctl\");\n"
12478 "        exit(EXIT_FAILURE);\n"
12479 "    }\n"
12480 msgstr ""
12481
12482 #. type: Plain text
12483 #: build/C/man2/seccomp.2:656
12484 #, no-wrap
12485 msgid ""
12486 "    if (install_filter(strtol(argv[1], NULL, 0),\n"
12487 "                       strtol(argv[2], NULL, 0),\n"
12488 "                       strtol(argv[3], NULL, 0)))\n"
12489 "        exit(EXIT_FAILURE);\n"
12490 msgstr ""
12491
12492 #. type: Plain text
12493 #: build/C/man2/seccomp.2:661
12494 #, no-wrap
12495 msgid ""
12496 "    execv(argv[4], &argv[4]);\n"
12497 "    perror(\"execv\");\n"
12498 "    exit(EXIT_FAILURE);\n"
12499 "}\n"
12500 msgstr ""
12501
12502 #. type: Plain text
12503 #: build/C/man2/seccomp.2:668
12504 msgid "B<prctl>(2), B<ptrace>(2), B<sigaction>(2), B<signal>(7), B<socket>(7)"
12505 msgstr ""
12506
12507 #. type: Plain text
12508 #: build/C/man2/seccomp.2:673
12509 msgid ""
12510 "The kernel source files I<Documentation/networking/filter.txt> and "
12511 "I<Documentation/prctl/seccomp_filter.txt>."
12512 msgstr ""
12513
12514 #. type: Plain text
12515 #: build/C/man2/seccomp.2:679
12516 msgid ""
12517 "McCanne, S. and Jacobson, V. (1992)  I<The BSD Packet Filter: A New "
12518 "Architecture for User-level Packet Capture>, Proceedings of the USENIX "
12519 "Winter 1993 Conference E<.UR http://www.tcpdump.org/papers/bpf-usenix93.pdf> "
12520 "E<.UE>"
12521 msgstr ""