OSDN Git Service

LDP: Update POT and ja.po to LDP v3.79
[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-02-04 23:33+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.79 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
555 #, no-wrap
556 msgid "2015-02-01"
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<setpriv>(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: TH
5176 #: 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
5177 #, no-wrap
5178 msgid "2014-09-21"
5179 msgstr ""
5180
5181 #. type: Plain text
5182 #: build/C/man2/getpid.2:28
5183 msgid "getpid, getppid - get process identification"
5184 msgstr ""
5185
5186 #. type: Plain text
5187 #: build/C/man2/getpid.2:34
5188 msgid "B<pid_t getpid(void);>"
5189 msgstr ""
5190
5191 #. type: Plain text
5192 #: build/C/man2/getpid.2:36
5193 msgid "B<pid_t getppid(void);>"
5194 msgstr ""
5195
5196 #. type: Plain text
5197 #: build/C/man2/getpid.2:41
5198 msgid ""
5199 "B<getpid>()  returns the process ID of the calling process.  (This is often "
5200 "used by routines that generate unique temporary filenames.)"
5201 msgstr ""
5202
5203 #. type: Plain text
5204 #: build/C/man2/getpid.2:44
5205 msgid "B<getppid>()  returns the process ID of the parent of the calling process."
5206 msgstr ""
5207
5208 #. type: Plain text
5209 #: build/C/man2/getpid.2:48
5210 msgid "POSIX.1-2001, 4.3BSD, SVr4."
5211 msgstr ""
5212
5213 #.  The following program demonstrates this "feature":
5214 #
5215 #.  #define _GNU_SOURCE
5216 #.  #include <sys/syscall.h>
5217 #.  #include <sys/wait.h>
5218 #.  #include <stdio.h>
5219 #.  #include <stdlib.h>
5220 #.  #include <unistd.h>
5221 #
5222 #.  int
5223 #.  main(int argc, char *argv[])
5224 #.  {
5225 #.     /* The following statement fills the getpid() cache */
5226 #
5227 #.     printf("parent PID = %ld
5228 #. ", (long) getpid());
5229 #
5230 #.     if (syscall(SYS_fork) == 0) {
5231 #.         if (getpid() != syscall(SYS_getpid))
5232 #.             printf("child getpid() mismatch: getpid()=%ld; "
5233 #.                     "syscall(SYS_getpid)=%ld
5234 #. ",
5235 #.                     (long) getpid(), (long) syscall(SYS_getpid));
5236 #.         exit(EXIT_SUCCESS);
5237 #.     }
5238 #.     wait(NULL);
5239 #. }
5240 #. type: Plain text
5241 #: build/C/man2/getpid.2:100
5242 msgid ""
5243 "Since glibc version 2.3.4, the glibc wrapper function for B<getpid>()  "
5244 "caches PIDs, so as to avoid additional system calls when a process calls "
5245 "B<getpid>()  repeatedly.  Normally this caching is invisible, but its "
5246 "correct operation relies on support in the wrapper functions for B<fork>(2), "
5247 "B<vfork>(2), and B<clone>(2): if an application bypasses the glibc wrappers "
5248 "for these system calls by using B<syscall>(2), then a call to B<getpid>()  "
5249 "in the child will return the wrong value (to be precise: it will return the "
5250 "PID of the parent process).  See also B<clone>(2)  for discussion of a case "
5251 "where B<getpid>()  may return the wrong value even when invoking B<clone>(2)  "
5252 "via the glibc wrapper function."
5253 msgstr ""
5254
5255 #. type: Plain text
5256 #: build/C/man2/getpid.2:111
5257 msgid ""
5258 "B<clone>(2), B<fork>(2), B<kill>(2), B<exec>(3), B<mkstemp>(3), "
5259 "B<tempnam>(3), B<tmpfile>(3), B<tmpnam>(3), B<credentials>(7), "
5260 "B<pid_namespaces>(7)"
5261 msgstr ""
5262
5263 #. type: TH
5264 #: build/C/man2/getpriority.2:45
5265 #, no-wrap
5266 msgid "GETPRIORITY"
5267 msgstr ""
5268
5269 #. type: Plain text
5270 #: build/C/man2/getpriority.2:48
5271 msgid "getpriority, setpriority - get/set program scheduling priority"
5272 msgstr ""
5273
5274 #. type: Plain text
5275 #: build/C/man2/getpriority.2:50 build/C/man2/getrlimit.2:69 build/C/man2/getrusage.2:44
5276 msgid "B<#include E<lt>sys/time.hE<gt>>"
5277 msgstr ""
5278
5279 #. type: Plain text
5280 #: build/C/man2/getpriority.2:52 build/C/man2/getrlimit.2:71 build/C/man2/getrusage.2:46
5281 msgid "B<#include E<lt>sys/resource.hE<gt>>"
5282 msgstr ""
5283
5284 #. type: Plain text
5285 #: build/C/man2/getpriority.2:54
5286 msgid "B<int getpriority(int >I<which>B<, id_t >I<who>B<);>"
5287 msgstr ""
5288
5289 #. type: Plain text
5290 #: build/C/man2/getpriority.2:56
5291 msgid "B<int setpriority(int >I<which>B<, id_t >I<who>B<, int >I<prio>B<);>"
5292 msgstr ""
5293
5294 #. type: Plain text
5295 #: build/C/man2/getpriority.2:67
5296 msgid ""
5297 "The scheduling priority of the process, process group, or user, as indicated "
5298 "by I<which> and I<who> is obtained with the B<getpriority>()  call and set "
5299 "with the B<setpriority>()  call."
5300 msgstr ""
5301
5302 #. type: Plain text
5303 #: build/C/man2/getpriority.2:94
5304 msgid ""
5305 "The value I<which> is one of B<PRIO_PROCESS>, B<PRIO_PGRP>, or B<PRIO_USER>, "
5306 "and I<who> is interpreted relative to I<which> (a process identifier for "
5307 "B<PRIO_PROCESS>, process group identifier for B<PRIO_PGRP>, and a user ID "
5308 "for B<PRIO_USER>).  A zero value for I<who> denotes (respectively) the "
5309 "calling process, the process group of the calling process, or the real user "
5310 "ID of the calling process.  I<Prio> is a value in the range -20 to 19 (but "
5311 "see the Notes below).  The default priority is 0; lower priorities cause "
5312 "more favorable scheduling."
5313 msgstr ""
5314
5315 #. type: Plain text
5316 #: build/C/man2/getpriority.2:104
5317 msgid ""
5318 "The B<getpriority>()  call returns the highest priority (lowest numerical "
5319 "value)  enjoyed by any of the specified processes.  The B<setpriority>()  "
5320 "call sets the priorities of all of the specified processes to the specified "
5321 "value.  Only the superuser may lower priorities."
5322 msgstr ""
5323
5324 #. type: Plain text
5325 #: build/C/man2/getpriority.2:117
5326 msgid ""
5327 "Since B<getpriority>()  can legitimately return the value -1, it is "
5328 "necessary to clear the external variable I<errno> prior to the call, then "
5329 "check it afterward to determine if -1 is an error or a legitimate value.  "
5330 "The B<setpriority>()  call returns 0 if there is no error, or -1 if there "
5331 "is."
5332 msgstr ""
5333
5334 #. type: Plain text
5335 #: build/C/man2/getpriority.2:126
5336 msgid "I<which> was not one of B<PRIO_PROCESS>, B<PRIO_PGRP>, or B<PRIO_USER>."
5337 msgstr ""
5338
5339 #. type: Plain text
5340 #: build/C/man2/getpriority.2:133
5341 msgid "No process was located using the I<which> and I<who> values specified."
5342 msgstr ""
5343
5344 #. type: Plain text
5345 #: build/C/man2/getpriority.2:137
5346 msgid "In addition to the errors indicated above, B<setpriority>()  may fail if:"
5347 msgstr ""
5348
5349 #. type: Plain text
5350 #: build/C/man2/getpriority.2:149
5351 msgid ""
5352 "The caller attempted to lower a process priority, but did not have the "
5353 "required privilege (on Linux: did not have the B<CAP_SYS_NICE> capability).  "
5354 "Since Linux 2.6.12, this error occurs only if the caller attempts to set a "
5355 "process priority outside the range of the B<RLIMIT_NICE> soft resource limit "
5356 "of the target process; see B<getrlimit>(2)  for details."
5357 msgstr ""
5358
5359 #. type: Plain text
5360 #: build/C/man2/getpriority.2:157
5361 msgid ""
5362 "A process was located, but its effective user ID did not match either the "
5363 "effective or the real user ID of the caller, and was not privileged (on "
5364 "Linux: did not have the B<CAP_SYS_NICE> capability).  But see NOTES below."
5365 msgstr ""
5366
5367 #. type: Plain text
5368 #: build/C/man2/getpriority.2:160
5369 msgid "SVr4, 4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
5370 msgstr ""
5371
5372 #. type: Plain text
5373 #: build/C/man2/getpriority.2:166
5374 msgid ""
5375 "A child created by B<fork>(2)  inherits its parent's nice value.  The nice "
5376 "value is preserved across B<execve>(2)."
5377 msgstr ""
5378
5379 #. type: Plain text
5380 #: build/C/man2/getpriority.2:177
5381 msgid ""
5382 "The degree to which their relative nice value affects the scheduling of "
5383 "processes varies across UNIX systems, and, on Linux, across kernel "
5384 "versions.  Starting with kernel 2.6.23, Linux adopted an algorithm that "
5385 "causes relative differences in nice values to have a much stronger effect.  "
5386 "This causes very low nice values (+19) to truly provide little CPU to a "
5387 "process whenever there is any other higher priority load on the system, and "
5388 "makes high nice values (-20) deliver most of the CPU to applications that "
5389 "require it (e.g., some audio applications)."
5390 msgstr ""
5391
5392 #. type: Plain text
5393 #: build/C/man2/getpriority.2:192
5394 msgid ""
5395 "The details on the condition for B<EPERM> depend on the system.  The above "
5396 "description is what POSIX.1-2001 says, and seems to be followed on all "
5397 "System\\ V-like systems.  Linux kernels before 2.6.12 required the real or "
5398 "effective user ID of the caller to match the real user of the process I<who> "
5399 "(instead of its effective user ID).  Linux 2.6.12 and later require the "
5400 "effective user ID of the caller to match the real or effective user ID of "
5401 "the process I<who>.  All BSD-like systems (SunOS 4.1.3, Ultrix 4.2, 4.3BSD, "
5402 "FreeBSD 4.3, OpenBSD-2.5, ...) behave in the same manner as Linux 2.6.12 and "
5403 "later."
5404 msgstr ""
5405
5406 #. type: Plain text
5407 #: build/C/man2/getpriority.2:197
5408 msgid ""
5409 "The actual priority range varies between kernel versions.  Linux before "
5410 "1.3.36 had -infinity..15.  Since kernel 1.3.43, Linux has the range "
5411 "-20..19.  On some other systems, the range of nice values is -20..20."
5412 msgstr ""
5413
5414 #. type: Plain text
5415 #: build/C/man2/getpriority.2:210
5416 msgid ""
5417 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
5418 "portability.  (Indeed, I<E<lt>sys/resource.hE<gt>> defines the I<rusage> "
5419 "structure with fields of type I<struct timeval> defined in "
5420 "I<E<lt>sys/time.hE<gt>>.)"
5421 msgstr ""
5422
5423 #. type: SS
5424 #: build/C/man2/getpriority.2:210 build/C/man2/seteuid.2:132
5425 #, no-wrap
5426 msgid "C library/kernel ABI differences"
5427 msgstr ""
5428
5429 #. type: Plain text
5430 #: build/C/man2/getpriority.2:225
5431 msgid ""
5432 "Within the kernel, nice values are actually represented using the range "
5433 "40..1 (since negative numbers are error codes) and these are the values "
5434 "employed by the B<setpriority>()  and B<getpriority>()  system calls.  The "
5435 "glibc wrapper functions for these system calls handle the translations "
5436 "between the user-land and kernel representations of the nice value according "
5437 "to the formula I<unice\\ =\\ 20\\ -\\ knice>.  (Thus, the kernels 40..1 "
5438 "range corresponds to the range -20..19 as seen by user space.)"
5439 msgstr ""
5440
5441 #. type: Plain text
5442 #: build/C/man2/getpriority.2:232
5443 msgid ""
5444 "According to POSIX, the nice value is a per-process setting.  However, under "
5445 "the current Linux/NPTL implementation of POSIX threads, the nice value is a "
5446 "per-thread attribute: different threads in the same process can have "
5447 "different nice values.  Portable applications should avoid relying on the "
5448 "Linux behavior, which may be made standards conformant in the future."
5449 msgstr ""
5450
5451 #. type: Plain text
5452 #: build/C/man2/getpriority.2:238
5453 msgid "B<nice>(1), B<renice>(1), B<fork>(2), B<capabilities>(7), B<sched>(7)"
5454 msgstr ""
5455
5456 #. type: Plain text
5457 #: build/C/man2/getpriority.2:241
5458 msgid ""
5459 "I<Documentation/scheduler/sched-nice-design.txt> in the Linux kernel source "
5460 "tree (since Linux 2.6.23)"
5461 msgstr ""
5462
5463 #. type: TH
5464 #: build/C/man2/getresuid.2:28
5465 #, no-wrap
5466 msgid "GETRESUID"
5467 msgstr ""
5468
5469 #. type: Plain text
5470 #: build/C/man2/getresuid.2:31
5471 msgid "getresuid, getresgid - get real, effective and saved user/group IDs"
5472 msgstr ""
5473
5474 #. type: Plain text
5475 #: build/C/man2/getresuid.2:33 build/C/man2/setresuid.2:31
5476 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
5477 msgstr ""
5478
5479 #. type: Plain text
5480 #: build/C/man2/getresuid.2:37
5481 msgid "B<int getresuid(uid_t *>I<ruid>B<, uid_t *>I<euid>B<, uid_t *>I<suid>B<);>"
5482 msgstr ""
5483
5484 #. type: Plain text
5485 #: build/C/man2/getresuid.2:39
5486 msgid "B<int getresgid(gid_t *>I<rgid>B<, gid_t *>I<egid>B<, gid_t *>I<sgid>B<);>"
5487 msgstr ""
5488
5489 #. type: Plain text
5490 #: build/C/man2/getresuid.2:50
5491 msgid ""
5492 "B<getresuid>()  returns the real UID, the effective UID, and the saved "
5493 "set-user-ID of the calling process, in the arguments I<ruid>, I<euid>, and "
5494 "I<suid>, respectively.  B<getresgid>()  performs the analogous task for the "
5495 "process's group IDs."
5496 msgstr ""
5497
5498 #. type: Plain text
5499 #: build/C/man2/getresuid.2:60
5500 msgid ""
5501 "One of the arguments specified an address outside the calling program's "
5502 "address space."
5503 msgstr ""
5504
5505 #. type: Plain text
5506 #: build/C/man2/getresuid.2:62
5507 msgid "These system calls appeared on Linux starting with kernel 2.1.44."
5508 msgstr ""
5509
5510 #. type: Plain text
5511 #: build/C/man2/getresuid.2:67
5512 msgid ""
5513 "The prototypes are given by glibc since version 2.3.2, provided "
5514 "B<_GNU_SOURCE> is defined."
5515 msgstr ""
5516
5517 #. type: Plain text
5518 #: build/C/man2/getresuid.2:70 build/C/man2/setresuid.2:112
5519 msgid "These calls are nonstandard; they also appear on HP-UX and some of the BSDs."
5520 msgstr ""
5521
5522 #. type: Plain text
5523 #: build/C/man2/getresuid.2:86
5524 msgid ""
5525 "The original Linux B<getresuid>()  and B<getresgid>()  system calls "
5526 "supported only 16-bit user and group IDs.  Subsequently, Linux 2.4 added "
5527 "B<getresuid32>()  and B<getresgid32>(), supporting 32-bit IDs.  The glibc "
5528 "B<getresuid>()  and B<getresgid>()  wrapper functions transparently deal "
5529 "with the variations across kernel versions."
5530 msgstr ""
5531
5532 #. type: Plain text
5533 #: build/C/man2/getresuid.2:92
5534 msgid ""
5535 "B<getuid>(2), B<setresuid>(2), B<setreuid>(2), B<setuid>(2), "
5536 "B<credentials>(7)"
5537 msgstr ""
5538
5539 #. type: TH
5540 #: build/C/man2/getrlimit.2:64
5541 #, no-wrap
5542 msgid "GETRLIMIT"
5543 msgstr ""
5544
5545 #. type: TH
5546 #: build/C/man2/getrlimit.2:64
5547 #, no-wrap
5548 msgid "2015-01-22"
5549 msgstr ""
5550
5551 #. type: Plain text
5552 #: build/C/man2/getrlimit.2:67
5553 msgid "getrlimit, setrlimit, prlimit - get/set resource limits"
5554 msgstr ""
5555
5556 #. type: Plain text
5557 #: build/C/man2/getrlimit.2:73
5558 msgid "B<int getrlimit(int >I<resource>B<, struct rlimit *>I<rlim>B<);>"
5559 msgstr ""
5560
5561 #. type: Plain text
5562 #: build/C/man2/getrlimit.2:75
5563 msgid "B<int setrlimit(int >I<resource>B<, const struct rlimit *>I<rlim>B<);>"
5564 msgstr ""
5565
5566 #. type: Plain text
5567 #: build/C/man2/getrlimit.2:78
5568 msgid ""
5569 "B<int prlimit(pid_t >I<pid>B<, int >I<resource>B<, const struct rlimit "
5570 "*>I<new_limit>B<,>"
5571 msgstr ""
5572
5573 #. type: Plain text
5574 #: build/C/man2/getrlimit.2:80
5575 msgid "B< struct rlimit *>I<old_limit>B<);>"
5576 msgstr ""
5577
5578 #. type: Plain text
5579 #: build/C/man2/getrlimit.2:88
5580 msgid "B<prlimit>(): _GNU_SOURCE && _FILE_OFFSET_BITS == 64"
5581 msgstr ""
5582
5583 #. type: Plain text
5584 #: build/C/man2/getrlimit.2:97
5585 msgid ""
5586 "The B<getrlimit>()  and B<setrlimit>()  system calls get and set resource "
5587 "limits respectively.  Each resource has an associated soft and hard limit, "
5588 "as defined by the I<rlimit> structure:"
5589 msgstr ""
5590
5591 #. type: Plain text
5592 #: build/C/man2/getrlimit.2:104
5593 #, no-wrap
5594 msgid ""
5595 "struct rlimit {\n"
5596 "    rlim_t rlim_cur;  /* Soft limit */\n"
5597 "    rlim_t rlim_max;  /* Hard limit (ceiling for rlim_cur) */\n"
5598 "};\n"
5599 msgstr ""
5600
5601 #. type: Plain text
5602 #: build/C/man2/getrlimit.2:115
5603 msgid ""
5604 "The soft limit is the value that the kernel enforces for the corresponding "
5605 "resource.  The hard limit acts as a ceiling for the soft limit: an "
5606 "unprivileged process may set only its soft limit to a value in the range "
5607 "from 0 up to the hard limit, and (irreversibly) lower its hard limit.  A "
5608 "privileged process (under Linux: one with the B<CAP_SYS_RESOURCE> "
5609 "capability) may make arbitrary changes to either limit value."
5610 msgstr ""
5611
5612 #. type: Plain text
5613 #: build/C/man2/getrlimit.2:122
5614 msgid ""
5615 "The value B<RLIM_INFINITY> denotes no limit on a resource (both in the "
5616 "structure returned by B<getrlimit>()  and in the structure passed to "
5617 "B<setrlimit>())."
5618 msgstr ""
5619
5620 #. type: Plain text
5621 #: build/C/man2/getrlimit.2:126
5622 msgid "The I<resource> argument must be one of:"
5623 msgstr ""
5624
5625 #. type: TP
5626 #: build/C/man2/getrlimit.2:126
5627 #, no-wrap
5628 msgid "B<RLIMIT_AS>"
5629 msgstr ""
5630
5631 #.  since 2.0.27 / 2.1.12
5632 #. type: Plain text
5633 #: build/C/man2/getrlimit.2:146
5634 msgid ""
5635 "The maximum size of the process's virtual memory (address space) in bytes.  "
5636 "This limit affects calls to B<brk>(2), B<mmap>(2), and B<mremap>(2), which "
5637 "fail with the error B<ENOMEM> upon exceeding this limit.  Also automatic "
5638 "stack expansion will fail (and generate a B<SIGSEGV> that kills the process "
5639 "if no alternate stack has been made available via B<sigaltstack>(2)).  Since "
5640 "the value is a I<long>, on machines with a 32-bit I<long> either this limit "
5641 "is at most 2 GiB, or this resource is unlimited."
5642 msgstr ""
5643
5644 #. type: TP
5645 #: build/C/man2/getrlimit.2:146
5646 #, no-wrap
5647 msgid "B<RLIMIT_CORE>"
5648 msgstr ""
5649
5650 #. type: Plain text
5651 #: build/C/man2/getrlimit.2:154
5652 msgid ""
5653 "Maximum size of a I<core> file (see B<core>(5)).  When 0 no core dump files "
5654 "are created.  When nonzero, larger dumps are truncated to this size."
5655 msgstr ""
5656
5657 #. type: TP
5658 #: build/C/man2/getrlimit.2:154
5659 #, no-wrap
5660 msgid "B<RLIMIT_CPU>"
5661 msgstr ""
5662
5663 #. type: Plain text
5664 #: build/C/man2/getrlimit.2:174
5665 msgid ""
5666 "CPU time limit in seconds.  When the process reaches the soft limit, it is "
5667 "sent a B<SIGXCPU> signal.  The default action for this signal is to "
5668 "terminate the process.  However, the signal can be caught, and the handler "
5669 "can return control to the main program.  If the process continues to consume "
5670 "CPU time, it will be sent B<SIGXCPU> once per second until the hard limit is "
5671 "reached, at which time it is sent B<SIGKILL>.  (This latter point describes "
5672 "Linux behavior.  Implementations vary in how they treat processes which "
5673 "continue to consume CPU time after reaching the soft limit.  Portable "
5674 "applications that need to catch this signal should perform an orderly "
5675 "termination upon first receipt of B<SIGXCPU>.)"
5676 msgstr ""
5677
5678 #. type: TP
5679 #: build/C/man2/getrlimit.2:174
5680 #, no-wrap
5681 msgid "B<RLIMIT_DATA>"
5682 msgstr ""
5683
5684 #. type: Plain text
5685 #: build/C/man2/getrlimit.2:185
5686 msgid ""
5687 "The maximum size of the process's data segment (initialized data, "
5688 "uninitialized data, and heap).  This limit affects calls to B<brk>(2)  and "
5689 "B<sbrk>(2), which fail with the error B<ENOMEM> upon encountering the soft "
5690 "limit of this resource."
5691 msgstr ""
5692
5693 #. type: TP
5694 #: build/C/man2/getrlimit.2:185
5695 #, no-wrap
5696 msgid "B<RLIMIT_FSIZE>"
5697 msgstr ""
5698
5699 #. type: Plain text
5700 #: build/C/man2/getrlimit.2:197
5701 msgid ""
5702 "The maximum size of files that the process may create.  Attempts to extend a "
5703 "file beyond this limit result in delivery of a B<SIGXFSZ> signal.  By "
5704 "default, this signal terminates a process, but a process can catch this "
5705 "signal instead, in which case the relevant system call (e.g., B<write>(2), "
5706 "B<truncate>(2))  fails with the error B<EFBIG>."
5707 msgstr ""
5708
5709 #. type: TP
5710 #: build/C/man2/getrlimit.2:197
5711 #, no-wrap
5712 msgid "B<RLIMIT_LOCKS> (Early Linux 2.4 only)"
5713 msgstr ""
5714
5715 #.  to be precise: Linux 2.4.0-test9; no longer in 2.4.25 / 2.5.65
5716 #. type: Plain text
5717 #: build/C/man2/getrlimit.2:205
5718 msgid ""
5719 "A limit on the combined number of B<flock>(2)  locks and B<fcntl>(2)  leases "
5720 "that this process may establish."
5721 msgstr ""
5722
5723 #. type: TP
5724 #: build/C/man2/getrlimit.2:205
5725 #, no-wrap
5726 msgid "B<RLIMIT_MEMLOCK>"
5727 msgstr ""
5728
5729 #. type: Plain text
5730 #: build/C/man2/getrlimit.2:243
5731 msgid ""
5732 "The maximum number of bytes of memory that may be locked into RAM.  In "
5733 "effect this limit is rounded down to the nearest multiple of the system page "
5734 "size.  This limit affects B<mlock>(2)  and B<mlockall>(2)  and the "
5735 "B<mmap>(2)  B<MAP_LOCKED> operation.  Since Linux 2.6.9 it also affects the "
5736 "B<shmctl>(2)  B<SHM_LOCK> operation, where it sets a maximum on the total "
5737 "bytes in shared memory segments (see B<shmget>(2))  that may be locked by "
5738 "the real user ID of the calling process.  The B<shmctl>(2)  B<SHM_LOCK> "
5739 "locks are accounted for separately from the per-process memory locks "
5740 "established by B<mlock>(2), B<mlockall>(2), and B<mmap>(2)  B<MAP_LOCKED>; a "
5741 "process can lock bytes up to this limit in each of these two categories.  In "
5742 "Linux kernels before 2.6.9, this limit controlled the amount of memory that "
5743 "could be locked by a privileged process.  Since Linux 2.6.9, no limits are "
5744 "placed on the amount of memory that a privileged process may lock, and this "
5745 "limit instead governs the amount of memory that an unprivileged process may "
5746 "lock."
5747 msgstr ""
5748
5749 #. type: TP
5750 #: build/C/man2/getrlimit.2:243
5751 #, no-wrap
5752 msgid "B<RLIMIT_MSGQUEUE> (since Linux 2.6.8)"
5753 msgstr ""
5754
5755 #. type: Plain text
5756 #: build/C/man2/getrlimit.2:251
5757 msgid ""
5758 "Specifies the limit on the number of bytes that can be allocated for POSIX "
5759 "message queues for the real user ID of the calling process.  This limit is "
5760 "enforced for B<mq_open>(3).  Each message queue that the user creates counts "
5761 "(until it is removed)  against this limit according to the formula:"
5762 msgstr ""
5763
5764 #. type: Plain text
5765 #: build/C/man2/getrlimit.2:260
5766 #, no-wrap
5767 msgid ""
5768 "    Since Linux 3.5:\n"
5769 "        bytes = attr.mq_maxmsg * sizeof(struct msg_msg) +\n"
5770 "                min(attr.mq_maxmsg, MQ_PRIO_MAX) *\n"
5771 "                      sizeof(struct posix_msg_tree_node)+\n"
5772 "                                /* For overhead */\n"
5773 "                attr.mq_maxmsg * attr.mq_msgsize;\n"
5774 "                                /* For message data */\n"
5775 msgstr ""
5776
5777 #. type: Plain text
5778 #: build/C/man2/getrlimit.2:266
5779 #, no-wrap
5780 msgid ""
5781 "    Linux 3.4 and earlier:\n"
5782 "        bytes = attr.mq_maxmsg * sizeof(struct msg_msg *) +\n"
5783 "                                /* For overhead */\n"
5784 "                attr.mq_maxmsg * attr.mq_msgsize;\n"
5785 "                                /* For message data */\n"
5786 msgstr ""
5787
5788 #. type: Plain text
5789 #: build/C/man2/getrlimit.2:279
5790 msgid ""
5791 "where I<attr> is the I<mq_attr> structure specified as the fourth argument "
5792 "to B<mq_open>(3), and the I<msg_msg> and I<posix_msg_tree_node> structures "
5793 "are kernel-internal structures."
5794 msgstr ""
5795
5796 #. type: Plain text
5797 #: build/C/man2/getrlimit.2:285
5798 msgid ""
5799 "The \"overhead\" addend in the formula accounts for overhead bytes required "
5800 "by the implementation and ensures that the user cannot create an unlimited "
5801 "number of zero-length messages (such messages nevertheless each consume some "
5802 "system memory for bookkeeping overhead)."
5803 msgstr ""
5804
5805 #. type: TP
5806 #: build/C/man2/getrlimit.2:285
5807 #, no-wrap
5808 msgid "B<RLIMIT_NICE> (since Linux 2.6.12, but see BUGS below)"
5809 msgstr ""
5810
5811 #. type: Plain text
5812 #: build/C/man2/getrlimit.2:298
5813 msgid ""
5814 "Specifies a ceiling to which the process's nice value can be raised using "
5815 "B<setpriority>(2)  or B<nice>(2).  The actual ceiling for the nice value is "
5816 "calculated as I<20\\ -\\ rlim_cur>.  (This strangeness occurs because "
5817 "negative numbers cannot be specified as resource limit values, since they "
5818 "typically have special meanings.  For example, B<RLIM_INFINITY> typically is "
5819 "the same as -1.)"
5820 msgstr ""
5821
5822 #. type: TP
5823 #: build/C/man2/getrlimit.2:298
5824 #, no-wrap
5825 msgid "B<RLIMIT_NOFILE>"
5826 msgstr ""
5827
5828 #. type: Plain text
5829 #: build/C/man2/getrlimit.2:312
5830 msgid ""
5831 "Specifies a value one greater than the maximum file descriptor number that "
5832 "can be opened by this process.  Attempts (B<open>(2), B<pipe>(2), B<dup>(2), "
5833 "etc.)  to exceed this limit yield the error B<EMFILE>.  (Historically, this "
5834 "limit was named B<RLIMIT_OFILE> on BSD.)"
5835 msgstr ""
5836
5837 #. type: TP
5838 #: build/C/man2/getrlimit.2:312
5839 #, no-wrap
5840 msgid "B<RLIMIT_NPROC>"
5841 msgstr ""
5842
5843 #. type: Plain text
5844 #: build/C/man2/getrlimit.2:325
5845 msgid ""
5846 "The maximum number of processes (or, more precisely on Linux, threads)  that "
5847 "can be created for the real user ID of the calling process.  Upon "
5848 "encountering this limit, B<fork>(2)  fails with the error B<EAGAIN>.  This "
5849 "limit is not enforced for processes that have either the B<CAP_SYS_ADMIN> or "
5850 "the B<CAP_SYS_RESOURCE> capability."
5851 msgstr ""
5852
5853 #. type: TP
5854 #: build/C/man2/getrlimit.2:325
5855 #, no-wrap
5856 msgid "B<RLIMIT_RSS>"
5857 msgstr ""
5858
5859 #.  As at kernel 2.6.12, this limit still does nothing in 2.6 though
5860 #.  talk of making it do something has surfaced from time to time in LKML
5861 #.        -- MTK, Jul 05
5862 #. type: Plain text
5863 #: build/C/man2/getrlimit.2:337
5864 msgid ""
5865 "Specifies the limit (in pages) of the process's resident set (the number of "
5866 "virtual pages resident in RAM).  This limit has effect only in Linux 2.4.x, "
5867 "x E<lt> 30, and there affects only calls to B<madvise>(2)  specifying "
5868 "B<MADV_WILLNEED>."
5869 msgstr ""
5870
5871 #. type: TP
5872 #: build/C/man2/getrlimit.2:337
5873 #, no-wrap
5874 msgid "B<RLIMIT_RTPRIO> (since Linux 2.6.12, but see BUGS)"
5875 msgstr ""
5876
5877 #. type: Plain text
5878 #: build/C/man2/getrlimit.2:344
5879 msgid ""
5880 "Specifies a ceiling on the real-time priority that may be set for this "
5881 "process using B<sched_setscheduler>(2)  and B<sched_setparam>(2)."
5882 msgstr ""
5883
5884 #. type: TP
5885 #: build/C/man2/getrlimit.2:344
5886 #, no-wrap
5887 msgid "B<RLIMIT_RTTIME> (since Linux 2.6.25)"
5888 msgstr ""
5889
5890 #. type: Plain text
5891 #: build/C/man2/getrlimit.2:356
5892 msgid ""
5893 "Specifies a limit (in microseconds)  on the amount of CPU time that a "
5894 "process scheduled under a real-time scheduling policy may consume without "
5895 "making a blocking system call.  For the purpose of this limit, each time a "
5896 "process makes a blocking system call, the count of its consumed CPU time is "
5897 "reset to zero.  The CPU time count is not reset if the process continues "
5898 "trying to use the CPU but is preempted, its time slice expires, or it calls "
5899 "B<sched_yield>(2)."
5900 msgstr ""
5901
5902 #. type: Plain text
5903 #: build/C/man2/getrlimit.2:367
5904 msgid ""
5905 "Upon reaching the soft limit, the process is sent a B<SIGXCPU> signal.  If "
5906 "the process catches or ignores this signal and continues consuming CPU time, "
5907 "then B<SIGXCPU> will be generated once each second until the hard limit is "
5908 "reached, at which point the process is sent a B<SIGKILL> signal."
5909 msgstr ""
5910
5911 #. type: Plain text
5912 #: build/C/man2/getrlimit.2:370
5913 msgid ""
5914 "The intended use of this limit is to stop a runaway real-time process from "
5915 "locking up the system."
5916 msgstr ""
5917
5918 #. type: TP
5919 #: build/C/man2/getrlimit.2:370
5920 #, no-wrap
5921 msgid "B<RLIMIT_SIGPENDING> (since Linux 2.6.8)"
5922 msgstr ""
5923
5924 #.  This replaces the /proc/sys/kernel/rtsig-max system-wide limit
5925 #.  that was present in kernels <= 2.6.7.  MTK Dec 04
5926 #. type: Plain text
5927 #: build/C/man2/getrlimit.2:384
5928 msgid ""
5929 "Specifies the limit on the number of signals that may be queued for the real "
5930 "user ID of the calling process.  Both standard and real-time signals are "
5931 "counted for the purpose of checking this limit.  However, the limit is "
5932 "enforced only for B<sigqueue>(3); it is always possible to use B<kill>(2)  "
5933 "to queue one instance of any of the signals that are not already queued to "
5934 "the process."
5935 msgstr ""
5936
5937 #. type: TP
5938 #: build/C/man2/getrlimit.2:384
5939 #, no-wrap
5940 msgid "B<RLIMIT_STACK>"
5941 msgstr ""
5942
5943 #. type: Plain text
5944 #: build/C/man2/getrlimit.2:392
5945 msgid ""
5946 "The maximum size of the process stack, in bytes.  Upon reaching this limit, "
5947 "a B<SIGSEGV> signal is generated.  To handle this signal, a process must "
5948 "employ an alternate signal stack (B<sigaltstack>(2))."
5949 msgstr ""
5950
5951 #. type: Plain text
5952 #: build/C/man2/getrlimit.2:397
5953 msgid ""
5954 "Since Linux 2.6.23, this limit also determines the amount of space used for "
5955 "the process's command-line arguments and environment variables; for details, "
5956 "see B<execve>(2)."
5957 msgstr ""
5958
5959 #. type: SS
5960 #: build/C/man2/getrlimit.2:397
5961 #, no-wrap
5962 msgid "prlimit()"
5963 msgstr ""
5964
5965 #.  commit c022a0acad534fd5f5d5f17280f6d4d135e74e81
5966 #.  Author: Jiri Slaby <jslaby@suse.cz>
5967 #.  Date:   Tue May 4 18:03:50 2010 +0200
5968 #
5969 #.      rlimits: implement prlimit64 syscall
5970 #
5971 #.  commit 6a1d5e2c85d06da35cdfd93f1a27675bfdc3ad8c
5972 #.  Author: Jiri Slaby <jslaby@suse.cz>
5973 #.  Date:   Wed Mar 24 17:06:58 2010 +0100
5974 #
5975 #.      rlimits: add rlimit64 structure
5976 #. type: Plain text
5977 #: build/C/man2/getrlimit.2:417
5978 msgid ""
5979 "The Linux-specific B<prlimit>()  system call combines and extends the "
5980 "functionality of B<setrlimit>()  and B<getrlimit>().  It can be used to both "
5981 "set and get the resource limits of an arbitrary process."
5982 msgstr ""
5983
5984 #. type: Plain text
5985 #: build/C/man2/getrlimit.2:424
5986 msgid ""
5987 "The I<resource> argument has the same meaning as for B<setrlimit>()  and "
5988 "B<getrlimit>()."
5989 msgstr ""
5990
5991 #. type: Plain text
5992 #: build/C/man2/getrlimit.2:442
5993 msgid ""
5994 "If the I<new_limit> argument is a not NULL, then the I<rlimit> structure to "
5995 "which it points is used to set new values for the soft and hard limits for "
5996 "I<resource>.  If the I<old_limit> argument is a not NULL, then a successful "
5997 "call to B<prlimit>()  places the previous soft and hard limits for "
5998 "I<resource> in the I<rlimit> structure pointed to by I<old_limit>."
5999 msgstr ""
6000
6001 #.  FIXME . this permission check is strange
6002 #.  Asked about this on LKML, 7 Nov 2010
6003 #.      "Inconsistent credential checking in prlimit() syscall"
6004 #. type: Plain text
6005 #: build/C/man2/getrlimit.2:461
6006 msgid ""
6007 "The I<pid> argument specifies the ID of the process on which the call is to "
6008 "operate.  If I<pid> is 0, then the call applies to the calling process.  To "
6009 "set or get the resources of a process other than itself, the caller must "
6010 "have the B<CAP_SYS_RESOURCE> capability, or the real, effective, and saved "
6011 "set user IDs of the target process must match the real user ID of the caller "
6012 "I<and> the real, effective, and saved set group IDs of the target process "
6013 "must match the real group ID of the caller."
6014 msgstr ""
6015
6016 #. type: Plain text
6017 #: build/C/man2/getrlimit.2:466
6018 msgid ""
6019 "On success, these system calls return 0.  On error, -1 is returned, and "
6020 "I<errno> is set appropriately."
6021 msgstr ""
6022
6023 #. type: Plain text
6024 #: build/C/man2/getrlimit.2:471
6025 msgid ""
6026 "A pointer argument points to a location outside the accessible address "
6027 "space."
6028 msgstr ""
6029
6030 #. type: Plain text
6031 #: build/C/man2/getrlimit.2:483
6032 msgid ""
6033 "The value specified in I<resource> is not valid; or, for B<setrlimit>()  or "
6034 "B<prlimit>(): I<rlim-E<gt>rlim_cur> was greater than I<rlim-E<gt>rlim_max>."
6035 msgstr ""
6036
6037 #. type: Plain text
6038 #: build/C/man2/getrlimit.2:488
6039 msgid ""
6040 "An unprivileged process tried to raise the hard limit; the "
6041 "B<CAP_SYS_RESOURCE> capability is required to do this."
6042 msgstr ""
6043
6044 #. type: Plain text
6045 #: build/C/man2/getrlimit.2:496
6046 msgid ""
6047 "The caller tried to increase the hard B<RLIMIT_NOFILE> limit above the "
6048 "maximum defined by I</proc/sys/fs/nr_open> (see B<proc>(5))"
6049 msgstr ""
6050
6051 #. type: Plain text
6052 #: build/C/man2/getrlimit.2:502
6053 msgid ""
6054 "(B<prlimit>())  The calling process did not have permission to set limits "
6055 "for the process specified by I<pid>."
6056 msgstr ""
6057
6058 #. type: Plain text
6059 #: build/C/man2/getrlimit.2:506
6060 msgid "Could not find a process with the ID specified in I<pid>."
6061 msgstr ""
6062
6063 #. type: Plain text
6064 #: build/C/man2/getrlimit.2:511
6065 msgid ""
6066 "The B<prlimit>()  system call is available since Linux 2.6.36.  Library "
6067 "support is available since glibc 2.13."
6068 msgstr ""
6069
6070 #. type: Plain text
6071 #: build/C/man2/getrlimit.2:515
6072 msgid "B<getrlimit>(), B<setrlimit>(): SVr4, 4.3BSD, POSIX.1-2001."
6073 msgstr ""
6074
6075 #. type: Plain text
6076 #: build/C/man2/getrlimit.2:518
6077 msgid "B<prlimit>(): Linux-specific."
6078 msgstr ""
6079
6080 #. type: Plain text
6081 #: build/C/man2/getrlimit.2:534
6082 msgid ""
6083 "B<RLIMIT_MEMLOCK> and B<RLIMIT_NPROC> derive from BSD and are not specified "
6084 "in POSIX.1-2001; they are present on the BSDs and Linux, but on few other "
6085 "implementations.  B<RLIMIT_RSS> derives from BSD and is not specified in "
6086 "POSIX.1-2001; it is nevertheless present on most implementations.  "
6087 "B<RLIMIT_MSGQUEUE>, B<RLIMIT_NICE>, B<RLIMIT_RTPRIO>, B<RLIMIT_RTTIME>, and "
6088 "B<RLIMIT_SIGPENDING> are Linux-specific."
6089 msgstr ""
6090
6091 #. type: Plain text
6092 #: build/C/man2/getrlimit.2:540
6093 msgid ""
6094 "A child process created via B<fork>(2)  inherits its parent's resource "
6095 "limits.  Resource limits are preserved across B<execve>(2)."
6096 msgstr ""
6097
6098 #. type: Plain text
6099 #: build/C/man2/getrlimit.2:545
6100 msgid ""
6101 "Lowering the soft limit for a resource below the process's current "
6102 "consumption of that resource will succeed (but will prevent the process from "
6103 "further increasing its consumption of the resource)."
6104 msgstr ""
6105
6106 #. type: Plain text
6107 #: build/C/man2/getrlimit.2:554
6108 msgid ""
6109 "One can set the resource limits of the shell using the built-in I<ulimit> "
6110 "command (I<limit> in B<csh>(1)).  The shell's resource limits are inherited "
6111 "by the processes that it creates to execute commands."
6112 msgstr ""
6113
6114 #. type: Plain text
6115 #: build/C/man2/getrlimit.2:559
6116 msgid ""
6117 "Since Linux 2.6.24, the resource limits of any process can be inspected via "
6118 "I</proc/[pid]/limits>; see B<proc>(5)."
6119 msgstr ""
6120
6121 #. type: Plain text
6122 #: build/C/man2/getrlimit.2:568
6123 msgid ""
6124 "Ancient systems provided a B<vlimit>()  function with a similar purpose to "
6125 "B<setrlimit>().  For backward compatibility, glibc also provides "
6126 "B<vlimit>().  All new applications should be written using B<setrlimit>()."
6127 msgstr ""
6128
6129 #. type: SS
6130 #: build/C/man2/getrlimit.2:568
6131 #, no-wrap
6132 msgid "C library/ kernel ABI differences"
6133 msgstr ""
6134
6135 #. type: Plain text
6136 #: build/C/man2/getrlimit.2:577
6137 msgid ""
6138 "Since version 2.13, the glibc B<getrlimit>()  and B<setrlimit>()  wrapper "
6139 "functions no longer invoke the corresponding system calls, but instead "
6140 "employ B<prlimit>(), for the reasons described in BUGS."
6141 msgstr ""
6142
6143 #. type: Plain text
6144 #: build/C/man2/getrlimit.2:586
6145 msgid ""
6146 "In older Linux kernels, the B<SIGXCPU> and B<SIGKILL> signals delivered when "
6147 "a process encountered the soft and hard B<RLIMIT_CPU> limits were delivered "
6148 "one (CPU) second later than they should have been.  This was fixed in kernel "
6149 "2.6.8."
6150 msgstr ""
6151
6152 #.  see http://marc.theaimsgroup.com/?l=linux-kernel&m=114008066530167&w=2
6153 #. type: Plain text
6154 #: build/C/man2/getrlimit.2:594
6155 msgid ""
6156 "In 2.6.x kernels before 2.6.17, a B<RLIMIT_CPU> limit of 0 is wrongly "
6157 "treated as \"no limit\" (like B<RLIM_INFINITY>).  Since Linux 2.6.17, "
6158 "setting a limit of 0 does have an effect, but is actually treated as a limit "
6159 "of 1 second."
6160 msgstr ""
6161
6162 #.  See https://lwn.net/Articles/145008/
6163 #. type: Plain text
6164 #: build/C/man2/getrlimit.2:599
6165 msgid ""
6166 "A kernel bug means that B<RLIMIT_RTPRIO> does not work in kernel 2.6.12; the "
6167 "problem is fixed in kernel 2.6.13."
6168 msgstr ""
6169
6170 #.  see http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2
6171 #. type: Plain text
6172 #: build/C/man2/getrlimit.2:610
6173 msgid ""
6174 "In kernel 2.6.12, there was an off-by-one mismatch between the priority "
6175 "ranges returned by B<getpriority>(2)  and B<RLIMIT_NICE>.  This had the "
6176 "effect that the actual ceiling for the nice value was calculated as I<19\\ "
6177 "-\\ rlim_cur>.  This was fixed in kernel 2.6.13."
6178 msgstr ""
6179
6180 #.  The relevant patch, sent to LKML, seems to be
6181 #.  http://thread.gmane.org/gmane.linux.kernel/273462
6182 #.  From: Roland McGrath <roland <at> redhat.com>
6183 #.  Subject: [PATCH 7/7] make RLIMIT_CPU/SIGXCPU per-process
6184 #.  Date: 2005-01-23 23:27:46 GMT
6185 #.  Tested Solaris 10, FreeBSD 9, OpenBSD 5.0
6186 #.  FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=50951
6187 #. type: Plain text
6188 #: build/C/man2/getrlimit.2:637
6189 msgid ""
6190 "Since Linux 2.6.12, if a process reaches its soft B<RLIMIT_CPU> limit and "
6191 "has a handler installed for B<SIGXCPU>, then, in addition to invoking the "
6192 "signal handler, the kernel increases the soft limit by one second.  This "
6193 "behavior repeats if the process continues to consume CPU time, until the "
6194 "hard limit is reached, at which point the process is killed.  Other "
6195 "implementations do not change the B<RLIMIT_CPU> soft limit in this manner, "
6196 "and the Linux behavior is probably not standards conformant; portable "
6197 "applications should avoid relying on this Linux-specific behavior.  The "
6198 "Linux-specific B<RLIMIT_RTTIME> limit exhibits the same behavior when the "
6199 "soft limit is encountered."
6200 msgstr ""
6201
6202 #. type: Plain text
6203 #: build/C/man2/getrlimit.2:647
6204 msgid ""
6205 "Kernels before 2.4.22 did not diagnose the error B<EINVAL> for "
6206 "B<setrlimit>()  when I<rlim-E<gt>rlim_cur> was greater than "
6207 "I<rlim-E<gt>rlim_max>."
6208 msgstr ""
6209
6210 #. type: SS
6211 #: build/C/man2/getrlimit.2:647
6212 #, no-wrap
6213 msgid "Representation of \"large\" resource limit values on 32-bit platforms"
6214 msgstr ""
6215
6216 #.  https://bugzilla.kernel.org/show_bug.cgi?id=5042
6217 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=12201
6218 #. type: Plain text
6219 #: build/C/man2/getrlimit.2:678
6220 msgid ""
6221 "The glibc B<getrlimit>()  and B<setrlimit>()  wrapper functions use a 64-bit "
6222 "I<rlim_t> data type, even on 32-bit platforms.  However, the I<rlim_t> data "
6223 "type used in the B<getrlimit>()  and B<setrlimit>()  system calls is a "
6224 "(32-bit)  I<unsigned long>.  Furthermore, in Linux versions before 2.6.36, "
6225 "the kernel represents resource limits on 32-bit platforms as I<unsigned "
6226 "long>.  However, a 32-bit data type is not wide enough.  The most pertinent "
6227 "limit here is B<RLIMIT_FSIZE>, which specifies the maximum size to which a "
6228 "file can grow: to be useful, this limit must be represented using a type "
6229 "that is as wide as the type used to represent file offsets\\(emthat is, as "
6230 "wide as a 64-bit B<off_t> (assuming a program compiled with "
6231 "I<_FILE_OFFSET_BITS=64>)."
6232 msgstr ""
6233
6234 #. type: Plain text
6235 #: build/C/man2/getrlimit.2:688
6236 msgid ""
6237 "To work around this kernel limitation, if a program tried to set a resource "
6238 "limit to a value larger than can be represented in a 32-bit I<unsigned "
6239 "long>, then the glibc B<setrlimit>()  wrapper function silently converted "
6240 "the limit value to B<RLIM_INFINITY>.  In other words, the requested resource "
6241 "limit setting was silently ignored."
6242 msgstr ""
6243
6244 #. type: Plain text
6245 #: build/C/man2/getrlimit.2:690
6246 msgid "This problem was addressed in Linux 2.6.36 with two principal changes:"
6247 msgstr ""
6248
6249 #. type: Plain text
6250 #: build/C/man2/getrlimit.2:693
6251 msgid ""
6252 "the addition of a new kernel representation of resource limits that uses 64 "
6253 "bits, even on 32-bit platforms;"
6254 msgstr ""
6255
6256 #. type: Plain text
6257 #: build/C/man2/getrlimit.2:697
6258 msgid ""
6259 "the addition of the B<prlimit>()  system call, which employs 64-bit values "
6260 "for its resource limit arguments."
6261 msgstr ""
6262
6263 #.  https://www.sourceware.org/bugzilla/show_bug.cgi?id=12201
6264 #. type: Plain text
6265 #: build/C/man2/getrlimit.2:710
6266 msgid ""
6267 "Since version 2.13, glibc works around the limitations of the B<getrlimit>()  "
6268 "and B<setrlimit>()  system calls by implementing B<setrlimit>()  and "
6269 "B<getrlimit>()  as wrapper functions that call B<prlimit>()."
6270 msgstr ""
6271
6272 #. type: Plain text
6273 #: build/C/man2/getrlimit.2:713
6274 msgid "The program below demonstrates the use of B<prlimit>()."
6275 msgstr ""
6276
6277 #. type: Plain text
6278 #: build/C/man2/getrlimit.2:722
6279 #, no-wrap
6280 msgid ""
6281 "#define _GNU_SOURCE\n"
6282 "#define _FILE_OFFSET_BITS 64\n"
6283 "#include E<lt>stdio.hE<gt>\n"
6284 "#include E<lt>time.hE<gt>\n"
6285 "#include E<lt>stdlib.hE<gt>\n"
6286 "#include E<lt>unistd.hE<gt>\n"
6287 "#include E<lt>sys/resource.hE<gt>\n"
6288 msgstr ""
6289
6290 #. type: Plain text
6291 #: build/C/man2/getrlimit.2:725
6292 #, no-wrap
6293 msgid ""
6294 "#define errExit(msg) \tdo { perror(msg); exit(EXIT_FAILURE); \\e\n"
6295 "                        } while (0)\n"
6296 msgstr ""
6297
6298 #. type: Plain text
6299 #: build/C/man2/getrlimit.2:732
6300 #, no-wrap
6301 msgid ""
6302 "int\n"
6303 "main(int argc, char *argv[])\n"
6304 "{\n"
6305 "    struct rlimit old, new;\n"
6306 "    struct rlimit *newp;\n"
6307 "    pid_t pid;\n"
6308 msgstr ""
6309
6310 #. type: Plain text
6311 #: build/C/man2/getrlimit.2:738
6312 #, no-wrap
6313 msgid ""
6314 "    if (!(argc == 2 || argc == 4)) {\n"
6315 "        fprintf(stderr, \"Usage: %s E<lt>pidE<gt> [E<lt>new-soft-limitE<gt> "
6316 "\"\n"
6317 "                \"E<lt>new-hard-limitE<gt>]\\en\", argv[0]);\n"
6318 "        exit(EXIT_FAILURE);\n"
6319 "    }\n"
6320 msgstr ""
6321
6322 #. type: Plain text
6323 #: build/C/man2/getrlimit.2:740
6324 #, no-wrap
6325 msgid "    pid = atoi(argv[1]);        /* PID of target process */\n"
6326 msgstr ""
6327
6328 #. type: Plain text
6329 #: build/C/man2/getrlimit.2:747
6330 #, no-wrap
6331 msgid ""
6332 "    newp = NULL;\n"
6333 "    if (argc == 4) {\n"
6334 "        new.rlim_cur = atoi(argv[2]);\n"
6335 "        new.rlim_max = atoi(argv[3]);\n"
6336 "        newp = &new;\n"
6337 "    }\n"
6338 msgstr ""
6339
6340 #. type: Plain text
6341 #: build/C/man2/getrlimit.2:750
6342 #, no-wrap
6343 msgid ""
6344 "    /* Set CPU time limit of target process; retrieve and display\n"
6345 "       previous limit */\n"
6346 msgstr ""
6347
6348 #. type: Plain text
6349 #: build/C/man2/getrlimit.2:755
6350 #, no-wrap
6351 msgid ""
6352 "    if (prlimit(pid, RLIMIT_CPU, newp, &old) == -1)\n"
6353 "        errExit(\"prlimit-1\");\n"
6354 "    printf(\"Previous limits: soft=%lld; hard=%lld\\en\",\n"
6355 "            (long long) old.rlim_cur, (long long) old.rlim_max);\n"
6356 msgstr ""
6357
6358 #. type: Plain text
6359 #: build/C/man2/getrlimit.2:757
6360 #, no-wrap
6361 msgid "    /* Retrieve and display new CPU time limit */\n"
6362 msgstr ""
6363
6364 #. type: Plain text
6365 #: build/C/man2/getrlimit.2:762
6366 #, no-wrap
6367 msgid ""
6368 "    if (prlimit(pid, RLIMIT_CPU, NULL, &old) == -1)\n"
6369 "        errExit(\"prlimit-2\");\n"
6370 "    printf(\"New limits: soft=%lld; hard=%lld\\en\",\n"
6371 "            (long long) old.rlim_cur, (long long) old.rlim_max);\n"
6372 msgstr ""
6373
6374 #. type: Plain text
6375 #: build/C/man2/getrlimit.2:765 build/C/man7/user_namespaces.7:829
6376 #, no-wrap
6377 msgid ""
6378 "    exit(EXIT_FAILURE);\n"
6379 "}\n"
6380 msgstr ""
6381
6382 #. type: Plain text
6383 #: build/C/man2/getrlimit.2:784
6384 msgid ""
6385 "B<prlimit>(1), B<dup>(2), B<fcntl>(2), B<fork>(2), B<getrusage>(2), "
6386 "B<mlock>(2), B<mmap>(2), B<open>(2), B<quotactl>(2), B<sbrk>(2), "
6387 "B<shmctl>(2), B<malloc>(3), B<sigqueue>(3), B<ulimit>(3), B<core>(5), "
6388 "B<capabilities>(7), B<signal>(7)"
6389 msgstr ""
6390
6391 #. type: TH
6392 #: build/C/man2/getrusage.2:39
6393 #, no-wrap
6394 msgid "GETRUSAGE"
6395 msgstr ""
6396
6397 #. type: TH
6398 #: build/C/man2/getrusage.2:39
6399 #, no-wrap
6400 msgid "2014-05-10"
6401 msgstr ""
6402
6403 #. type: Plain text
6404 #: build/C/man2/getrusage.2:42
6405 msgid "getrusage - get resource usage"
6406 msgstr ""
6407
6408 #. type: Plain text
6409 #: build/C/man2/getrusage.2:48
6410 msgid "B<int getrusage(int >I<who>B<, struct rusage *>I<usage>B<);>"
6411 msgstr ""
6412
6413 #. type: Plain text
6414 #: build/C/man2/getrusage.2:54
6415 msgid ""
6416 "B<getrusage>()  returns resource usage measures for I<who>, which can be one "
6417 "of the following:"
6418 msgstr ""
6419
6420 #. type: TP
6421 #: build/C/man2/getrusage.2:54
6422 #, no-wrap
6423 msgid "B<RUSAGE_SELF>"
6424 msgstr ""
6425
6426 #. type: Plain text
6427 #: build/C/man2/getrusage.2:58
6428 msgid ""
6429 "Return resource usage statistics for the calling process, which is the sum "
6430 "of resources used by all threads in the process."
6431 msgstr ""
6432
6433 #. type: TP
6434 #: build/C/man2/getrusage.2:58
6435 #, no-wrap
6436 msgid "B<RUSAGE_CHILDREN>"
6437 msgstr ""
6438
6439 #. type: Plain text
6440 #: build/C/man2/getrusage.2:65
6441 msgid ""
6442 "Return resource usage statistics for all children of the calling process "
6443 "that have terminated and been waited for.  These statistics will include the "
6444 "resources used by grandchildren, and further removed descendants, if all of "
6445 "the intervening descendants waited on their terminated children."
6446 msgstr ""
6447
6448 #. type: TP
6449 #: build/C/man2/getrusage.2:65
6450 #, no-wrap
6451 msgid "B<RUSAGE_THREAD> (since Linux 2.6.26)"
6452 msgstr ""
6453
6454 #. type: Plain text
6455 #: build/C/man2/getrusage.2:75
6456 msgid ""
6457 "Return resource usage statistics for the calling thread.  The B<_GNU_SOURCE> "
6458 "feature test macro must be defined (before including I<any> header file)  in "
6459 "order to obtain the definition of this constant from "
6460 "I<E<lt>sys/resource.hE<gt>>."
6461 msgstr ""
6462
6463 #. type: Plain text
6464 #: build/C/man2/getrusage.2:79
6465 msgid ""
6466 "The resource usages are returned in the structure pointed to by I<usage>, "
6467 "which has the following form:"
6468 msgstr ""
6469
6470 #. type: Plain text
6471 #: build/C/man2/getrusage.2:100
6472 #, no-wrap
6473 msgid ""
6474 "struct rusage {\n"
6475 "    struct timeval ru_utime; /* user CPU time used */\n"
6476 "    struct timeval ru_stime; /* system CPU time used */\n"
6477 "    long   ru_maxrss;        /* maximum resident set size */\n"
6478 "    long   ru_ixrss;         /* integral shared memory size */\n"
6479 "    long   ru_idrss;         /* integral unshared data size */\n"
6480 "    long   ru_isrss;         /* integral unshared stack size */\n"
6481 "    long   ru_minflt;        /* page reclaims (soft page faults) */\n"
6482 "    long   ru_majflt;        /* page faults (hard page faults) */\n"
6483 "    long   ru_nswap;         /* swaps */\n"
6484 "    long   ru_inblock;       /* block input operations */\n"
6485 "    long   ru_oublock;       /* block output operations */\n"
6486 "    long   ru_msgsnd;        /* IPC messages sent */\n"
6487 "    long   ru_msgrcv;        /* IPC messages received */\n"
6488 "    long   ru_nsignals;      /* signals received */\n"
6489 "    long   ru_nvcsw;         /* voluntary context switches */\n"
6490 "    long   ru_nivcsw;        /* involuntary context switches */\n"
6491 "};\n"
6492 msgstr ""
6493
6494 #. type: Plain text
6495 #: build/C/man2/getrusage.2:108
6496 msgid ""
6497 "Not all fields are completed; unmaintained fields are set to zero by the "
6498 "kernel.  (The unmaintained fields are provided for compatibility with other "
6499 "systems, and because they may one day be supported on Linux.)  The fields "
6500 "are interpreted as follows:"
6501 msgstr ""
6502
6503 #. type: TP
6504 #: build/C/man2/getrusage.2:108
6505 #, no-wrap
6506 msgid "I<ru_utime>"
6507 msgstr ""
6508
6509 #. type: Plain text
6510 #: build/C/man2/getrusage.2:114
6511 msgid ""
6512 "This is the total amount of time spent executing in user mode, expressed in "
6513 "a I<timeval> structure (seconds plus microseconds)."
6514 msgstr ""
6515
6516 #. type: TP
6517 #: build/C/man2/getrusage.2:114
6518 #, no-wrap
6519 msgid "I<ru_stime>"
6520 msgstr ""
6521
6522 #. type: Plain text
6523 #: build/C/man2/getrusage.2:120
6524 msgid ""
6525 "This is the total amount of time spent executing in kernel mode, expressed "
6526 "in a I<timeval> structure (seconds plus microseconds)."
6527 msgstr ""
6528
6529 #. type: TP
6530 #: build/C/man2/getrusage.2:120
6531 #, no-wrap
6532 msgid "I<ru_maxrss> (since Linux 2.6.32)"
6533 msgstr ""
6534
6535 #. type: Plain text
6536 #: build/C/man2/getrusage.2:127
6537 msgid ""
6538 "This is the maximum resident set size used (in kilobytes).  For "
6539 "B<RUSAGE_CHILDREN>, this is the resident set size of the largest child, not "
6540 "the maximum resident set size of the process tree."
6541 msgstr ""
6542
6543 #. type: TP
6544 #: build/C/man2/getrusage.2:127
6545 #, no-wrap
6546 msgid "I<ru_ixrss> (unmaintained)"
6547 msgstr ""
6548
6549 #.  On some systems, this field records the number of signals received.
6550 #. type: Plain text
6551 #: 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
6552 msgid "This field is currently unused on Linux."
6553 msgstr ""
6554
6555 #. type: TP
6556 #: build/C/man2/getrusage.2:133
6557 #, no-wrap
6558 msgid "I<ru_idrss> (unmaintained)"
6559 msgstr ""
6560
6561 #. type: TP
6562 #: build/C/man2/getrusage.2:138
6563 #, no-wrap
6564 msgid "I<ru_isrss> (unmaintained)"
6565 msgstr ""
6566
6567 #. type: TP
6568 #: build/C/man2/getrusage.2:143
6569 #, no-wrap
6570 msgid "I<ru_minflt>"
6571 msgstr ""
6572
6573 #. type: Plain text
6574 #: build/C/man2/getrusage.2:148
6575 msgid ""
6576 "The number of page faults serviced without any I/O activity; here I/O "
6577 "activity is avoided by ``reclaiming'' a page frame from the list of pages "
6578 "awaiting reallocation."
6579 msgstr ""
6580
6581 #. type: TP
6582 #: build/C/man2/getrusage.2:148
6583 #, no-wrap
6584 msgid "I<ru_majflt>"
6585 msgstr ""
6586
6587 #. type: Plain text
6588 #: build/C/man2/getrusage.2:151
6589 msgid "The number of page faults serviced that required I/O activity."
6590 msgstr ""
6591
6592 #. type: TP
6593 #: build/C/man2/getrusage.2:151
6594 #, no-wrap
6595 msgid "I<ru_nswap> (unmaintained)"
6596 msgstr ""
6597
6598 #. type: TP
6599 #: build/C/man2/getrusage.2:155
6600 #, no-wrap
6601 msgid "I<ru_inblock> (since Linux 2.6.22)"
6602 msgstr ""
6603
6604 #. type: Plain text
6605 #: build/C/man2/getrusage.2:158
6606 msgid "The number of times the filesystem had to perform input."
6607 msgstr ""
6608
6609 #. type: TP
6610 #: build/C/man2/getrusage.2:158
6611 #, no-wrap
6612 msgid "I<ru_oublock> (since Linux 2.6.22)"
6613 msgstr ""
6614
6615 #. type: Plain text
6616 #: build/C/man2/getrusage.2:161
6617 msgid "The number of times the filesystem had to perform output."
6618 msgstr ""
6619
6620 #. type: TP
6621 #: build/C/man2/getrusage.2:161
6622 #, no-wrap
6623 msgid "I<ru_msgsnd> (unmaintained)"
6624 msgstr ""
6625
6626 #. type: TP
6627 #: build/C/man2/getrusage.2:167
6628 #, no-wrap
6629 msgid "I<ru_msgrcv> (unmaintained)"
6630 msgstr ""
6631
6632 #. type: TP
6633 #: build/C/man2/getrusage.2:173
6634 #, no-wrap
6635 msgid "I<ru_nsignals> (unmaintained)"
6636 msgstr ""
6637
6638 #. type: TP
6639 #: build/C/man2/getrusage.2:177
6640 #, no-wrap
6641 msgid "I<ru_nvcsw> (since Linux 2.6)"
6642 msgstr ""
6643
6644 #. type: Plain text
6645 #: build/C/man2/getrusage.2:182
6646 msgid ""
6647 "The number of times a context switch resulted due to a process voluntarily "
6648 "giving up the processor before its time slice was completed (usually to "
6649 "await availability of a resource)."
6650 msgstr ""
6651
6652 #. type: TP
6653 #: build/C/man2/getrusage.2:182
6654 #, no-wrap
6655 msgid "I<ru_nivcsw> (since Linux 2.6)"
6656 msgstr ""
6657
6658 #. type: Plain text
6659 #: build/C/man2/getrusage.2:187
6660 msgid ""
6661 "The number of times a context switch resulted due to a higher priority "
6662 "process becoming runnable or because the current process exceeded its time "
6663 "slice."
6664 msgstr ""
6665
6666 #. type: Plain text
6667 #: build/C/man2/getrusage.2:198
6668 msgid "I<usage> points outside the accessible address space."
6669 msgstr ""
6670
6671 #. type: Plain text
6672 #: build/C/man2/getrusage.2:202
6673 msgid "I<who> is invalid."
6674 msgstr ""
6675
6676 #. type: Plain text
6677 #: build/C/man2/getrusage.2:210
6678 msgid ""
6679 "SVr4, 4.3BSD.  POSIX.1-2001 specifies B<getrusage>(), but specifies only the "
6680 "fields I<ru_utime> and I<ru_stime>."
6681 msgstr ""
6682
6683 #. type: Plain text
6684 #: build/C/man2/getrusage.2:213
6685 msgid "B<RUSAGE_THREAD> is Linux-specific."
6686 msgstr ""
6687
6688 #. type: Plain text
6689 #: build/C/man2/getrusage.2:216
6690 msgid "Resource usage metrics are preserved across an B<execve>(2)."
6691 msgstr ""
6692
6693 #. type: Plain text
6694 #: build/C/man2/getrusage.2:224
6695 msgid ""
6696 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
6697 "portability.  (Indeed, I<struct timeval> is defined in "
6698 "I<E<lt>sys/time.hE<gt>>.)"
6699 msgstr ""
6700
6701 #.  See the description of getrusage() in XSH.
6702 #.  A similar statement was also in SUSv2.
6703 #. type: Plain text
6704 #: build/C/man2/getrusage.2:236
6705 msgid ""
6706 "In Linux kernel versions before 2.6.9, if the disposition of B<SIGCHLD> is "
6707 "set to B<SIG_IGN> then the resource usages of child processes are "
6708 "automatically included in the value returned by B<RUSAGE_CHILDREN>, although "
6709 "POSIX.1-2001 explicitly prohibits this.  This nonconformance is rectified in "
6710 "Linux 2.6.9 and later."
6711 msgstr ""
6712
6713 #. type: Plain text
6714 #: build/C/man2/getrusage.2:239
6715 msgid ""
6716 "The structure definition shown at the start of this page was taken from "
6717 "4.3BSD Reno."
6718 msgstr ""
6719
6720 #. type: Plain text
6721 #: build/C/man2/getrusage.2:248
6722 msgid ""
6723 "Ancient systems provided a B<vtimes>()  function with a similar purpose to "
6724 "B<getrusage>().  For backward compatibility, glibc also provides "
6725 "B<vtimes>().  All new applications should be written using B<getrusage>()."
6726 msgstr ""
6727
6728 #. type: Plain text
6729 #: build/C/man2/getrusage.2:253
6730 msgid "See also the description of I</proc/PID/stat> in B<proc>(5)."
6731 msgstr ""
6732
6733 #. type: Plain text
6734 #: build/C/man2/getrusage.2:260
6735 msgid ""
6736 "B<clock_gettime>(2), B<getrlimit>(2), B<times>(2), B<wait>(2), B<wait4>(2), "
6737 "B<clock>(3)"
6738 msgstr ""
6739
6740 #. type: TH
6741 #: build/C/man2/getsid.2:26
6742 #, no-wrap
6743 msgid "GETSID"
6744 msgstr ""
6745
6746 #. type: TH
6747 #: build/C/man2/getsid.2:26
6748 #, no-wrap
6749 msgid "2010-09-26"
6750 msgstr ""
6751
6752 #. type: Plain text
6753 #: build/C/man2/getsid.2:29
6754 msgid "getsid - get session ID"
6755 msgstr ""
6756
6757 #. type: Plain text
6758 #: build/C/man2/getsid.2:33
6759 msgid "B<pid_t getsid(pid_t>I< pid>B<);>"
6760 msgstr ""
6761
6762 #. type: Plain text
6763 #: build/C/man2/getsid.2:42
6764 msgid "B<getsid>():"
6765 msgstr ""
6766
6767 #. type: Plain text
6768 #: build/C/man2/getsid.2:45 build/C/man2/setpgid.2:79
6769 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
6770 msgstr ""
6771
6772 #. type: Plain text
6773 #: build/C/man2/getsid.2:47 build/C/man2/setpgid.2:81
6774 msgid "|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
6775 msgstr ""
6776
6777 #. type: Plain text
6778 #: build/C/man2/getsid.2:58
6779 msgid ""
6780 "I<getsid(0)> returns the session ID of the calling process.  I<getsid(p)> "
6781 "returns the session ID of the process with process ID I<p>.  (The session ID "
6782 "of a process is the process group ID of the session leader.)"
6783 msgstr ""
6784
6785 #. type: Plain text
6786 #: build/C/man2/getsid.2:63
6787 msgid ""
6788 "On success, a session ID is returned.  On error, I<(pid_t)\\ -1> will be "
6789 "returned, and I<errno> is set appropriately."
6790 msgstr ""
6791
6792 #. type: Plain text
6793 #: build/C/man2/getsid.2:70
6794 msgid ""
6795 "A process with process ID I<p> exists, but it is not in the same session as "
6796 "the calling process, and the implementation considers this an error."
6797 msgstr ""
6798
6799 #. type: Plain text
6800 #: build/C/man2/getsid.2:75
6801 msgid "No process with process ID I<p> was found."
6802 msgstr ""
6803
6804 #.  Linux has this system call since Linux 1.3.44.
6805 #.  There is libc support since libc 5.2.19.
6806 #. type: Plain text
6807 #: build/C/man2/getsid.2:79
6808 msgid "This system call is available on Linux since version 2.0."
6809 msgstr ""
6810
6811 #. type: Plain text
6812 #: build/C/man2/getsid.2:81 build/C/man2/setgid.2:73 build/C/man2/setsid.2:70
6813 msgid "SVr4, POSIX.1-2001."
6814 msgstr ""
6815
6816 #. type: Plain text
6817 #: build/C/man2/getsid.2:84
6818 msgid "Linux does not return B<EPERM>."
6819 msgstr ""
6820
6821 #. type: Plain text
6822 #: build/C/man2/getsid.2:88
6823 msgid "B<getpgid>(2), B<setsid>(2), B<credentials>(7)"
6824 msgstr ""
6825
6826 #. type: TH
6827 #: build/C/man2/getuid.2:26
6828 #, no-wrap
6829 msgid "GETUID"
6830 msgstr ""
6831
6832 #. type: Plain text
6833 #: build/C/man2/getuid.2:29
6834 msgid "getuid, geteuid - get user identity"
6835 msgstr ""
6836
6837 #. type: Plain text
6838 #: build/C/man2/getuid.2:35
6839 msgid "B<uid_t getuid(void);>"
6840 msgstr ""
6841
6842 #. type: Plain text
6843 #: build/C/man2/getuid.2:37
6844 msgid "B<uid_t geteuid(void);>"
6845 msgstr ""
6846
6847 #. type: Plain text
6848 #: build/C/man2/getuid.2:40
6849 msgid "B<getuid>()  returns the real user ID of the calling process."
6850 msgstr ""
6851
6852 #. type: Plain text
6853 #: build/C/man2/getuid.2:43
6854 msgid "B<geteuid>()  returns the effective user ID of the calling process."
6855 msgstr ""
6856
6857 #. type: SS
6858 #: build/C/man2/getuid.2:48
6859 #, no-wrap
6860 msgid "History"
6861 msgstr ""
6862
6863 #. type: Plain text
6864 #: build/C/man2/getuid.2:57
6865 msgid ""
6866 "In UNIX\\ V6 the B<getuid>()  call returned I<(euid E<lt>E<lt> 8) + uid>.  "
6867 "UNIX\\ V7 introduced separate calls B<getuid>()  and B<geteuid>()."
6868 msgstr ""
6869
6870 #. type: Plain text
6871 #: build/C/man2/getuid.2:73
6872 msgid ""
6873 "The original Linux B<getuid>()  and B<geteuid>()  system calls supported "
6874 "only 16-bit user IDs.  Subsequently, Linux 2.4 added B<getuid32>()  and "
6875 "B<geteuid32>(), supporting 32-bit IDs.  The glibc B<getuid>()  and "
6876 "B<geteuid>()  wrapper functions transparently deal with the variations "
6877 "across kernel versions."
6878 msgstr ""
6879
6880 #. type: Plain text
6881 #: build/C/man2/getuid.2:78
6882 msgid "B<getresuid>(2), B<setreuid>(2), B<setuid>(2), B<credentials>(7)"
6883 msgstr ""
6884
6885 #. type: TH
6886 #: build/C/man3/group_member.3:25
6887 #, no-wrap
6888 msgid "GROUP_MEMBER"
6889 msgstr ""
6890
6891 #. type: TH
6892 #: build/C/man3/group_member.3:25
6893 #, no-wrap
6894 msgid "2014-03-30"
6895 msgstr ""
6896
6897 #. type: TH
6898 #: build/C/man3/group_member.3:25
6899 #, no-wrap
6900 msgid "GNU"
6901 msgstr ""
6902
6903 #. type: Plain text
6904 #: build/C/man3/group_member.3:28
6905 msgid "group_member - test whether a process is in a group"
6906 msgstr ""
6907
6908 #. type: Plain text
6909 #: build/C/man3/group_member.3:32
6910 msgid "B<int group_member(gid_t >I<gid>B<);>"
6911 msgstr ""
6912
6913 #. type: Plain text
6914 #: build/C/man3/group_member.3:40
6915 msgid "B<group_member>(): _GNU_SOURCE"
6916 msgstr ""
6917
6918 #. type: Plain text
6919 #: build/C/man3/group_member.3:48
6920 msgid ""
6921 "The B<group_member>()  function tests whether any of the caller's "
6922 "supplementary group IDs (as returned by B<getgroups>(2))  matches I<gid>."
6923 msgstr ""
6924
6925 #. type: Plain text
6926 #: build/C/man3/group_member.3:55
6927 msgid ""
6928 "The B<group_member>()  function returns nonzero if any of the caller's "
6929 "supplementary group IDs matches I<gid>, and zero otherwise."
6930 msgstr ""
6931
6932 #. type: Plain text
6933 #: build/C/man3/group_member.3:57
6934 msgid "This function is a nonstandard GNU extension."
6935 msgstr ""
6936
6937 #. type: Plain text
6938 #: build/C/man3/group_member.3:62
6939 msgid "B<getgid>(2), B<getgroups>(2), B<getgrouplist>(3), B<group>(5)"
6940 msgstr ""
6941
6942 #. type: TH
6943 #: build/C/man2/iopl.2:33
6944 #, no-wrap
6945 msgid "IOPL"
6946 msgstr ""
6947
6948 #. type: TH
6949 #: build/C/man2/iopl.2:33
6950 #, no-wrap
6951 msgid "2013-03-15"
6952 msgstr ""
6953
6954 #. type: Plain text
6955 #: build/C/man2/iopl.2:36
6956 msgid "iopl - change I/O privilege level"
6957 msgstr ""
6958
6959 #. type: Plain text
6960 #: build/C/man2/iopl.2:38
6961 msgid "B<#include E<lt>sys/io.hE<gt>>"
6962 msgstr ""
6963
6964 #. type: Plain text
6965 #: build/C/man2/iopl.2:40
6966 msgid "B<int iopl(int >I<level>B<);>"
6967 msgstr ""
6968
6969 #. type: Plain text
6970 #: build/C/man2/iopl.2:45
6971 msgid ""
6972 "B<iopl>()  changes the I/O privilege level of the calling process, as "
6973 "specified by the two least significant bits in I<level>."
6974 msgstr ""
6975
6976 #. type: Plain text
6977 #: build/C/man2/iopl.2:51
6978 msgid ""
6979 "This call is necessary to allow 8514-compatible X servers to run under "
6980 "Linux.  Since these X servers require access to all 65536 I/O ports, the "
6981 "B<ioperm>(2)  call is not sufficient."
6982 msgstr ""
6983
6984 #. type: Plain text
6985 #: build/C/man2/iopl.2:55
6986 msgid ""
6987 "In addition to granting unrestricted I/O port access, running at a higher "
6988 "I/O privilege level also allows the process to disable interrupts.  This "
6989 "will probably crash the system, and is not recommended."
6990 msgstr ""
6991
6992 #. type: Plain text
6993 #: build/C/man2/iopl.2:60
6994 msgid "Permissions are inherited by B<fork>(2)  and B<execve>(2)."
6995 msgstr ""
6996
6997 #. type: Plain text
6998 #: build/C/man2/iopl.2:62
6999 msgid "The I/O privilege level for a normal process is 0."
7000 msgstr ""
7001
7002 #. type: Plain text
7003 #: build/C/man2/iopl.2:66
7004 msgid ""
7005 "This call is mostly for the i386 architecture.  On many other architectures "
7006 "it does not exist or will always return an error."
7007 msgstr ""
7008
7009 #. type: Plain text
7010 #: build/C/man2/iopl.2:76
7011 msgid "I<level> is greater than 3."
7012 msgstr ""
7013
7014 #. type: Plain text
7015 #: build/C/man2/iopl.2:79
7016 msgid "This call is unimplemented."
7017 msgstr ""
7018
7019 #. type: Plain text
7020 #: build/C/man2/iopl.2:87
7021 msgid ""
7022 "The calling process has insufficient privilege to call B<iopl>(); the "
7023 "B<CAP_SYS_RAWIO> capability is required to raise the I/O privilege level "
7024 "above its current value."
7025 msgstr ""
7026
7027 #. type: Plain text
7028 #: build/C/man2/iopl.2:91
7029 msgid ""
7030 "B<iopl>()  is Linux-specific and should not be used in programs that are "
7031 "intended to be portable."
7032 msgstr ""
7033
7034 #. type: Plain text
7035 #: build/C/man2/iopl.2:100
7036 msgid ""
7037 "Libc5 treats it as a system call and has a prototype in "
7038 "I<E<lt>unistd.hE<gt>>.  Glibc1 does not have a prototype.  Glibc2 has a "
7039 "prototype both in I<E<lt>sys/io.hE<gt>> and in I<E<lt>sys/perm.hE<gt>>.  "
7040 "Avoid the latter, it is available on i386 only."
7041 msgstr ""
7042
7043 #. type: Plain text
7044 #: build/C/man2/iopl.2:104
7045 msgid "B<ioperm>(2), B<outb>(2), B<capabilities>(7)"
7046 msgstr ""
7047
7048 #. type: TH
7049 #: build/C/man2/ioprio_set.2:24
7050 #, no-wrap
7051 msgid "IOPRIO_SET"
7052 msgstr ""
7053
7054 #. type: TH
7055 #: build/C/man2/ioprio_set.2:24
7056 #, no-wrap
7057 msgid "2013-02-12"
7058 msgstr ""
7059
7060 #. type: Plain text
7061 #: build/C/man2/ioprio_set.2:27
7062 msgid "ioprio_get, ioprio_set - get/set I/O scheduling class and priority"
7063 msgstr ""
7064
7065 #. type: Plain text
7066 #: build/C/man2/ioprio_set.2:31
7067 #, no-wrap
7068 msgid ""
7069 "B<int ioprio_get(int >I<which>B<, int >I<who>B<);>\n"
7070 "B<int ioprio_set(int >I<which>B<, int >I<who>B<, int >I<ioprio>B<);>\n"
7071 msgstr ""
7072
7073 #. type: Plain text
7074 #: build/C/man2/ioprio_set.2:35
7075 msgid "I<Note>: There are no glibc wrappers for these system calls; see NOTES."
7076 msgstr ""
7077
7078 #. type: Plain text
7079 #: build/C/man2/ioprio_set.2:42
7080 msgid ""
7081 "The B<ioprio_get>()  and B<ioprio_set>()  system calls respectively get and "
7082 "set the I/O scheduling class and priority of one or more threads."
7083 msgstr ""
7084
7085 #. type: Plain text
7086 #: build/C/man2/ioprio_set.2:54
7087 msgid ""
7088 "The I<which> and I<who> arguments identify the thread(s) on which the system "
7089 "calls operate.  The I<which> argument determines how I<who> is interpreted, "
7090 "and has one of the following values:"
7091 msgstr ""
7092
7093 #. type: TP
7094 #: build/C/man2/ioprio_set.2:54
7095 #, no-wrap
7096 msgid "B<IOPRIO_WHO_PROCESS>"
7097 msgstr ""
7098
7099 #. type: Plain text
7100 #: build/C/man2/ioprio_set.2:61
7101 msgid ""
7102 "I<who> is a process ID or thread ID identifying a single process or thread.  "
7103 "If I<who> is 0, then operate on the calling thread."
7104 msgstr ""
7105
7106 #. type: TP
7107 #: build/C/man2/ioprio_set.2:61
7108 #, no-wrap
7109 msgid "B<IOPRIO_WHO_PGRP>"
7110 msgstr ""
7111
7112 #. type: Plain text
7113 #: build/C/man2/ioprio_set.2:68
7114 msgid ""
7115 "I<who> is a process group ID identifying all the members of a process "
7116 "group.  If I<who> is 0, then operate on the process group of which the "
7117 "caller is a member."
7118 msgstr ""
7119
7120 #. type: TP
7121 #: build/C/man2/ioprio_set.2:68
7122 #, no-wrap
7123 msgid "B<IOPRIO_WHO_USER>"
7124 msgstr ""
7125
7126 #.  FIXME . Need to document the behavior when 'who" is specified as 0
7127 #.  See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652443
7128 #. type: Plain text
7129 #: build/C/man2/ioprio_set.2:75
7130 msgid ""
7131 "I<who> is a user ID identifying all of the processes that have a matching "
7132 "real UID."
7133 msgstr ""
7134
7135 #. type: Plain text
7136 #: build/C/man2/ioprio_set.2:98
7137 msgid ""
7138 "If I<which> is specified as B<IOPRIO_WHO_PGRP> or B<IOPRIO_WHO_USER> when "
7139 "calling B<ioprio_get>(), and more than one process matches I<who>, then the "
7140 "returned priority will be the highest one found among all of the matching "
7141 "processes.  One priority is said to be higher than another one if it belongs "
7142 "to a higher priority class (B<IOPRIO_CLASS_RT> is the highest priority "
7143 "class; B<IOPRIO_CLASS_IDLE> is the lowest)  or if it belongs to the same "
7144 "priority class as the other process but has a higher priority level (a lower "
7145 "priority number means a higher priority level)."
7146 msgstr ""
7147
7148 #. type: Plain text
7149 #: build/C/man2/ioprio_set.2:108
7150 msgid ""
7151 "The I<ioprio> argument given to B<ioprio_set>()  is a bit mask that "
7152 "specifies both the scheduling class and the priority to be assigned to the "
7153 "target process(es).  The following macros are used for assembling and "
7154 "dissecting I<ioprio> values:"
7155 msgstr ""
7156
7157 #. type: TP
7158 #: build/C/man2/ioprio_set.2:108
7159 #, no-wrap
7160 msgid "B<IOPRIO_PRIO_VALUE(>I<class>B<, >I<data>B<)>"
7161 msgstr ""
7162
7163 #. type: Plain text
7164 #: build/C/man2/ioprio_set.2:117
7165 msgid ""
7166 "Given a scheduling I<class> and priority (I<data>), this macro combines the "
7167 "two values to produce an I<ioprio> value, which is returned as the result of "
7168 "the macro."
7169 msgstr ""
7170
7171 #. type: TP
7172 #: build/C/man2/ioprio_set.2:117
7173 #, no-wrap
7174 msgid "B<IOPRIO_PRIO_CLASS(>I<mask>B<)>"
7175 msgstr ""
7176
7177 #. type: Plain text
7178 #: build/C/man2/ioprio_set.2:129
7179 msgid ""
7180 "Given I<mask> (an I<ioprio> value), this macro returns its I/O class "
7181 "component, that is, one of the values B<IOPRIO_CLASS_RT>, "
7182 "B<IOPRIO_CLASS_BE>, or B<IOPRIO_CLASS_IDLE>."
7183 msgstr ""
7184
7185 #. type: TP
7186 #: build/C/man2/ioprio_set.2:129
7187 #, no-wrap
7188 msgid "B<IOPRIO_PRIO_DATA(>I<mask>B<)>"
7189 msgstr ""
7190
7191 #. type: Plain text
7192 #: build/C/man2/ioprio_set.2:138
7193 msgid ""
7194 "Given I<mask> (an I<ioprio> value), this macro returns its priority "
7195 "(I<data>)  component."
7196 msgstr ""
7197
7198 #. type: Plain text
7199 #: build/C/man2/ioprio_set.2:141
7200 msgid ""
7201 "See the NOTES section for more information on scheduling classes and "
7202 "priorities."
7203 msgstr ""
7204
7205 #. type: Plain text
7206 #: build/C/man2/ioprio_set.2:149
7207 msgid ""
7208 "I/O priorities are supported for reads and for synchronous (B<O_DIRECT>, "
7209 "B<O_SYNC>)  writes.  I/O priorities are not supported for asynchronous "
7210 "writes because they are issued outside the context of the program dirtying "
7211 "the memory, and thus program-specific priorities do not apply."
7212 msgstr ""
7213
7214 #. type: Plain text
7215 #: build/C/man2/ioprio_set.2:162
7216 msgid ""
7217 "On success, B<ioprio_get>()  returns the I<ioprio> value of the process with "
7218 "highest I/O priority of any of the processes that match the criteria "
7219 "specified in I<which> and I<who>.  On error, -1 is returned, and I<errno> is "
7220 "set to indicate the error."
7221 msgstr ""
7222
7223 #. type: Plain text
7224 #: build/C/man2/ioprio_set.2:169
7225 msgid ""
7226 "On success, B<ioprio_set>()  returns 0.  On error, -1 is returned, and "
7227 "I<errno> is set to indicate the error."
7228 msgstr ""
7229
7230 #. type: Plain text
7231 #: build/C/man2/ioprio_set.2:179
7232 msgid ""
7233 "Invalid value for I<which> or I<ioprio>.  Refer to the NOTES section for "
7234 "available scheduler classes and priority levels for I<ioprio>."
7235 msgstr ""
7236
7237 #. type: Plain text
7238 #: build/C/man2/ioprio_set.2:187
7239 msgid ""
7240 "The calling process does not have the privilege needed to assign this "
7241 "I<ioprio> to the specified process(es).  See the NOTES section for more "
7242 "information on required privileges for B<ioprio_set>()."
7243 msgstr ""
7244
7245 #. type: Plain text
7246 #: build/C/man2/ioprio_set.2:193
7247 msgid ""
7248 "No process(es) could be found that matched the specification in I<which> and "
7249 "I<who>."
7250 msgstr ""
7251
7252 #. type: Plain text
7253 #: build/C/man2/ioprio_set.2:196
7254 msgid "These system calls have been available on Linux since kernel 2.6.13."
7255 msgstr ""
7256
7257 #. type: Plain text
7258 #: build/C/man2/ioprio_set.2:201
7259 msgid ""
7260 "Glibc does not provide a wrapper for these system calls; call them using "
7261 "B<syscall>(2)."
7262 msgstr ""
7263
7264 #. type: Plain text
7265 #: build/C/man2/ioprio_set.2:220
7266 msgid ""
7267 "Two or more processes or threads can share an I/O context.  This will be the "
7268 "case when B<clone>(2)  was called with the B<CLONE_IO> flag.  However, by "
7269 "default, the distinct threads of a process will B<not> share the same I/O "
7270 "context.  This means that if you want to change the I/O priority of all "
7271 "threads in a process, you may need to call B<ioprio_set>()  on each of the "
7272 "threads.  The thread ID that you would need for this operation is the one "
7273 "that is returned by B<gettid>(2)  or B<clone>(2)."
7274 msgstr ""
7275
7276 #. type: Plain text
7277 #: build/C/man2/ioprio_set.2:225
7278 msgid ""
7279 "These system calls have an effect only when used in conjunction with an I/O "
7280 "scheduler that supports I/O priorities.  As at kernel 2.6.17 the only such "
7281 "scheduler is the Completely Fair Queuing (CFQ) I/O scheduler."
7282 msgstr ""
7283
7284 #. type: SS
7285 #: build/C/man2/ioprio_set.2:225
7286 #, no-wrap
7287 msgid "Selecting an I/O scheduler"
7288 msgstr ""
7289
7290 #. type: Plain text
7291 #: build/C/man2/ioprio_set.2:229
7292 msgid ""
7293 "I/O Schedulers are selected on a per-device basis via the special file "
7294 "I</sys/block/E<lt>deviceE<gt>/queue/scheduler>."
7295 msgstr ""
7296
7297 #. type: Plain text
7298 #: build/C/man2/ioprio_set.2:235
7299 msgid ""
7300 "One can view the current I/O scheduler via the I</sys> filesystem.  For "
7301 "example, the following command displays a list of all schedulers currently "
7302 "loaded in the kernel:"
7303 msgstr ""
7304
7305 #. type: Plain text
7306 #: build/C/man2/ioprio_set.2:240
7307 #, no-wrap
7308 msgid ""
7309 "$B< cat /sys/block/hda/queue/scheduler>\n"
7310 "noop anticipatory deadline [cfq]\n"
7311 msgstr ""
7312
7313 #. type: Plain text
7314 #: build/C/man2/ioprio_set.2:254
7315 msgid ""
7316 "The scheduler surrounded by brackets is the one actually in use for the "
7317 "device (I<hda> in the example).  Setting another scheduler is done by "
7318 "writing the name of the new scheduler to this file.  For example, the "
7319 "following command will set the scheduler for the I<hda> device to I<cfq>:"
7320 msgstr ""
7321
7322 #. type: Plain text
7323 #: build/C/man2/ioprio_set.2:260
7324 #, no-wrap
7325 msgid ""
7326 "$B< su>\n"
7327 "Password:\n"
7328 "#B< echo cfq E<gt> /sys/block/hda/queue/scheduler>\n"
7329 msgstr ""
7330
7331 #. type: SS
7332 #: build/C/man2/ioprio_set.2:262
7333 #, no-wrap
7334 msgid "The Completely Fair Queuing (CFQ) I/O scheduler"
7335 msgstr ""
7336
7337 #. type: Plain text
7338 #: build/C/man2/ioprio_set.2:268
7339 msgid ""
7340 "Since v3 (aka CFQ Time Sliced) CFQ implements I/O nice levels similar to "
7341 "those of CPU scheduling.  These nice levels are grouped in three scheduling "
7342 "classes each one containing one or more priority levels:"
7343 msgstr ""
7344
7345 #. type: TP
7346 #: build/C/man2/ioprio_set.2:268
7347 #, no-wrap
7348 msgid "B<IOPRIO_CLASS_RT> (1)"
7349 msgstr ""
7350
7351 #. type: Plain text
7352 #: build/C/man2/ioprio_set.2:283
7353 msgid ""
7354 "This is the real-time I/O class.  This scheduling class is given higher "
7355 "priority than any other class: processes from this class are given first "
7356 "access to the disk every time.  Thus this I/O class needs to be used with "
7357 "some care: one I/O real-time process can starve the entire system.  Within "
7358 "the real-time class, there are 8 levels of class data (priority) that "
7359 "determine exactly how much time this process needs the disk for on each "
7360 "service.  The highest real-time priority level is 0; the lowest is 7.  In "
7361 "the future this might change to be more directly mappable to performance, by "
7362 "passing in a desired data rate instead."
7363 msgstr ""
7364
7365 #. type: TP
7366 #: build/C/man2/ioprio_set.2:283
7367 #, no-wrap
7368 msgid "B<IOPRIO_CLASS_BE> (2)"
7369 msgstr ""
7370
7371 #. type: Plain text
7372 #: build/C/man2/ioprio_set.2:296
7373 msgid ""
7374 "This is the best-effort scheduling class, which is the default for any "
7375 "process that hasn't set a specific I/O priority.  The class data (priority) "
7376 "determines how much I/O bandwidth the process will get.  Best-effort "
7377 "priority levels are analogous to CPU nice values (see B<getpriority>(2)).  "
7378 "The priority level determines a priority relative to other processes in the "
7379 "best-effort scheduling class.  Priority levels range from 0 (highest) to 7 "
7380 "(lowest)."
7381 msgstr ""
7382
7383 #. type: TP
7384 #: build/C/man2/ioprio_set.2:296
7385 #, no-wrap
7386 msgid "B<IOPRIO_CLASS_IDLE> (3)"
7387 msgstr ""
7388
7389 #. type: Plain text
7390 #: build/C/man2/ioprio_set.2:305
7391 msgid ""
7392 "This is the idle scheduling class.  Processes running at this level get I/O "
7393 "time only when no-one else needs the disk.  The idle class has no class "
7394 "data.  Attention is required when assigning this priority class to a "
7395 "process, since it may become starved if higher priority processes are "
7396 "constantly accessing the disk."
7397 msgstr ""
7398
7399 #. type: Plain text
7400 #: build/C/man2/ioprio_set.2:309
7401 msgid ""
7402 "Refer to I<Documentation/block/ioprio.txt> for more information on the CFQ "
7403 "I/O Scheduler and an example program."
7404 msgstr ""
7405
7406 #. type: SS
7407 #: build/C/man2/ioprio_set.2:309
7408 #, no-wrap
7409 msgid "Required permissions to set I/O priorities"
7410 msgstr ""
7411
7412 #. type: Plain text
7413 #: build/C/man2/ioprio_set.2:312
7414 msgid ""
7415 "Permission to change a process's priority is granted or denied based on two "
7416 "assertions:"
7417 msgstr ""
7418
7419 #. type: TP
7420 #: build/C/man2/ioprio_set.2:312
7421 #, no-wrap
7422 msgid "B<Process ownership>"
7423 msgstr ""
7424
7425 #. type: Plain text
7426 #: build/C/man2/ioprio_set.2:320
7427 msgid ""
7428 "An unprivileged process may set only the I/O priority of a process whose "
7429 "real UID matches the real or effective UID of the calling process.  A "
7430 "process which has the B<CAP_SYS_NICE> capability can change the priority of "
7431 "any process."
7432 msgstr ""
7433
7434 #. type: TP
7435 #: build/C/man2/ioprio_set.2:320
7436 #, no-wrap
7437 msgid "B<What is the desired priority>"
7438 msgstr ""
7439
7440 #. type: Plain text
7441 #: build/C/man2/ioprio_set.2:332
7442 msgid ""
7443 "Attempts to set very high priorities (B<IOPRIO_CLASS_RT>)  require the "
7444 "B<CAP_SYS_ADMIN> capability.  Kernel versions up to 2.6.24 also required "
7445 "B<CAP_SYS_ADMIN> to set a very low priority (B<IOPRIO_CLASS_IDLE>), but "
7446 "since Linux 2.6.25, this is no longer required."
7447 msgstr ""
7448
7449 #. type: Plain text
7450 #: build/C/man2/ioprio_set.2:337
7451 msgid ""
7452 "A call to B<ioprio_set>()  must follow both rules, or the call will fail "
7453 "with the error B<EPERM>."
7454 msgstr ""
7455
7456 #.  6 May 07: Bug report raised:
7457 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=4464
7458 #.  Ulrich Drepper replied that he wasn't going to add these
7459 #.  to glibc.
7460 #. type: Plain text
7461 #: build/C/man2/ioprio_set.2:346
7462 msgid ""
7463 "Glibc does not yet provide a suitable header file defining the function "
7464 "prototypes and macros described on this page.  Suitable definitions can be "
7465 "found in I<linux/ioprio.h>."
7466 msgstr ""
7467
7468 #. type: Plain text
7469 #: build/C/man2/ioprio_set.2:351
7470 msgid "B<ionice>(1), B<getpriority>(2), B<open>(2), B<capabilities>(7)"
7471 msgstr ""
7472
7473 #. type: Plain text
7474 #: build/C/man2/ioprio_set.2:354
7475 msgid "I<Documentation/block/ioprio.txt> in the Linux kernel source tree"
7476 msgstr ""
7477
7478 #. type: TH
7479 #: build/C/man2/ipc.2:25
7480 #, no-wrap
7481 msgid "IPC"
7482 msgstr ""
7483
7484 #. type: TH
7485 #: build/C/man2/ipc.2:25
7486 #, no-wrap
7487 msgid "2012-10-16"
7488 msgstr ""
7489
7490 #. type: Plain text
7491 #: build/C/man2/ipc.2:28
7492 msgid "ipc - System V IPC system calls"
7493 msgstr ""
7494
7495 #. type: Plain text
7496 #: build/C/man2/ipc.2:33
7497 #, no-wrap
7498 msgid ""
7499 "B<int ipc(unsigned int >I<call>B<, int >I<first>B<, int >I<second>B<, int "
7500 ">I<third>B<,>\n"
7501 "B<        void *>I<ptr>B<, long >I<fifth>B<);>\n"
7502 msgstr ""
7503
7504 #. type: Plain text
7505 #: build/C/man2/ipc.2:41
7506 msgid ""
7507 "B<ipc>()  is a common kernel entry point for the System\\ V IPC calls for "
7508 "messages, semaphores, and shared memory.  I<call> determines which IPC "
7509 "function to invoke; the other arguments are passed through to the "
7510 "appropriate call."
7511 msgstr ""
7512
7513 #. type: Plain text
7514 #: build/C/man2/ipc.2:45
7515 msgid ""
7516 "User programs should call the appropriate functions by their usual names.  "
7517 "Only standard library implementors and kernel hackers need to know about "
7518 "B<ipc>()."
7519 msgstr ""
7520
7521 #. type: Plain text
7522 #: build/C/man2/ipc.2:49
7523 msgid ""
7524 "B<ipc>()  is Linux-specific, and should not be used in programs intended to "
7525 "be portable."
7526 msgstr ""
7527
7528 #. type: Plain text
7529 #: build/C/man2/ipc.2:57
7530 msgid ""
7531 "On some architectures\\(emfor example x86-64 and ARM\\(emthere is no "
7532 "B<ipc>()  system call; instead B<msgctl>(2), B<semctl>(2), B<shmctl>(2), and "
7533 "so on really are implemented as separate system calls."
7534 msgstr ""
7535
7536 #. type: Plain text
7537 #: build/C/man2/ipc.2:70
7538 msgid ""
7539 "B<msgctl>(2), B<msgget>(2), B<msgrcv>(2), B<msgsnd>(2), B<semctl>(2), "
7540 "B<semget>(2), B<semop>(2), B<semtimedop>(2), B<shmat>(2), B<shmctl>(2), "
7541 "B<shmdt>(2), B<shmget>(2)"
7542 msgstr ""
7543
7544 #. type: TH
7545 #: build/C/man7/namespaces.7:27
7546 #, no-wrap
7547 msgid "NAMESPACES"
7548 msgstr ""
7549
7550 #. type: Plain text
7551 #: build/C/man7/namespaces.7:30
7552 msgid "namespaces - overview of Linux namespaces"
7553 msgstr ""
7554
7555 #. type: Plain text
7556 #: build/C/man7/namespaces.7:37
7557 msgid ""
7558 "A namespace wraps a global system resource in an abstraction that makes it "
7559 "appear to the processes within the namespace that they have their own "
7560 "isolated instance of the global resource.  Changes to the global resource "
7561 "are visible to other processes that are members of the namespace, but are "
7562 "invisible to other processes.  One use of namespaces is to implement "
7563 "containers."
7564 msgstr ""
7565
7566 #. type: Plain text
7567 #: build/C/man7/namespaces.7:39
7568 msgid "Linux provides the following namespaces:"
7569 msgstr ""
7570
7571 #. type: tbl table
7572 #: build/C/man7/namespaces.7:42
7573 #, no-wrap
7574 msgid "Namespace\tConstant\tIsolates\n"
7575 msgstr ""
7576
7577 #. type: tbl table
7578 #: build/C/man7/namespaces.7:43
7579 #, no-wrap
7580 msgid "IPC\tCLONE_NEWIPC\tSystem V IPC, POSIX message queues\n"
7581 msgstr ""
7582
7583 #. type: tbl table
7584 #: build/C/man7/namespaces.7:44
7585 #, no-wrap
7586 msgid "Network\tCLONE_NEWNET\tNetwork devices, stacks, ports, etc.\n"
7587 msgstr ""
7588
7589 #. type: tbl table
7590 #: build/C/man7/namespaces.7:45
7591 #, no-wrap
7592 msgid "Mount\tCLONE_NEWNS\tMount points\n"
7593 msgstr ""
7594
7595 #. type: tbl table
7596 #: build/C/man7/namespaces.7:46
7597 #, no-wrap
7598 msgid "PID\tCLONE_NEWPID\tProcess IDs\n"
7599 msgstr ""
7600
7601 #. type: tbl table
7602 #: build/C/man7/namespaces.7:47
7603 #, no-wrap
7604 msgid "User\tCLONE_NEWUSER\tUser and group IDs\n"
7605 msgstr ""
7606
7607 #. type: tbl table
7608 #: build/C/man7/namespaces.7:48
7609 #, no-wrap
7610 msgid "UTS\tCLONE_NEWUTS\tHostname and NIS domain name\n"
7611 msgstr ""
7612
7613 #
7614 #.  ==================== The namespaces API ====================
7615 #. type: Plain text
7616 #: build/C/man7/namespaces.7:57
7617 msgid ""
7618 "This page describes the various namespaces and the associated I</proc> "
7619 "files, and summarizes the APIs for working with namespaces."
7620 msgstr ""
7621
7622 #. type: SS
7623 #: build/C/man7/namespaces.7:57
7624 #, no-wrap
7625 msgid "The namespaces API"
7626 msgstr ""
7627
7628 #. type: Plain text
7629 #: build/C/man7/namespaces.7:62
7630 msgid ""
7631 "As well as various I</proc> files described below, the namespaces API "
7632 "includes the following system calls:"
7633 msgstr ""
7634
7635 #. type: TP
7636 #: build/C/man7/namespaces.7:62
7637 #, no-wrap
7638 msgid "B<clone>(2)"
7639 msgstr ""
7640
7641 #. type: Plain text
7642 #: build/C/man7/namespaces.7:75
7643 msgid ""
7644 "The B<clone>(2)  system call creates a new process.  If the I<flags> "
7645 "argument of the call specifies one or more of the B<CLONE_NEW*> flags listed "
7646 "below, then new namespaces are created for each flag, and the child process "
7647 "is made a member of those namespaces.  (This system call also implements a "
7648 "number of features unrelated to namespaces.)"
7649 msgstr ""
7650
7651 #. type: TP
7652 #: build/C/man7/namespaces.7:75
7653 #, no-wrap
7654 msgid "B<setns>(2)"
7655 msgstr ""
7656
7657 #. type: Plain text
7658 #: build/C/man7/namespaces.7:84
7659 msgid ""
7660 "The B<setns>(2)  system call allows the calling process to join an existing "
7661 "namespace.  The namespace to join is specified via a file descriptor that "
7662 "refers to one of the I</proc/[pid]/ns> files described below."
7663 msgstr ""
7664
7665 #. type: TP
7666 #: build/C/man7/namespaces.7:84
7667 #, no-wrap
7668 msgid "B<unshare>(2)"
7669 msgstr ""
7670
7671 #. type: Plain text
7672 #: build/C/man7/namespaces.7:97
7673 msgid ""
7674 "The B<unshare>(2)  system call moves the calling process to a new "
7675 "namespace.  If the I<flags> argument of the call specifies one or more of "
7676 "the B<CLONE_NEW*> flags listed below, then new namespaces are created for "
7677 "each flag, and the calling process is made a member of those namespaces.  "
7678 "(This system call also implements a number of features unrelated to "
7679 "namespaces.)"
7680 msgstr ""
7681
7682 #
7683 #.  ==================== The /proc/[pid]/ns/ directory ====================
7684 #. type: Plain text
7685 #: build/C/man7/namespaces.7:110
7686 msgid ""
7687 "Creation of new namespaces using B<clone>(2)  and B<unshare>(2)  in most "
7688 "cases requires the B<CAP_SYS_ADMIN> capability.  User namespaces are the "
7689 "exception: since Linux 3.8, no privilege is required to create a user "
7690 "namespace."
7691 msgstr ""
7692
7693 #. type: SS
7694 #: build/C/man7/namespaces.7:110
7695 #, no-wrap
7696 msgid "The /proc/[pid]/ns/ directory"
7697 msgstr ""
7698
7699 #.  See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
7700 #. type: Plain text
7701 #: build/C/man7/namespaces.7:117
7702 msgid ""
7703 "Each process has a I</proc/[pid]/ns/> subdirectory containing one entry for "
7704 "each namespace that supports being manipulated by B<setns>(2):"
7705 msgstr ""
7706
7707 #. type: Plain text
7708 #: build/C/man7/namespaces.7:128
7709 #, no-wrap
7710 msgid ""
7711 "$ B<ls -l /proc/$$/ns>\n"
7712 "total 0\n"
7713 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 ipc -E<gt> ipc:[4026531839]\n"
7714 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 mnt -E<gt> mnt:[4026531840]\n"
7715 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 net -E<gt> net:[4026531956]\n"
7716 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 pid -E<gt> pid:[4026531836]\n"
7717 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 user -E<gt> user:[4026531837]\n"
7718 "lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 uts -E<gt> uts:[4026531838]\n"
7719 msgstr ""
7720
7721 #. type: Plain text
7722 #: build/C/man7/namespaces.7:138
7723 msgid ""
7724 "Bind mounting (see B<mount>(2))  one of the files in this directory to "
7725 "somewhere else in the filesystem keeps the corresponding namespace of the "
7726 "process specified by I<pid> alive even if all processes currently in the "
7727 "namespace terminate."
7728 msgstr ""
7729
7730 #. type: Plain text
7731 #: build/C/man7/namespaces.7:149
7732 msgid ""
7733 "Opening one of the files in this directory (or a file that is bind mounted "
7734 "to one of these files)  returns a file handle for the corresponding "
7735 "namespace of the process specified by I<pid>.  As long as this file "
7736 "descriptor remains open, the namespace will remain alive, even if all "
7737 "processes in the namespace terminate.  The file descriptor can be passed to "
7738 "B<setns>(2)."
7739 msgstr ""
7740
7741 #. type: Plain text
7742 #: build/C/man7/namespaces.7:160
7743 msgid ""
7744 "In Linux 3.7 and earlier, these files were visible as hard links.  Since "
7745 "Linux 3.8, they appear as symbolic links.  If two processes are in the same "
7746 "namespace, then the inode numbers of their I</proc/[pid]/ns/xxx> symbolic "
7747 "links will be the same; an application can check this using the "
7748 "I<stat.st_ino> field returned by B<stat>(2).  The content of this symbolic "
7749 "link is a string containing the namespace type and inode number as in the "
7750 "following example:"
7751 msgstr ""
7752
7753 #. type: Plain text
7754 #: build/C/man7/namespaces.7:165
7755 #, no-wrap
7756 msgid ""
7757 "$ B<readlink /proc/$$/ns/uts>\n"
7758 "uts:[4026531838]\n"
7759 msgstr ""
7760
7761 #. type: Plain text
7762 #: build/C/man7/namespaces.7:169
7763 msgid "The files in this subdirectory are as follows:"
7764 msgstr ""
7765
7766 #. type: TP
7767 #: build/C/man7/namespaces.7:169
7768 #, no-wrap
7769 msgid "I</proc/[pid]/ns/ipc> (since Linux 3.0)"
7770 msgstr ""
7771
7772 #. type: Plain text
7773 #: build/C/man7/namespaces.7:172
7774 msgid "This file is a handle for the IPC namespace of the process."
7775 msgstr ""
7776
7777 #. type: TP
7778 #: build/C/man7/namespaces.7:172
7779 #, no-wrap
7780 msgid "I</proc/[pid]/ns/mnt> (since Linux 3.8)"
7781 msgstr ""
7782
7783 #. type: Plain text
7784 #: build/C/man7/namespaces.7:175
7785 msgid "This file is a handle for the mount namespace of the process."
7786 msgstr ""
7787
7788 #. type: TP
7789 #: build/C/man7/namespaces.7:175
7790 #, no-wrap
7791 msgid "I</proc/[pid]/ns/net> (since Linux 3.0)"
7792 msgstr ""
7793
7794 #. type: Plain text
7795 #: build/C/man7/namespaces.7:178
7796 msgid "This file is a handle for the network namespace of the process."
7797 msgstr ""
7798
7799 #. type: TP
7800 #: build/C/man7/namespaces.7:178
7801 #, no-wrap
7802 msgid "I</proc/[pid]/ns/pid> (since Linux 3.8)"
7803 msgstr ""
7804
7805 #. type: Plain text
7806 #: build/C/man7/namespaces.7:181
7807 msgid "This file is a handle for the PID namespace of the process."
7808 msgstr ""
7809
7810 #. type: TP
7811 #: build/C/man7/namespaces.7:181
7812 #, no-wrap
7813 msgid "I</proc/[pid]/ns/user> (since Linux 3.8)"
7814 msgstr ""
7815
7816 #. type: Plain text
7817 #: build/C/man7/namespaces.7:184
7818 msgid "This file is a handle for the user namespace of the process."
7819 msgstr ""
7820
7821 #. type: TP
7822 #: build/C/man7/namespaces.7:184
7823 #, no-wrap
7824 msgid "I</proc/[pid]/ns/uts> (since Linux 3.0)"
7825 msgstr ""
7826
7827 #
7828 #.  ==================== IPC namespaces ====================
7829 #. type: Plain text
7830 #: build/C/man7/namespaces.7:190
7831 msgid "This file is a handle for the UTS namespace of the process."
7832 msgstr ""
7833
7834 #. type: SS
7835 #: build/C/man7/namespaces.7:190
7836 #, no-wrap
7837 msgid "IPC namespaces (CLONE_NEWIPC)"
7838 msgstr ""
7839
7840 #.  commit 7eafd7c74c3f2e67c27621b987b28397110d643f
7841 #.  https://lwn.net/Articles/312232/
7842 #. type: Plain text
7843 #: build/C/man7/namespaces.7:202
7844 msgid ""
7845 "IPC namespaces isolate certain IPC resources, namely, System V IPC objects "
7846 "(see B<svipc>(7))  and (since Linux 2.6.30)  POSIX message queues (see "
7847 "B<mq_overview>(7)).  The common characteristic of these IPC mechanisms is "
7848 "that IPC objects are identified by mechanisms other than filesystem "
7849 "pathnames."
7850 msgstr ""
7851
7852 #. type: Plain text
7853 #: build/C/man7/namespaces.7:208
7854 msgid ""
7855 "Each IPC namespace has its own set of System V IPC identifiers and its own "
7856 "POSIX message queue filesystem.  Objects created in an IPC namespace are "
7857 "visible to all other processes that are members of that namespace, but are "
7858 "not visible to processes in other IPC namespaces."
7859 msgstr ""
7860
7861 #. type: Plain text
7862 #: build/C/man7/namespaces.7:212
7863 msgid "The following I</proc> interfaces are distinct in each IPC namespace:"
7864 msgstr ""
7865
7866 #. type: Plain text
7867 #: build/C/man7/namespaces.7:215
7868 msgid "The POSIX message queue interfaces in I</proc/sys/fs/mqueue>."
7869 msgstr ""
7870
7871 #. type: Plain text
7872 #: build/C/man7/namespaces.7:228
7873 msgid ""
7874 "The System V IPC interfaces in I</proc/sys/kernel>, namely: I<msgmax>, "
7875 "I<msgmnb>, I<msgmni>, I<sem>, I<shmall>, I<shmmax>, I<shmmni>, and "
7876 "I<shm_rmid_forced>."
7877 msgstr ""
7878
7879 #. type: Plain text
7880 #: build/C/man7/namespaces.7:231
7881 msgid "The System V IPC interfaces in I</proc/sysvipc>."
7882 msgstr ""
7883
7884 #. type: Plain text
7885 #: build/C/man7/namespaces.7:235
7886 msgid ""
7887 "When an IPC namespace is destroyed (i.e., when the last process that is a "
7888 "member of the namespace terminates), all IPC objects in the namespace are "
7889 "automatically destroyed."
7890 msgstr ""
7891
7892 #
7893 #.  ==================== Network namespaces ====================
7894 #. type: Plain text
7895 #: build/C/man7/namespaces.7:242
7896 msgid ""
7897 "Use of IPC namespaces requires a kernel that is configured with the "
7898 "B<CONFIG_IPC_NS> option."
7899 msgstr ""
7900
7901 #. type: SS
7902 #: build/C/man7/namespaces.7:242
7903 #, no-wrap
7904 msgid "Network namespaces (CLONE_NEWNET)"
7905 msgstr ""
7906
7907 #.  FIXME Add pointer to veth(4) page when it is eventually completed
7908 #. type: Plain text
7909 #: build/C/man7/namespaces.7:257
7910 msgid ""
7911 "Network namespaces provide isolation of the system resources associated with "
7912 "networking: network devices, IPv4 and IPv6 protocol stacks, IP routing "
7913 "tables, firewalls, the I</proc/net> directory, the I</sys/class/net> "
7914 "directory, port numbers (sockets), and so on.  A physical network device can "
7915 "live in exactly one network namespace.  A virtual network device (\"veth\") "
7916 "pair provides a pipe-like abstraction that can be used to create tunnels "
7917 "between network namespaces, and can be used to create a bridge to a physical "
7918 "network device in another namespace."
7919 msgstr ""
7920
7921 #. type: Plain text
7922 #: build/C/man7/namespaces.7:262
7923 msgid ""
7924 "When a network namespace is freed (i.e., when the last process in the "
7925 "namespace terminates), its physical network devices are moved back to the "
7926 "initial network namespace (not to the parent of the process)."
7927 msgstr ""
7928
7929 #
7930 #.  ==================== Mount namespaces ====================
7931 #. type: Plain text
7932 #: build/C/man7/namespaces.7:269
7933 msgid ""
7934 "Use of network namespaces requires a kernel that is configured with the "
7935 "B<CONFIG_NET_NS> option."
7936 msgstr ""
7937
7938 #. type: SS
7939 #: build/C/man7/namespaces.7:269
7940 #, no-wrap
7941 msgid "Mount namespaces (CLONE_NEWNS)"
7942 msgstr ""
7943
7944 #. type: Plain text
7945 #: build/C/man7/namespaces.7:277
7946 msgid ""
7947 "Mount namespaces isolate the set of filesystem mount points, meaning that "
7948 "processes in different mount namespaces can have different views of the "
7949 "filesystem hierarchy.  The set of mounts in a mount namespace is modified "
7950 "using B<mount>(2)  and B<umount>(2)."
7951 msgstr ""
7952
7953 #. type: Plain text
7954 #: build/C/man7/namespaces.7:294
7955 msgid ""
7956 "The I</proc/[pid]/mounts> file (present since Linux 2.4.19)  lists all the "
7957 "filesystems currently mounted in the process's mount namespace.  The format "
7958 "of this file is documented in B<fstab>(5).  Since kernel version 2.6.15, "
7959 "this file is pollable: after opening the file for reading, a change in this "
7960 "file (i.e., a filesystem mount or unmount) causes B<select>(2)  to mark the "
7961 "file descriptor as readable, and B<poll>(2)  and B<epoll_wait>(2)  mark the "
7962 "file as having an error condition."
7963 msgstr ""
7964
7965 #. type: Plain text
7966 #: build/C/man7/namespaces.7:302
7967 msgid ""
7968 "The I</proc/[pid]/mountstats> file (present since Linux 2.6.17)  exports "
7969 "information (statistics, configuration information)  about the mount points "
7970 "in the process's mount namespace.  This file is readable only by the owner "
7971 "of the process.  Lines in this file have the form:"
7972 msgstr ""
7973
7974 #. type: Plain text
7975 #: build/C/man7/namespaces.7:308
7976 #, no-wrap
7977 msgid ""
7978 "device /dev/sda7 mounted on /home with fstype ext3 [statistics]\n"
7979 "(       1      )            ( 2 )             (3 ) (4)\n"
7980 msgstr ""
7981
7982 #. type: Plain text
7983 #: build/C/man7/namespaces.7:312
7984 msgid "The fields in each line are:"
7985 msgstr ""
7986
7987 #. type: IP
7988 #: build/C/man7/namespaces.7:312 build/C/man7/user_namespaces.7:371
7989 #, no-wrap
7990 msgid "(1)"
7991 msgstr ""
7992
7993 #. type: Plain text
7994 #: build/C/man7/namespaces.7:316
7995 msgid ""
7996 "The name of the mounted device (or \"nodevice\" if there is no corresponding "
7997 "device)."
7998 msgstr ""
7999
8000 #. type: IP
8001 #: build/C/man7/namespaces.7:316 build/C/man7/user_namespaces.7:375
8002 #, no-wrap
8003 msgid "(2)"
8004 msgstr ""
8005
8006 #. type: Plain text
8007 #: build/C/man7/namespaces.7:319
8008 msgid "The mount point within the filesystem tree."
8009 msgstr ""
8010
8011 #. type: IP
8012 #: build/C/man7/namespaces.7:319 build/C/man7/user_namespaces.7:401
8013 #, no-wrap
8014 msgid "(3)"
8015 msgstr ""
8016
8017 #. type: Plain text
8018 #: build/C/man7/namespaces.7:322
8019 msgid "The filesystem type."
8020 msgstr ""
8021
8022 #. type: TP
8023 #: build/C/man7/namespaces.7:322
8024 #, no-wrap
8025 msgid "(4)"
8026 msgstr ""
8027
8028 #. type: Plain text
8029 #: build/C/man7/namespaces.7:327
8030 msgid ""
8031 "Optional statistics and configuration information.  Currently (as at Linux "
8032 "2.6.26), only NFS filesystems export information via this field."
8033 msgstr ""
8034
8035 #
8036 #.  ==================== PID namespaces ====================
8037 #. type: SS
8038 #: build/C/man7/namespaces.7:331
8039 #, no-wrap
8040 msgid "PID namespaces (CLONE_NEWPID)"
8041 msgstr ""
8042
8043 #
8044 #.  ==================== User namespaces ====================
8045 #. type: Plain text
8046 #: build/C/man7/namespaces.7:337
8047 msgid "See B<pid_namespaces>(7)."
8048 msgstr ""
8049
8050 #. type: SS
8051 #: build/C/man7/namespaces.7:337
8052 #, no-wrap
8053 msgid "User namespaces (CLONE_NEWUSER)"
8054 msgstr ""
8055
8056 #. type: Plain text
8057 #: build/C/man7/namespaces.7:343 build/C/man7/namespaces.7:364 build/C/man7/pid_namespaces.7:356
8058 msgid "See B<user_namespaces>(7)."
8059 msgstr ""
8060
8061 #. type: SS
8062 #: build/C/man7/namespaces.7:343
8063 #, no-wrap
8064 msgid "UTS namespaces (CLONE_NEWUTS)"
8065 msgstr ""
8066
8067 #. type: Plain text
8068 #: build/C/man7/namespaces.7:355
8069 msgid ""
8070 "UTS namespaces provide isolation of two system identifiers: the hostname and "
8071 "the NIS domain name.  These identifiers are set using B<sethostname>(2)  and "
8072 "B<setdomainname>(2), and can be retrieved using B<uname>(2), "
8073 "B<gethostname>(2), and B<getdomainname>(2)."
8074 msgstr ""
8075
8076 #. type: Plain text
8077 #: build/C/man7/namespaces.7:359
8078 msgid ""
8079 "Use of UTS namespaces requires a kernel that is configured with the "
8080 "B<CONFIG_UTS_NS> option."
8081 msgstr ""
8082
8083 #. type: Plain text
8084 #: build/C/man7/namespaces.7:361 build/C/man7/pid_namespaces.7:353 build/C/man7/user_namespaces.7:648
8085 msgid "Namespaces are a Linux-specific feature."
8086 msgstr ""
8087
8088 #. type: Plain text
8089 #: build/C/man7/namespaces.7:377
8090 msgid ""
8091 "B<nsenter>(1), B<readlink>(1), B<unshare>(1), B<clone>(2), B<setns>(2), "
8092 "B<unshare>(2), B<proc>(5), B<credentials>(7), B<capabilities>(7), "
8093 "B<pid_namespaces>(7), B<user_namespaces>(7), B<switch_root>(8)"
8094 msgstr ""
8095
8096 #. type: TH
8097 #: build/C/man7/pid_namespaces.7:27
8098 #, no-wrap
8099 msgid "PID_NAMESPACES"
8100 msgstr ""
8101
8102 #. type: TH
8103 #: build/C/man7/pid_namespaces.7:27 build/C/man2/seccomp.2:27
8104 #, no-wrap
8105 msgid "2015-01-10"
8106 msgstr ""
8107
8108 #. type: Plain text
8109 #: build/C/man7/pid_namespaces.7:30
8110 msgid "pid_namespaces - overview of Linux PID namespaces"
8111 msgstr ""
8112
8113 #. type: Plain text
8114 #: build/C/man7/pid_namespaces.7:33 build/C/man7/user_namespaces.7:33
8115 msgid "For an overview of namespaces, see B<namespaces>(7)."
8116 msgstr ""
8117
8118 #. type: Plain text
8119 #: build/C/man7/pid_namespaces.7:40
8120 msgid ""
8121 "PID namespaces isolate the process ID number space, meaning that processes "
8122 "in different PID namespaces can have the same PID.  PID namespaces allow "
8123 "containers to provide functionality such as suspending/resuming the set of "
8124 "processes in the container and migrating the container to a new host while "
8125 "the processes inside the container maintain the same PIDs."
8126 msgstr ""
8127
8128 #. type: Plain text
8129 #: build/C/man7/pid_namespaces.7:48
8130 msgid ""
8131 "PIDs in a new PID namespace start at 1, somewhat like a standalone system, "
8132 "and calls to B<fork>(2), B<vfork>(2), or B<clone>(2)  will produce processes "
8133 "with PIDs that are unique within the namespace."
8134 msgstr ""
8135
8136 #
8137 #.  ============================================================
8138 #. type: Plain text
8139 #: build/C/man7/pid_namespaces.7:55
8140 msgid ""
8141 "Use of PID namespaces requires a kernel that is configured with the "
8142 "B<CONFIG_PID_NS> option."
8143 msgstr ""
8144
8145 #. type: SS
8146 #: build/C/man7/pid_namespaces.7:55
8147 #, no-wrap
8148 msgid "The namespace init process"
8149 msgstr ""
8150
8151 #. type: Plain text
8152 #: build/C/man7/pid_namespaces.7:75
8153 msgid ""
8154 "The first process created in a new namespace (i.e., the process created "
8155 "using B<clone>(2)  with the B<CLONE_NEWPID> flag, or the first child created "
8156 "by a process after a call to B<unshare>(2)  using the B<CLONE_NEWPID> flag) "
8157 "has the PID 1, and is the \"init\" process for the namespace (see "
8158 "B<init>(1)).  A child process that is orphaned within the namespace will be "
8159 "reparented to this process rather than B<init>(1)  (unless one of the "
8160 "ancestors of the child in the same PID namespace employed the B<prctl>(2)  "
8161 "B<PR_SET_CHILD_SUBREAPER> command to mark itself as the reaper of orphaned "
8162 "descendant processes)."
8163 msgstr ""
8164
8165 #. type: Plain text
8166 #: build/C/man7/pid_namespaces.7:102
8167 msgid ""
8168 "If the \"init\" process of a PID namespace terminates, the kernel terminates "
8169 "all of the processes in the namespace via a B<SIGKILL> signal.  This "
8170 "behavior reflects the fact that the \"init\" process is essential for the "
8171 "correct operation of a PID namespace.  In this case, a subsequent B<fork>(2)  "
8172 "into this PID namespace will fail with the error B<ENOMEM>; it is not "
8173 "possible to create a new processes in a PID namespace whose \"init\" process "
8174 "has terminated.  Such scenarios can occur when, for example, a process uses "
8175 "an open file descriptor for a I</proc/[pid]/ns/pid> file corresponding to a "
8176 "process that was in a namespace to B<setns>(2)  into that namespace after "
8177 "the \"init\" process has terminated.  Another possible scenario can occur "
8178 "after a call to B<unshare>(2): if the first child subsequently created by a "
8179 "B<fork>(2)  terminates, then subsequent calls to B<fork>(2)  will fail with "
8180 "B<ENOMEM>."
8181 msgstr ""
8182
8183 #. type: Plain text
8184 #: build/C/man7/pid_namespaces.7:108
8185 msgid ""
8186 "Only signals for which the \"init\" process has established a signal handler "
8187 "can be sent to the \"init\" process by other members of the PID namespace.  "
8188 "This restriction applies even to privileged processes, and prevents other "
8189 "members of the PID namespace from accidentally killing the \"init\" process."
8190 msgstr ""
8191
8192 #. type: Plain text
8193 #: build/C/man7/pid_namespaces.7:128
8194 msgid ""
8195 "Likewise, a process in an ancestor namespace can\\(emsubject to the usual "
8196 "permission checks described in B<kill>(2)\\(emsend signals to the \"init\" "
8197 "process of a child PID namespace only if the \"init\" process has "
8198 "established a handler for that signal.  (Within the handler, the "
8199 "I<siginfo_t> I<si_pid> field described in B<sigaction>(2)  will be zero.)  "
8200 "B<SIGKILL> or B<SIGSTOP> are treated exceptionally: these signals are "
8201 "forcibly delivered when sent from an ancestor PID namespace.  Neither of "
8202 "these signals can be caught by the \"init\" process, and so will result in "
8203 "the usual actions associated with those signals (respectively, terminating "
8204 "and stopping the process)."
8205 msgstr ""
8206
8207 #
8208 #.  ============================================================
8209 #. type: Plain text
8210 #: build/C/man7/pid_namespaces.7:138
8211 msgid ""
8212 "Starting with Linux 3.4, the B<reboot>(2)  system call causes a signal to be "
8213 "sent to the namespace \"init\" process.  See B<reboot>(2)  for more details."
8214 msgstr ""
8215
8216 #. type: SS
8217 #: build/C/man7/pid_namespaces.7:138
8218 #, no-wrap
8219 msgid "Nesting PID namespaces"
8220 msgstr ""
8221
8222 #. type: Plain text
8223 #: build/C/man7/pid_namespaces.7:149
8224 msgid ""
8225 "PID namespaces can be nested: each PID namespace has a parent, except for "
8226 "the initial (\"root\") PID namespace.  The parent of a PID namespace is the "
8227 "PID namespace of the process that created the namespace using B<clone>(2)  "
8228 "or B<unshare>(2).  PID namespaces thus form a tree, with all namespaces "
8229 "ultimately tracing their ancestry to the root namespace."
8230 msgstr ""
8231
8232 #. type: Plain text
8233 #: build/C/man7/pid_namespaces.7:164
8234 msgid ""
8235 "A process is visible to other processes in its PID namespace, and to the "
8236 "processes in each direct ancestor PID namespace going back to the root PID "
8237 "namespace.  In this context, \"visible\" means that one process can be the "
8238 "target of operations by another process using system calls that specify a "
8239 "process ID.  Conversely, the processes in a child PID namespace can't see "
8240 "processes in the parent and further removed ancestor namespaces.  More "
8241 "succinctly: a process can see (e.g., send signals with B<kill>(2), set nice "
8242 "values with B<setpriority>(2), etc.) only processes contained in its own PID "
8243 "namespace and in descendants of that namespace."
8244 msgstr ""
8245
8246 #. type: Plain text
8247 #: build/C/man7/pid_namespaces.7:176
8248 msgid ""
8249 "A process has one process ID in each of the layers of the PID namespace "
8250 "hierarchy in which is visible, and walking back though each direct ancestor "
8251 "namespace through to the root PID namespace.  System calls that operate on "
8252 "process IDs always operate using the process ID that is visible in the PID "
8253 "namespace of the caller.  A call to B<getpid>(2)  always returns the PID "
8254 "associated with the namespace in which the process was created."
8255 msgstr ""
8256
8257 #. type: Plain text
8258 #: build/C/man7/pid_namespaces.7:191
8259 msgid ""
8260 "Some processes in a PID namespace may have parents that are outside of the "
8261 "namespace.  For example, the parent of the initial process in the namespace "
8262 "(i.e., the B<init>(1)  process with PID 1) is necessarily in another "
8263 "namespace.  Likewise, the direct children of a process that uses B<setns>(2)  "
8264 "to cause its children to join a PID namespace are in a different PID "
8265 "namespace from the caller of B<setns>(2).  Calls to B<getppid>(2)  for such "
8266 "processes return 0."
8267 msgstr ""
8268
8269 #
8270 #.  ============================================================
8271 #. type: Plain text
8272 #: build/C/man7/pid_namespaces.7:204
8273 msgid ""
8274 "While processes may freely descend into child PID namespaces (e.g., using "
8275 "B<setns>(2)  with B<CLONE_NEWPID>), they may not move in the other "
8276 "direction.  That is to say, processes may not enter any ancestor namespaces "
8277 "(parent, grandparent, etc.).  Changing PID namespaces is a one way "
8278 "operation."
8279 msgstr ""
8280
8281 #. type: SS
8282 #: build/C/man7/pid_namespaces.7:204
8283 #, no-wrap
8284 msgid "setns(2) and unshare(2) semantics"
8285 msgstr ""
8286
8287 #. type: Plain text
8288 #: build/C/man7/pid_namespaces.7:220
8289 msgid ""
8290 "Calls to B<setns>(2)  that specify a PID namespace file descriptor and calls "
8291 "to B<unshare>(2)  with the B<CLONE_NEWPID> flag cause children subsequently "
8292 "created by the caller to be placed in a different PID namespace from the "
8293 "caller.  These calls do not, however, change the PID namespace of the "
8294 "calling process, because doing so would change the caller's idea of its own "
8295 "PID (as reported by B<getpid>()), which would break many applications and "
8296 "libraries."
8297 msgstr ""
8298
8299 #. type: Plain text
8300 #: build/C/man7/pid_namespaces.7:228
8301 msgid ""
8302 "To put things another way: a process's PID namespace membership is "
8303 "determined when the process is created and cannot be changed thereafter.  "
8304 "Among other things, this means that the parental relationship between "
8305 "processes mirrors the parental relationship between PID namespaces: the "
8306 "parent of a process is either in the same namespace or resides in the "
8307 "immediate parent PID namespace."
8308 msgstr ""
8309
8310 #. type: SS
8311 #: build/C/man7/pid_namespaces.7:228
8312 #, no-wrap
8313 msgid "Compatibility of CLONE_NEWPID with other CLONE_* flags"
8314 msgstr ""
8315
8316 #. type: Plain text
8317 #: build/C/man7/pid_namespaces.7:233
8318 msgid "B<CLONE_NEWPID> can't be combined with some other B<CLONE_*> flags:"
8319 msgstr ""
8320
8321 #. type: Plain text
8322 #: build/C/man7/pid_namespaces.7:241
8323 msgid ""
8324 "B<CLONE_THREAD> requires being in the same PID namespace in order that the "
8325 "threads in a process can send signals to each other.  Similarly, it must be "
8326 "possible to see all of the threads of a processes in the B<proc>(5)  "
8327 "filesystem."
8328 msgstr ""
8329
8330 #. type: Plain text
8331 #: build/C/man7/pid_namespaces.7:252
8332 msgid ""
8333 "B<CLONE_SIGHAND> requires being in the same PID namespace; otherwise the "
8334 "process ID of the process sending a signal could not be meaningfully encoded "
8335 "when a signal is sent (see the description of the I<siginfo_t> type in "
8336 "B<sigaction>(2)).  A signal queue shared by processes in multiple PID "
8337 "namespaces will defeat that."
8338 msgstr ""
8339
8340 #. type: Plain text
8341 #: build/C/man7/pid_namespaces.7:262
8342 msgid ""
8343 "B<CLONE_VM> requires all of the threads to be in the same PID namespace, "
8344 "because, from the point of view of a core dump, if two processes share the "
8345 "same address space then they are threads and will be core dumped together.  "
8346 "When a core dump is written, the PID of each thread is written into the core "
8347 "dump.  Writing the process IDs could not meaningfully succeed if some of the "
8348 "process IDs were in a parent PID namespace."
8349 msgstr ""
8350
8351 #. type: Plain text
8352 #: build/C/man7/pid_namespaces.7:280
8353 msgid ""
8354 "To summarize: there is a technical requirement for each of B<CLONE_THREAD>, "
8355 "B<CLONE_SIGHAND>, and B<CLONE_VM> to share a PID namespace.  (Note "
8356 "furthermore that in B<clone>(2)  requires B<CLONE_VM> to be specified if "
8357 "B<CLONE_THREAD> or B<CLONE_SIGHAND> is specified.)  Thus, call sequences "
8358 "such as the following will fail (with the error B<EINVAL>):"
8359 msgstr ""
8360
8361 #. type: Plain text
8362 #: build/C/man7/pid_namespaces.7:284
8363 #, no-wrap
8364 msgid ""
8365 "    unshare(CLONE_NEWPID);\n"
8366 "    clone(..., CLONE_VM, ...);    /* Fails */\n"
8367 msgstr ""
8368
8369 #. type: Plain text
8370 #: build/C/man7/pid_namespaces.7:287
8371 #, no-wrap
8372 msgid ""
8373 "    setns(fd, CLONE_NEWPID);\n"
8374 "    clone(..., CLONE_VM, ...);    /* Fails */\n"
8375 msgstr ""
8376
8377 #. type: Plain text
8378 #: build/C/man7/pid_namespaces.7:290
8379 #, no-wrap
8380 msgid ""
8381 "    clone(..., CLONE_VM, ...);\n"
8382 "    setns(fd, CLONE_NEWPID);      /* Fails */\n"
8383 msgstr ""
8384
8385 #. type: Plain text
8386 #: build/C/man7/pid_namespaces.7:293
8387 #, no-wrap
8388 msgid ""
8389 "    clone(..., CLONE_VM, ...);\n"
8390 "    unshare(CLONE_NEWPID);        /* Fails */\n"
8391 msgstr ""
8392
8393 #
8394 #.  ============================================================
8395 #. type: SS
8396 #: build/C/man7/pid_namespaces.7:297
8397 #, no-wrap
8398 msgid "/proc and PID namespaces"
8399 msgstr ""
8400
8401 #. type: Plain text
8402 #: build/C/man7/pid_namespaces.7:306
8403 msgid ""
8404 "A I</proc> filesystem shows (in the I</proc/PID> directories) only processes "
8405 "visible in the PID namespace of the process that performed the mount, even "
8406 "if the I</proc> filesystem is viewed from processes in other namespaces."
8407 msgstr ""
8408
8409 #. type: Plain text
8410 #: build/C/man7/pid_namespaces.7:325
8411 msgid ""
8412 "After creating a new PID namespace, it is useful for the child to change its "
8413 "root directory and mount a new procfs instance at I</proc> so that tools "
8414 "such as B<ps>(1)  work correctly.  If a new mount namespace is "
8415 "simultaneously created by including B<CLONE_NEWNS> in the I<flags> argument "
8416 "of B<clone>(2)  or B<unshare>(2), then it isn't necessary to change the root "
8417 "directory: a new procfs instance can be mounted directly over I</proc>."
8418 msgstr ""
8419
8420 #. type: Plain text
8421 #: build/C/man7/pid_namespaces.7:329
8422 msgid "From a shell, the command to mount I</proc> is:"
8423 msgstr ""
8424
8425 #. type: Plain text
8426 #: build/C/man7/pid_namespaces.7:331
8427 #, no-wrap
8428 msgid "    $ mount -t proc proc /proc\n"
8429 msgstr ""
8430
8431 #
8432 #.  ============================================================
8433 #. type: Plain text
8434 #: build/C/man7/pid_namespaces.7:343
8435 msgid ""
8436 "Calling B<readlink>(2)  on the path I</proc/self> yields the process ID of "
8437 "the caller in the PID namespace of the procfs mount (i.e., the PID namespace "
8438 "of the process that mounted the procfs).  This can be useful for "
8439 "introspection purposes, when a process wants to discover its PID in other "
8440 "namespaces."
8441 msgstr ""
8442
8443 #. type: SS
8444 #: build/C/man7/pid_namespaces.7:343 build/C/man7/user_namespaces.7:635
8445 #, no-wrap
8446 msgid "Miscellaneous"
8447 msgstr ""
8448
8449 #. type: Plain text
8450 #: build/C/man7/pid_namespaces.7:351
8451 msgid ""
8452 "When a process ID is passed over a UNIX domain socket to a process in a "
8453 "different PID namespace (see the description of B<SCM_CREDENTIALS> in "
8454 "B<unix>(7)), it is translated into the corresponding PID value in the "
8455 "receiving process's PID namespace."
8456 msgstr ""
8457
8458 #. type: Plain text
8459 #: build/C/man7/pid_namespaces.7:365
8460 msgid ""
8461 "B<clone>(2), B<setns>(2), B<unshare>(2), B<proc>(5), B<credentials>(7), "
8462 "B<capabilities>(7), B<user_namespaces>(7), B<switch_root>(8)"
8463 msgstr ""
8464
8465 #. type: TH
8466 #: build/C/man2/seteuid.2:29
8467 #, no-wrap
8468 msgid "SETEUID"
8469 msgstr ""
8470
8471 #. type: Plain text
8472 #: build/C/man2/seteuid.2:32
8473 msgid "seteuid, setegid - set effective user or group ID"
8474 msgstr ""
8475
8476 #. type: Plain text
8477 #: build/C/man2/seteuid.2:38
8478 msgid "B<int seteuid(uid_t >I<euid>B<);>"
8479 msgstr ""
8480
8481 #. type: Plain text
8482 #: build/C/man2/seteuid.2:40
8483 msgid "B<int setegid(gid_t >I<egid>B<);>"
8484 msgstr ""
8485
8486 #. type: Plain text
8487 #: build/C/man2/seteuid.2:49
8488 msgid "B<seteuid>(), B<setegid>():"
8489 msgstr ""
8490
8491 #. type: Plain text
8492 #: build/C/man2/seteuid.2:51
8493 msgid ""
8494 "_BSD_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ "
8495 "E<gt>=\\ 600"
8496 msgstr ""
8497
8498 #. type: Plain text
8499 #: build/C/man2/seteuid.2:58
8500 msgid ""
8501 "B<seteuid>()  sets the effective user ID of the calling process.  "
8502 "Unprivileged user processes may only set the effective user ID to the real "
8503 "user ID, the effective user ID or the saved set-user-ID."
8504 msgstr ""
8505
8506 #.  When
8507 #.  .I euid
8508 #.  equals \-1, nothing is changed.
8509 #.  (This is an artifact of the implementation in glibc of seteuid()
8510 #.  using setresuid(2).)
8511 #. type: Plain text
8512 #: build/C/man2/seteuid.2:67
8513 msgid ""
8514 "Precisely the same holds for B<setegid>()  with \"group\" instead of "
8515 "\"user\"."
8516 msgstr ""
8517
8518 #. type: Plain text
8519 #: build/C/man2/seteuid.2:79
8520 msgid ""
8521 "I<Note>: there are cases where B<seteuid>()  can fail even when the caller "
8522 "is UID 0; it is a grave security error to omit checking for a failure return "
8523 "from B<seteuid>()."
8524 msgstr ""
8525
8526 #. type: Plain text
8527 #: build/C/man2/seteuid.2:83
8528 msgid "The target user or group ID is not valid in this user namespace."
8529 msgstr ""
8530
8531 #. type: Plain text
8532 #: build/C/man2/seteuid.2:99
8533 msgid ""
8534 "The calling process is not privileged (Linux: does not have the "
8535 "B<CAP_SETUID> capability in the case of B<seteuid>(), or the B<CAP_SETGID> "
8536 "capability in the case of B<setegid>())  and I<euid> (respectively, I<egid>)  "
8537 "is not the real user (group) ID, the effective user (group) ID, or the saved "
8538 "set-user-ID (saved set-group-ID)."
8539 msgstr ""
8540
8541 #. type: Plain text
8542 #: build/C/man2/seteuid.2:101
8543 msgid "4.3BSD, POSIX.1-2001."
8544 msgstr ""
8545
8546 #. type: Plain text
8547 #: build/C/man2/seteuid.2:107
8548 msgid ""
8549 "Setting the effective user (group) ID to the saved set-user-ID (saved "
8550 "set-group-ID) is possible since Linux 1.1.37 (1.1.38).  On an arbitrary "
8551 "system one should check B<_POSIX_SAVED_IDS>."
8552 msgstr ""
8553
8554 #. type: Plain text
8555 #: build/C/man2/seteuid.2:123
8556 msgid ""
8557 "Under glibc 2.0 B<seteuid(>I<euid>B<)> is equivalent to B<setreuid(-1,>I< "
8558 "euid>B<)> and hence may change the saved set-user-ID.  Under glibc 2.1 and "
8559 "later it is equivalent to B<setresuid(-1,>I< euid>B<, -1)> and hence does "
8560 "not change the saved set-user-ID.  Analogous remarks hold for B<setegid>(), "
8561 "with the difference that the change in implementation from B<setregid(-1,>I< "
8562 "egid>B<)> to B<setresgid(-1,>I< egid>B<, -1)> occurred in glibc 2.2 or 2.3 "
8563 "(depending on the hardware architecture)."
8564 msgstr ""
8565
8566 #. type: Plain text
8567 #: build/C/man2/seteuid.2:132
8568 msgid ""
8569 "According to POSIX.1, B<seteuid>()  (B<setegid>())  need not permit I<euid> "
8570 "(I<egid>)  to be the same value as the current effective user (group) ID, "
8571 "and some implementations do not permit this."
8572 msgstr ""
8573
8574 #. type: Plain text
8575 #: build/C/man2/seteuid.2:141
8576 msgid ""
8577 "On Linux, B<seteuid>()  and B<setegid>()  are implemented as library "
8578 "functions that call, respectively, B<setreuid>(2)  and B<setresgid>(2)."
8579 msgstr ""
8580
8581 #. type: Plain text
8582 #: build/C/man2/seteuid.2:149
8583 msgid ""
8584 "B<geteuid>(2), B<setresuid>(2), B<setreuid>(2), B<setuid>(2), "
8585 "B<capabilities>(7), B<credentials>(7), B<user_namespaces>(7)"
8586 msgstr ""
8587
8588 #. type: TH
8589 #: build/C/man2/setfsgid.2:31
8590 #, no-wrap
8591 msgid "SETFSGID"
8592 msgstr ""
8593
8594 #. type: TH
8595 #: build/C/man2/setfsgid.2:31 build/C/man2/setfsuid.2:31
8596 #, no-wrap
8597 msgid "2013-08-08"
8598 msgstr ""
8599
8600 #. type: Plain text
8601 #: build/C/man2/setfsgid.2:34
8602 msgid "setfsgid - set group identity used for filesystem checks"
8603 msgstr ""
8604
8605 #. type: Plain text
8606 #: build/C/man2/setfsgid.2:36 build/C/man2/setfsuid.2:36
8607 msgid "B<#include E<lt>sys/fsuid.hE<gt>>"
8608 msgstr ""
8609
8610 #. type: Plain text
8611 #: build/C/man2/setfsgid.2:38
8612 msgid "B<int setfsgid(uid_t >I<fsgid>B<);>"
8613 msgstr ""
8614
8615 #. type: Plain text
8616 #: build/C/man2/setfsgid.2:51
8617 msgid ""
8618 "The system call B<setfsgid>()  changes the value of the caller's filesystem "
8619 "group ID\\(emthe group ID that the Linux kernel uses to check for all "
8620 "accesses to the filesystem.  Normally, the value of the filesystem group ID "
8621 "will shadow the value of the effective group ID.  In fact, whenever the "
8622 "effective group ID is changed, the filesystem group ID will also be changed "
8623 "to the new value of the effective group ID."
8624 msgstr ""
8625
8626 #. type: Plain text
8627 #: build/C/man2/setfsgid.2:62
8628 msgid ""
8629 "Explicit calls to B<setfsuid>(2)  and B<setfsgid>()  are usually used only "
8630 "by programs such as the Linux NFS server that need to change what user and "
8631 "group ID is used for file access without a corresponding change in the real "
8632 "and effective user and group IDs.  A change in the normal user IDs for a "
8633 "program such as the NFS server is a security hole that can expose it to "
8634 "unwanted signals.  (But see below.)"
8635 msgstr ""
8636
8637 #. type: Plain text
8638 #: build/C/man2/setfsgid.2:68
8639 msgid ""
8640 "B<setfsgid>()  will succeed only if the caller is the superuser or if "
8641 "I<fsgid> matches either the caller's real group ID, effective group ID, "
8642 "saved set-group-ID, or current the filesystem user ID."
8643 msgstr ""
8644
8645 #. type: Plain text
8646 #: build/C/man2/setfsgid.2:71
8647 msgid ""
8648 "On both success and failure, this call returns the previous filesystem group "
8649 "ID of the caller."
8650 msgstr ""
8651
8652 #.  This system call is present since Linux 1.1.44
8653 #.  and in libc since libc 4.7.6.
8654 #. type: Plain text
8655 #: build/C/man2/setfsgid.2:75 build/C/man2/setfsuid.2:75
8656 msgid "This system call is present in Linux since version 1.2."
8657 msgstr ""
8658
8659 #. type: Plain text
8660 #: build/C/man2/setfsgid.2:79
8661 msgid ""
8662 "B<setfsgid>()  is Linux-specific and should not be used in programs intended "
8663 "to be portable."
8664 msgstr ""
8665
8666 #. type: Plain text
8667 #: build/C/man2/setfsgid.2:85
8668 msgid ""
8669 "When glibc determines that the argument is not a valid group ID, it will "
8670 "return -1 and set I<errno> to B<EINVAL> without attempting the system call."
8671 msgstr ""
8672
8673 #. type: Plain text
8674 #: build/C/man2/setfsgid.2:96
8675 msgid ""
8676 "Note that at the time this system call was introduced, a process could send "
8677 "a signal to a process with the same effective user ID.  Today signal "
8678 "permission handling is slightly different.  See B<setfsuid>(2)  for a "
8679 "discussion of why the use of both B<setfsuid>(2)  and B<setfsgid>()  is "
8680 "nowadays unneeded."
8681 msgstr ""
8682
8683 #. type: Plain text
8684 #: build/C/man2/setfsgid.2:106
8685 msgid ""
8686 "The original Linux B<setfsgid>()  system call supported only 16-bit group "
8687 "IDs.  Subsequently, Linux 2.4 added B<setfsgid32>()  supporting 32-bit IDs.  "
8688 "The glibc B<setfsgid>()  wrapper function transparently deals with the "
8689 "variation across kernel versions."
8690 msgstr ""
8691
8692 #. type: Plain text
8693 #: build/C/man2/setfsgid.2:123
8694 msgid ""
8695 "No error indications of any kind are returned to the caller, and the fact "
8696 "that both successful and unsuccessful calls return the same value makes it "
8697 "impossible to directly determine whether the call succeeded or failed.  "
8698 "Instead, the caller must resort to looking at the return value from a "
8699 "further call such as I<setfsgid(-1)> (which will always fail), in order to "
8700 "determine if a preceding call to B<setfsgid>()  changed the filesystem group "
8701 "ID.  At the very least, B<EPERM> should be returned when the call fails "
8702 "(because the caller lacks the B<CAP_SETGID> capability)."
8703 msgstr ""
8704
8705 #. type: Plain text
8706 #: build/C/man2/setfsgid.2:128
8707 msgid "B<kill>(2), B<setfsuid>(2), B<capabilities>(7), B<credentials>(7)"
8708 msgstr ""
8709
8710 #. type: TH
8711 #: build/C/man2/setfsuid.2:31
8712 #, no-wrap
8713 msgid "SETFSUID"
8714 msgstr ""
8715
8716 #. type: Plain text
8717 #: build/C/man2/setfsuid.2:34
8718 msgid "setfsuid - set user identity used for filesystem checks"
8719 msgstr ""
8720
8721 #. type: Plain text
8722 #: build/C/man2/setfsuid.2:38
8723 msgid "B<int setfsuid(uid_t >I<fsuid>B<);>"
8724 msgstr ""
8725
8726 #. type: Plain text
8727 #: build/C/man2/setfsuid.2:51
8728 msgid ""
8729 "The system call B<setfsuid>()  changes the value of the caller's filesystem "
8730 "user ID\\(emthe user ID that the Linux kernel uses to check for all accesses "
8731 "to the filesystem.  Normally, the value of the filesystem user ID will "
8732 "shadow the value of the effective user ID.  In fact, whenever the effective "
8733 "user ID is changed, the filesystem user ID will also be changed to the new "
8734 "value of the effective user ID."
8735 msgstr ""
8736
8737 #. type: Plain text
8738 #: build/C/man2/setfsuid.2:62
8739 msgid ""
8740 "Explicit calls to B<setfsuid>()  and B<setfsgid>(2)  are usually used only "
8741 "by programs such as the Linux NFS server that need to change what user and "
8742 "group ID is used for file access without a corresponding change in the real "
8743 "and effective user and group IDs.  A change in the normal user IDs for a "
8744 "program such as the NFS server is a security hole that can expose it to "
8745 "unwanted signals.  (But see below.)"
8746 msgstr ""
8747
8748 #. type: Plain text
8749 #: build/C/man2/setfsuid.2:68
8750 msgid ""
8751 "B<setfsuid>()  will succeed only if the caller is the superuser or if "
8752 "I<fsuid> matches either the caller's real user ID, effective user ID, saved "
8753 "set-user-ID, or current filesystem user ID."
8754 msgstr ""
8755
8756 #. type: Plain text
8757 #: build/C/man2/setfsuid.2:71
8758 msgid ""
8759 "On both success and failure, this call returns the previous filesystem user "
8760 "ID of the caller."
8761 msgstr ""
8762
8763 #. type: Plain text
8764 #: build/C/man2/setfsuid.2:79
8765 msgid ""
8766 "B<setfsuid>()  is Linux-specific and should not be used in programs intended "
8767 "to be portable."
8768 msgstr ""
8769
8770 #. type: Plain text
8771 #: build/C/man2/setfsuid.2:85
8772 msgid ""
8773 "When glibc determines that the argument is not a valid user ID, it will "
8774 "return -1 and set I<errno> to B<EINVAL> without attempting the system call."
8775 msgstr ""
8776
8777 #. type: Plain text
8778 #: build/C/man2/setfsuid.2:104
8779 msgid ""
8780 "At the time when this system call was introduced, one process could send a "
8781 "signal to another process with the same effective user ID.  This meant that "
8782 "if a privileged process changed its effective user ID for the purpose of "
8783 "file permission checking, then it could become vulnerable to receiving "
8784 "signals sent by another (unprivileged) process with the same user ID.  The "
8785 "filesystem user ID attribute was thus added to allow a process to change its "
8786 "user ID for the purposes of file permission checking without at the same "
8787 "time becoming vulnerable to receiving unwanted signals.  Since Linux 2.0, "
8788 "signal permission handling is different (see B<kill>(2)), with the result "
8789 "that a process change can change its effective user ID without being "
8790 "vulnerable to receiving signals from unwanted processes.  Thus, "
8791 "B<setfsuid>()  is nowadays unneeded and should be avoided in new "
8792 "applications (likewise for B<setfsgid>(2))."
8793 msgstr ""
8794
8795 #. type: Plain text
8796 #: build/C/man2/setfsuid.2:114
8797 msgid ""
8798 "The original Linux B<setfsuid>()  system call supported only 16-bit user "
8799 "IDs.  Subsequently, Linux 2.4 added B<setfsuid32>()  supporting 32-bit IDs.  "
8800 "The glibc B<setfsuid>()  wrapper function transparently deals with the "
8801 "variation across kernel versions."
8802 msgstr ""
8803
8804 #. type: Plain text
8805 #: build/C/man2/setfsuid.2:131
8806 msgid ""
8807 "No error indications of any kind are returned to the caller, and the fact "
8808 "that both successful and unsuccessful calls return the same value makes it "
8809 "impossible to directly determine whether the call succeeded or failed.  "
8810 "Instead, the caller must resort to looking at the return value from a "
8811 "further call such as I<setfsuid(-1)> (which will always fail), in order to "
8812 "determine if a preceding call to B<setfsuid>()  changed the filesystem user "
8813 "ID.  At the very least, B<EPERM> should be returned when the call fails "
8814 "(because the caller lacks the B<CAP_SETUID> capability)."
8815 msgstr ""
8816
8817 #. type: Plain text
8818 #: build/C/man2/setfsuid.2:136
8819 msgid "B<kill>(2), B<setfsgid>(2), B<capabilities>(7), B<credentials>(7)"
8820 msgstr ""
8821
8822 #. type: TH
8823 #: build/C/man2/setgid.2:29
8824 #, no-wrap
8825 msgid "SETGID"
8826 msgstr ""
8827
8828 #. type: Plain text
8829 #: build/C/man2/setgid.2:32
8830 msgid "setgid - set group identity"
8831 msgstr ""
8832
8833 #. type: Plain text
8834 #: build/C/man2/setgid.2:38
8835 msgid "B<int setgid(gid_t >I<gid>B<);>"
8836 msgstr ""
8837
8838 #. type: Plain text
8839 #: build/C/man2/setgid.2:43
8840 msgid ""
8841 "B<setgid>()  sets the effective group ID of the calling process.  If the "
8842 "caller is the superuser, the real GID and saved set-group-ID are also set."
8843 msgstr ""
8844
8845 #. type: Plain text
8846 #: build/C/man2/setgid.2:53
8847 msgid ""
8848 "Under Linux, B<setgid>()  is implemented like the POSIX version with the "
8849 "B<_POSIX_SAVED_IDS> feature.  This allows a set-group-ID program that is not "
8850 "set-user-ID-root to drop all of its group privileges, do some un-privileged "
8851 "work, and then reengage the original effective group ID in a secure manner."
8852 msgstr ""
8853
8854 #. type: Plain text
8855 #: build/C/man2/setgid.2:64
8856 msgid "The group ID specified in I<gid> is not valid in this user namespace."
8857 msgstr ""
8858
8859 #. type: Plain text
8860 #: build/C/man2/setgid.2:71
8861 msgid ""
8862 "The calling process is not privileged (does not have the B<CAP_SETGID> "
8863 "capability), and I<gid> does not match the real group ID or saved "
8864 "set-group-ID of the calling process."
8865 msgstr ""
8866
8867 #. type: Plain text
8868 #: build/C/man2/setgid.2:83
8869 msgid ""
8870 "The original Linux B<setgid>()  system call supported only 16-bit group "
8871 "IDs.  Subsequently, Linux 2.4 added B<setgid32>()  supporting 32-bit IDs.  "
8872 "The glibc B<setgid>()  wrapper function transparently deals with the "
8873 "variation across kernel versions."
8874 msgstr ""
8875
8876 #. type: Plain text
8877 #: build/C/man2/setgid.2:90
8878 msgid ""
8879 "B<getgid>(2), B<setegid>(2), B<setregid>(2), B<capabilities>(7), "
8880 "B<credentials>(7), B<user_namespaces>(7)"
8881 msgstr ""
8882
8883 #. type: TH
8884 #: build/C/man2/setpgid.2:48
8885 #, no-wrap
8886 msgid "SETPGID"
8887 msgstr ""
8888
8889 #. type: TH
8890 #: build/C/man2/setpgid.2:48
8891 #, no-wrap
8892 msgid "2014-01-07"
8893 msgstr ""
8894
8895 #. type: Plain text
8896 #: build/C/man2/setpgid.2:51
8897 msgid "setpgid, getpgid, setpgrp, getpgrp - set/get process group"
8898 msgstr ""
8899
8900 #. type: Plain text
8901 #: build/C/man2/setpgid.2:55
8902 msgid "B<int setpgid(pid_t >I<pid>B<, pid_t >I<pgid>B<);>"
8903 msgstr ""
8904
8905 #. type: Plain text
8906 #: build/C/man2/setpgid.2:57
8907 msgid "B<pid_t getpgid(pid_t >I<pid>B<);>"
8908 msgstr ""
8909
8910 #. type: Plain text
8911 #: build/C/man2/setpgid.2:59
8912 msgid "B<pid_t getpgrp(void);> /* POSIX.1 version */"
8913 msgstr ""
8914
8915 #. type: Plain text
8916 #: build/C/man2/setpgid.2:62
8917 msgid ""
8918 "B<pid_t getpgrp(pid_t >I<pid>B<);\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ > /* BSD "
8919 "version */"
8920 msgstr ""
8921
8922 #. type: Plain text
8923 #: build/C/man2/setpgid.2:64
8924 msgid "B<int setpgrp(void);> /* System V version */"
8925 msgstr ""
8926
8927 #. type: Plain text
8928 #: build/C/man2/setpgid.2:67
8929 msgid "B<int setpgrp(pid_t >I<pid>B<, pid_t >I<pgid>B<);\\ > /* BSD version */"
8930 msgstr ""
8931
8932 #. type: Plain text
8933 #: build/C/man2/setpgid.2:76
8934 msgid "B<getpgid>():"
8935 msgstr ""
8936
8937 #. type: Plain text
8938 #: build/C/man2/setpgid.2:84
8939 msgid "B<setpgrp>() (POSIX.1):"
8940 msgstr ""
8941
8942 #. type: Plain text
8943 #: build/C/man2/setpgid.2:87
8944 #, no-wrap
8945 msgid ""
8946 "    _SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 ||\n"
8947 "    _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED\n"
8948 msgstr ""
8949
8950 #. type: Plain text
8951 #: build/C/man2/setpgid.2:89
8952 #, no-wrap
8953 msgid "    || /* Since glibc 2.19: */ _BSD_SOURCE\n"
8954 msgstr ""
8955
8956 #. type: Plain text
8957 #: build/C/man2/setpgid.2:93
8958 msgid "B<setpgrp>()\\ (BSD), B<getpgrp>()\\ (BSD) [before glibc 2.19]:"
8959 msgstr ""
8960
8961 #. type: Plain text
8962 #: build/C/man2/setpgid.2:97
8963 #, no-wrap
8964 msgid ""
8965 "    _BSD_SOURCE &&\n"
8966 "        !\\ (_POSIX_SOURCE || _POSIX_C_SOURCE || _XOPEN_SOURCE ||\n"
8967 "           _XOPEN_SOURCE_EXTENDED || _GNU_SOURCE || _SVID_SOURCE)\n"
8968 msgstr ""
8969
8970 #. type: Plain text
8971 #: build/C/man2/setpgid.2:109
8972 msgid ""
8973 "All of these interfaces are available on Linux, and are used for getting and "
8974 "setting the process group ID (PGID) of a process.  The preferred, "
8975 "POSIX.1-specified ways of doing this are: B<getpgrp>(void), for retrieving "
8976 "the calling process's PGID; and B<setpgid>(), for setting a process's PGID."
8977 msgstr ""
8978
8979 #. type: Plain text
8980 #: build/C/man2/setpgid.2:134
8981 msgid ""
8982 "B<setpgid>()  sets the PGID of the process specified by I<pid> to I<pgid>.  "
8983 "If I<pid> is zero, then the process ID of the calling process is used.  If "
8984 "I<pgid> is zero, then the PGID of the process specified by I<pid> is made "
8985 "the same as its process ID.  If B<setpgid>()  is used to move a process from "
8986 "one process group to another (as is done by some shells when creating "
8987 "pipelines), both process groups must be part of the same session (see "
8988 "B<setsid>(2)  and B<credentials>(7)).  In this case, the I<pgid> specifies "
8989 "an existing process group to be joined and the session ID of that group must "
8990 "match the session ID of the joining process."
8991 msgstr ""
8992
8993 #. type: Plain text
8994 #: build/C/man2/setpgid.2:139
8995 msgid ""
8996 "The POSIX.1 version of B<getpgrp>(), which takes no arguments, returns the "
8997 "PGID of the calling process."
8998 msgstr ""
8999
9000 #. type: Plain text
9001 #: build/C/man2/setpgid.2:150
9002 msgid ""
9003 "B<getpgid>()  returns the PGID of the process specified by I<pid>.  If "
9004 "I<pid> is zero, the process ID of the calling process is used.  (Retrieving "
9005 "the PGID of a process other than the caller is rarely necessary, and the "
9006 "POSIX.1 B<getpgrp>()  is preferred for that task.)"
9007 msgstr ""
9008
9009 #. type: Plain text
9010 #: build/C/man2/setpgid.2:155
9011 msgid ""
9012 "The System\\ V-style B<setpgrp>(), which takes no arguments, is equivalent "
9013 "to I<setpgid(0,\\ 0)>."
9014 msgstr ""
9015
9016 #. type: Plain text
9017 #: build/C/man2/setpgid.2:163
9018 msgid ""
9019 "The BSD-specific B<setpgrp>()  call, which takes arguments I<pid> and "
9020 "I<pgid>, is is a wrapper function that calls"
9021 msgstr ""
9022
9023 #. type: Plain text
9024 #: build/C/man2/setpgid.2:165
9025 #, no-wrap
9026 msgid "    setpgid(pid, pgid)\n"
9027 msgstr ""
9028
9029 #.  The true BSD setpgrp() system call differs in allowing the PGID
9030 #.  to be set to arbitrary values, rather than being restricted to
9031 #.  PGIDs in the same session.
9032 #. type: Plain text
9033 #: build/C/man2/setpgid.2:176
9034 msgid ""
9035 "Since glibc 2.19, the BSD-specific B<setpgrp>()  function is no longer "
9036 "exposed by I<E<lt>unistd.hE<gt>>; calls should be replaced with the "
9037 "B<setpgid>()  call shown above."
9038 msgstr ""
9039
9040 #. type: Plain text
9041 #: build/C/man2/setpgid.2:182
9042 msgid ""
9043 "The BSD-specific B<getpgrp>()  call, which takes a single I<pid> argument, "
9044 "is a wrapper function that calls"
9045 msgstr ""
9046
9047 #. type: Plain text
9048 #: build/C/man2/setpgid.2:184
9049 #, no-wrap
9050 msgid "    getpgid(pid)\n"
9051 msgstr ""
9052
9053 #. type: Plain text
9054 #: build/C/man2/setpgid.2:195
9055 msgid ""
9056 "Since glibc 2.19, the BSD-specific B<getpgrp>()  function is no longer "
9057 "exposed by I<E<lt>unistd.hE<gt>>; calls should be replaced with calls to the "
9058 "POSIX.1 B<getpgrp>()  which takes no arguments (if the intent is to obtain "
9059 "the caller's PGID), or with the B<getpgid>()  call shown above."
9060 msgstr ""
9061
9062 #. type: Plain text
9063 #: build/C/man2/setpgid.2:204
9064 msgid ""
9065 "On success, B<setpgid>()  and B<setpgrp>()  return zero.  On error, -1 is "
9066 "returned, and I<errno> is set appropriately."
9067 msgstr ""
9068
9069 #. type: Plain text
9070 #: build/C/man2/setpgid.2:208
9071 msgid "The POSIX.1 B<getpgrp>()  always returns the PGID of the caller."
9072 msgstr ""
9073
9074 #. type: Plain text
9075 #: build/C/man2/setpgid.2:216
9076 msgid ""
9077 "B<getpgid>(), and the BSD-specific B<getpgrp>()  return a process group on "
9078 "success.  On error, -1 is returned, and I<errno> is set appropriately."
9079 msgstr ""
9080
9081 #. type: Plain text
9082 #: build/C/man2/setpgid.2:225
9083 msgid ""
9084 "An attempt was made to change the process group ID of one of the children of "
9085 "the calling process and the child had already performed an B<execve>(2)  "
9086 "(B<setpgid>(), B<setpgrp>())."
9087 msgstr ""
9088
9089 #. type: Plain text
9090 #: build/C/man2/setpgid.2:231
9091 msgid "I<pgid> is less than 0 (B<setpgid>(), B<setpgrp>())."
9092 msgstr ""
9093
9094 #. type: Plain text
9095 #: build/C/man2/setpgid.2:240
9096 msgid ""
9097 "An attempt was made to move a process into a process group in a different "
9098 "session, or to change the process group ID of one of the children of the "
9099 "calling process and the child was in a different session, or to change the "
9100 "process group ID of a session leader (B<setpgid>(), B<setpgrp>())."
9101 msgstr ""
9102
9103 #. type: Plain text
9104 #: build/C/man2/setpgid.2:250
9105 msgid ""
9106 "For B<getpgid>(): I<pid> does not match any process.  For B<setpgid>(): "
9107 "I<pid> is not the calling process and not a child of the calling process."
9108 msgstr ""
9109
9110 #. type: Plain text
9111 #: build/C/man2/setpgid.2:256
9112 msgid ""
9113 "B<setpgid>()  and the version of B<getpgrp>()  with no arguments conform to "
9114 "POSIX.1-2001."
9115 msgstr ""
9116
9117 #. type: Plain text
9118 #: build/C/man2/setpgid.2:265
9119 msgid ""
9120 "POSIX.1-2001 also specifies B<getpgid>()  and the version of B<setpgrp>()  "
9121 "that takes no arguments.  (POSIX.1-2008 marks this B<setpgrp>()  "
9122 "specification as obsolete.)"
9123 msgstr ""
9124
9125 #. type: Plain text
9126 #: build/C/man2/setpgid.2:272
9127 msgid ""
9128 "The version of B<getpgrp>()  with one argument and the version of "
9129 "B<setpgrp>()  that takes two arguments derive from 4.2BSD, and are not "
9130 "specified by POSIX.1."
9131 msgstr ""
9132
9133 #. type: Plain text
9134 #: build/C/man2/setpgid.2:278
9135 msgid ""
9136 "A child created via B<fork>(2)  inherits its parent's process group ID.  The "
9137 "PGID is preserved across an B<execve>(2)."
9138 msgstr ""
9139
9140 #. type: Plain text
9141 #: build/C/man2/setpgid.2:281
9142 msgid ""
9143 "Each process group is a member of a session and each process is a member of "
9144 "the session of which its process group is a member."
9145 msgstr ""
9146
9147 #. type: Plain text
9148 #: build/C/man2/setpgid.2:308
9149 msgid ""
9150 "A session can have a controlling terminal.  At any time, one (and only one) "
9151 "of the process groups in the session can be the foreground process group for "
9152 "the terminal; the remaining process groups are in the background.  If a "
9153 "signal is generated from the terminal (e.g., typing the interrupt key to "
9154 "generate B<SIGINT>), that signal is sent to the foreground process group.  "
9155 "(See B<termios>(3)  for a description of the characters that generate "
9156 "signals.)  Only the foreground process group may B<read>(2)  from the "
9157 "terminal; if a background process group tries to B<read>(2)  from the "
9158 "terminal, then the group is sent a B<SIGTTIN> signal, which suspends it.  "
9159 "The B<tcgetpgrp>(3)  and B<tcsetpgrp>(3)  functions are used to get/set the "
9160 "foreground process group of the controlling terminal."
9161 msgstr ""
9162
9163 #. type: Plain text
9164 #: build/C/man2/setpgid.2:316
9165 msgid ""
9166 "The B<setpgid>()  and B<getpgrp>()  calls are used by programs such as "
9167 "B<bash>(1)  to create process groups in order to implement shell job "
9168 "control."
9169 msgstr ""
9170
9171 #. type: Plain text
9172 #: build/C/man2/setpgid.2:326
9173 msgid ""
9174 "If a session has a controlling terminal, and the B<CLOCAL> flag for that "
9175 "terminal is not set, and a terminal hangup occurs, then the session leader "
9176 "is sent a B<SIGHUP>.  If the session leader exits, then a B<SIGHUP> signal "
9177 "will also be sent to each process in the foreground process group of the "
9178 "controlling terminal."
9179 msgstr ""
9180
9181 #.  exit.3 refers to the following text:
9182 #. type: Plain text
9183 #: build/C/man2/setpgid.2:340
9184 msgid ""
9185 "If the exit of the process causes a process group to become orphaned, and if "
9186 "any member of the newly orphaned process group is stopped, then a B<SIGHUP> "
9187 "signal followed by a B<SIGCONT> signal will be sent to each process in the "
9188 "newly orphaned process group.  An orphaned process group is one in which the "
9189 "parent of every member of process group is either itself also a member of "
9190 "the process group or is a member of a process group in a different session "
9191 "(see also B<credentials>(7))."
9192 msgstr ""
9193
9194 #. type: Plain text
9195 #: build/C/man2/setpgid.2:347
9196 msgid ""
9197 "B<getuid>(2), B<setsid>(2), B<tcgetpgrp>(3), B<tcsetpgrp>(3), B<termios>(3), "
9198 "B<credentials>(7)"
9199 msgstr ""
9200
9201 #. type: TH
9202 #: build/C/man2/setresuid.2:26
9203 #, no-wrap
9204 msgid "SETRESUID"
9205 msgstr ""
9206
9207 #. type: Plain text
9208 #: build/C/man2/setresuid.2:29
9209 msgid "setresuid, setresgid - set real, effective and saved user or group ID"
9210 msgstr ""
9211
9212 #. type: Plain text
9213 #: build/C/man2/setresuid.2:35
9214 msgid "B<int setresuid(uid_t >I<ruid>B<, uid_t >I<euid>B<, uid_t >I<suid>B<);>"
9215 msgstr ""
9216
9217 #. type: Plain text
9218 #: build/C/man2/setresuid.2:37
9219 msgid "B<int setresgid(gid_t >I<rgid>B<, gid_t >I<egid>B<, gid_t >I<sgid>B<);>"
9220 msgstr ""
9221
9222 #. type: Plain text
9223 #: build/C/man2/setresuid.2:41
9224 msgid ""
9225 "B<setresuid>()  sets the real user ID, the effective user ID, and the saved "
9226 "set-user-ID of the calling process."
9227 msgstr ""
9228
9229 #. type: Plain text
9230 #: build/C/man2/setresuid.2:47
9231 msgid ""
9232 "Unprivileged user processes may change the real UID, effective UID, and "
9233 "saved set-user-ID, each to one of: the current real UID, the current "
9234 "effective UID or the current saved set-user-ID."
9235 msgstr ""
9236
9237 #. type: Plain text
9238 #: build/C/man2/setresuid.2:51
9239 msgid ""
9240 "Privileged processes (on Linux, those having the B<CAP_SETUID> capability)  "
9241 "may set the real UID, effective UID, and saved set-user-ID to arbitrary "
9242 "values."
9243 msgstr ""
9244
9245 #. type: Plain text
9246 #: build/C/man2/setresuid.2:53
9247 msgid "If one of the arguments equals -1, the corresponding value is not changed."
9248 msgstr ""
9249
9250 #. type: Plain text
9251 #: build/C/man2/setresuid.2:57
9252 msgid ""
9253 "Regardless of what changes are made to the real UID, effective UID, and "
9254 "saved set-user-ID, the filesystem UID is always set to the same value as the "
9255 "(possibly new) effective UID."
9256 msgstr ""
9257
9258 #. type: Plain text
9259 #: build/C/man2/setresuid.2:64
9260 msgid ""
9261 "Completely analogously, B<setresgid>()  sets the real GID, effective GID, "
9262 "and saved set-group-ID of the calling process (and always modifies the "
9263 "filesystem GID to be the same as the effective GID), with the same "
9264 "restrictions for unprivileged processes."
9265 msgstr ""
9266
9267 #. type: Plain text
9268 #: build/C/man2/setresuid.2:76
9269 msgid ""
9270 "I<Note>: there are cases where B<setresuid>()  can fail even when the caller "
9271 "is UID 0; it is a grave security error to omit checking for a failure return "
9272 "from B<setresuid>()."
9273 msgstr ""
9274
9275 #. type: TP
9276 #: 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
9277 #, no-wrap
9278 msgid "B<EAGAIN>"
9279 msgstr ""
9280
9281 #. type: Plain text
9282 #: build/C/man2/setresuid.2:84 build/C/man2/setreuid.2:113
9283 msgid ""
9284 "The call would change the caller's real UID (i.e., I<ruid> does not match "
9285 "the caller's real UID), but there was a temporary failure allocating the "
9286 "necessary kernel data structures."
9287 msgstr ""
9288
9289 #. type: Plain text
9290 #: build/C/man2/setresuid.2:99 build/C/man2/setreuid.2:128
9291 msgid ""
9292 "I<ruid> does not match the caller's real UID and this call would bring the "
9293 "number of processes belonging to the real user ID I<ruid> over the caller's "
9294 "B<RLIMIT_NPROC> resource limit.  Since Linux 3.1, this error case no longer "
9295 "occurs (but robust applications should check for this error); see the "
9296 "description of B<EAGAIN> in B<execve>(2)."
9297 msgstr ""
9298
9299 #. type: Plain text
9300 #: build/C/man2/setresuid.2:103 build/C/man2/setreuid.2:132
9301 msgid ""
9302 "One or more of the target user or group IDs is not valid in this user "
9303 "namespace."
9304 msgstr ""
9305
9306 #. type: Plain text
9307 #: build/C/man2/setresuid.2:107
9308 msgid ""
9309 "The calling process is not privileged (did not have the B<CAP_SETUID> "
9310 "capability) and tried to change the IDs to values that are not permitted."
9311 msgstr ""
9312
9313 #. type: Plain text
9314 #: build/C/man2/setresuid.2:109
9315 msgid "These calls are available under Linux since Linux 2.1.44."
9316 msgstr ""
9317
9318 #. type: Plain text
9319 #: build/C/man2/setresuid.2:116
9320 msgid ""
9321 "Under HP-UX and FreeBSD, the prototype is found in I<E<lt>unistd.hE<gt>>.  "
9322 "Under Linux, the prototype is provided by glibc since version 2.3.2."
9323 msgstr ""
9324
9325 #. type: Plain text
9326 #: build/C/man2/setresuid.2:132
9327 msgid ""
9328 "The original Linux B<setresuid>()  and B<setresgid>()  system calls "
9329 "supported only 16-bit user and group IDs.  Subsequently, Linux 2.4 added "
9330 "B<setresuid32>()  and B<setresgid32>(), supporting 32-bit IDs.  The glibc "
9331 "B<setresuid>()  and B<setresgid>()  wrapper functions transparently deal "
9332 "with the variations across kernel versions."
9333 msgstr ""
9334
9335 #. type: Plain text
9336 #: build/C/man2/setresuid.2:142
9337 msgid ""
9338 "B<getresuid>(2), B<getuid>(2), B<setfsgid>(2), B<setfsuid>(2), "
9339 "B<setreuid>(2), B<setuid>(2), B<capabilities>(7), B<credentials>(7), "
9340 "B<user_namespaces>(7)"
9341 msgstr ""
9342
9343 #. type: TH
9344 #: build/C/man2/setreuid.2:45
9345 #, no-wrap
9346 msgid "SETREUID"
9347 msgstr ""
9348
9349 #. type: Plain text
9350 #: build/C/man2/setreuid.2:48
9351 msgid "setreuid, setregid - set real and/or effective user or group ID"
9352 msgstr ""
9353
9354 #. type: Plain text
9355 #: build/C/man2/setreuid.2:54
9356 msgid "B<int setreuid(uid_t >I<ruid>B<, uid_t >I<euid>B<);>"
9357 msgstr ""
9358
9359 #. type: Plain text
9360 #: build/C/man2/setreuid.2:56
9361 msgid "B<int setregid(gid_t >I<rgid>B<, gid_t >I<egid>B<);>"
9362 msgstr ""
9363
9364 #. type: Plain text
9365 #: build/C/man2/setreuid.2:64
9366 msgid "B<setreuid>(), B<setregid>():"
9367 msgstr ""
9368
9369 #. type: Plain text
9370 #: build/C/man2/setreuid.2:68
9371 msgid ""
9372 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
9373 "_XOPEN_SOURCE_EXTENDED"
9374 msgstr ""
9375
9376 #. type: Plain text
9377 #: build/C/man2/setreuid.2:73
9378 msgid "B<setreuid>()  sets real and effective user IDs of the calling process."
9379 msgstr ""
9380
9381 #. type: Plain text
9382 #: build/C/man2/setreuid.2:76
9383 msgid ""
9384 "Supplying a value of -1 for either the real or effective user ID forces the "
9385 "system to leave that ID unchanged."
9386 msgstr ""
9387
9388 #. type: Plain text
9389 #: build/C/man2/setreuid.2:79
9390 msgid ""
9391 "Unprivileged processes may only set the effective user ID to the real user "
9392 "ID, the effective user ID, or the saved set-user-ID."
9393 msgstr ""
9394
9395 #. type: Plain text
9396 #: build/C/man2/setreuid.2:82
9397 msgid ""
9398 "Unprivileged users may only set the real user ID to the real user ID or the "
9399 "effective user ID."
9400 msgstr ""
9401
9402 #. type: Plain text
9403 #: build/C/man2/setreuid.2:88
9404 msgid ""
9405 "If the real user ID is set (i.e., I<ruid> is not -1) or the effective user "
9406 "ID is set to a value not equal to the previous real user ID, the saved "
9407 "set-user-ID will be set to the new effective user ID."
9408 msgstr ""
9409
9410 #. type: Plain text
9411 #: build/C/man2/setreuid.2:93
9412 msgid ""
9413 "Completely analogously, B<setregid>()  sets real and effective group ID's of "
9414 "the calling process, and all of the above holds with \"group\" instead of "
9415 "\"user\"."
9416 msgstr ""
9417
9418 #. type: Plain text
9419 #: build/C/man2/setreuid.2:105
9420 msgid ""
9421 "I<Note>: there are cases where B<setreuid>()  can fail even when the caller "
9422 "is UID 0; it is a grave security error to omit checking for a failure return "
9423 "from B<setreuid>()."
9424 msgstr ""
9425
9426 #. type: Plain text
9427 #: build/C/man2/setreuid.2:148
9428 msgid ""
9429 "The calling process is not privileged (Linux: does not have the "
9430 "B<CAP_SETUID> capability in the case of B<setreuid>(), or the B<CAP_SETGID> "
9431 "capability in the case of B<setregid>())  and a change other than (i)  "
9432 "swapping the effective user (group) ID with the real user (group) ID, or "
9433 "(ii) setting one to the value of the other or (iii) setting the effective "
9434 "user (group) ID to the value of the saved set-user-ID (saved set-group-ID) "
9435 "was specified."
9436 msgstr ""
9437
9438 #. type: Plain text
9439 #: build/C/man2/setreuid.2:154
9440 msgid ""
9441 "POSIX.1-2001, 4.3BSD (the B<setreuid>()  and B<setregid>()  function calls "
9442 "first appeared in 4.2BSD)."
9443 msgstr ""
9444
9445 #. type: Plain text
9446 #: build/C/man2/setreuid.2:158
9447 msgid ""
9448 "Setting the effective user (group) ID to the saved set-user-ID (saved "
9449 "set-group-ID) is possible since Linux 1.1.37 (1.1.38)."
9450 msgstr ""
9451
9452 #. type: Plain text
9453 #: build/C/man2/setreuid.2:175
9454 msgid ""
9455 "POSIX.1 does not specify all of possible ID changes that are permitted on "
9456 "Linux for an unprivileged process.  For B<setreuid>(), the effective user ID "
9457 "can be made the same as the real user ID or the save set-user-ID, and it is "
9458 "unspecified whether unprivileged processes may set the real user ID to the "
9459 "real user ID, the effective user ID, or the saved set-user-ID.  For "
9460 "B<setregid>(), the real group ID can be changed to the value of the saved "
9461 "set-group-ID, and the effective group ID can be changed to the value of the "
9462 "real group ID or the saved set-group-ID.  The precise details of what ID "
9463 "changes are permitted vary across implementations."
9464 msgstr ""
9465
9466 #. type: Plain text
9467 #: build/C/man2/setreuid.2:178
9468 msgid ""
9469 "POSIX.1 makes no specification about the effect of these calls on the saved "
9470 "set-user-ID and saved set-group-ID."
9471 msgstr ""
9472
9473 #. type: Plain text
9474 #: build/C/man2/setreuid.2:194
9475 msgid ""
9476 "The original Linux B<setreuid>()  and B<setregid>()  system calls supported "
9477 "only 16-bit user and group IDs.  Subsequently, Linux 2.4 added "
9478 "B<setreuid32>()  and B<setregid32>(), supporting 32-bit IDs.  The glibc "
9479 "B<setreuid>()  and B<setregid>()  wrapper functions transparently deal with "
9480 "the variations across kernel versions."
9481 msgstr ""
9482
9483 #. type: Plain text
9484 #: build/C/man2/setreuid.2:203
9485 msgid ""
9486 "B<getgid>(2), B<getuid>(2), B<seteuid>(2), B<setgid>(2), B<setresuid>(2), "
9487 "B<setuid>(2), B<capabilities>(7), B<user_namespaces>(7)"
9488 msgstr ""
9489
9490 #. type: TH
9491 #: build/C/man2/setsid.2:31
9492 #, no-wrap
9493 msgid "SETSID"
9494 msgstr ""
9495
9496 #. type: Plain text
9497 #: build/C/man2/setsid.2:34
9498 msgid "setsid - creates a session and sets the process group ID"
9499 msgstr ""
9500
9501 #. type: Plain text
9502 #: build/C/man2/setsid.2:39
9503 msgid "B<pid_t setsid(void);>"
9504 msgstr ""
9505
9506 #. type: Plain text
9507 #: build/C/man2/setsid.2:50
9508 msgid ""
9509 "B<setsid>()  creates a new session if the calling process is not a process "
9510 "group leader.  The calling process is the leader of the new session (i.e., "
9511 "its session ID is made the same as it process ID).  The calling process also "
9512 "becomes the process group leader of a new process group in the session "
9513 "(i.e., its process group ID is made the same as it process ID)."
9514 msgstr ""
9515
9516 #. type: Plain text
9517 #: build/C/man2/setsid.2:54
9518 msgid ""
9519 "The calling process will be the only process in the new process group and in "
9520 "the new session.  The new session has no controlling terminal."
9521 msgstr ""
9522
9523 #. type: Plain text
9524 #: build/C/man2/setsid.2:61
9525 msgid ""
9526 "On success, the (new) session ID of the calling process is returned.  On "
9527 "error, I<(pid_t)\\ -1> is returned, and I<errno> is set to indicate the "
9528 "error."
9529 msgstr ""
9530
9531 #. type: Plain text
9532 #: build/C/man2/setsid.2:68
9533 msgid ""
9534 "The process group ID of any process equals the PID of the calling process.  "
9535 "Thus, in particular, B<setsid>()  fails if the calling process is already a "
9536 "process group leader."
9537 msgstr ""
9538
9539 #. type: Plain text
9540 #: build/C/man2/setsid.2:76
9541 msgid ""
9542 "A child created via B<fork>(2)  inherits its parent's session ID.  The "
9543 "session ID is preserved across an B<execve>(2)."
9544 msgstr ""
9545
9546 #. type: Plain text
9547 #: build/C/man2/setsid.2:93
9548 msgid ""
9549 "A process group leader is a process whose process group ID equals its PID.  "
9550 "Disallowing a process group leader from calling B<setsid>()  prevents the "
9551 "possibility that a process group leader places itself in a new session while "
9552 "other processes in the process group remain in the original session; such a "
9553 "scenario would break the strict two-level hierarchy of sessions and process "
9554 "groups.  In order to be sure that B<setsid>()  will succeed, B<fork>(2)  and "
9555 "B<_exit>(2), and have the child do B<setsid>()."
9556 msgstr ""
9557
9558 #. type: Plain text
9559 #: build/C/man2/setsid.2:100
9560 msgid ""
9561 "B<setsid>(1), B<getsid>(2), B<setpgid>(2), B<setpgrp>(2), B<tcgetsid>(3), "
9562 "B<credentials>(7)"
9563 msgstr ""
9564
9565 #. type: TH
9566 #: build/C/man2/setuid.2:30
9567 #, no-wrap
9568 msgid "SETUID"
9569 msgstr ""
9570
9571 #. type: Plain text
9572 #: build/C/man2/setuid.2:33
9573 msgid "setuid - set user identity"
9574 msgstr ""
9575
9576 #. type: Plain text
9577 #: build/C/man2/setuid.2:39
9578 msgid "B<int setuid(uid_t >I<uid>B<);>"
9579 msgstr ""
9580
9581 #. type: Plain text
9582 #: build/C/man2/setuid.2:44
9583 msgid ""
9584 "B<setuid>()  sets the effective user ID of the calling process.  If the "
9585 "effective UID of the caller is root, the real UID and saved set-user-ID are "
9586 "also set."
9587 msgstr ""
9588
9589 #. type: Plain text
9590 #: build/C/man2/setuid.2:53
9591 msgid ""
9592 "Under Linux, B<setuid>()  is implemented like the POSIX version with the "
9593 "B<_POSIX_SAVED_IDS> feature.  This allows a set-user-ID (other than root) "
9594 "program to drop all of its user privileges, do some un-privileged work, and "
9595 "then reengage the original effective user ID in a secure manner."
9596 msgstr ""
9597
9598 #. type: Plain text
9599 #: build/C/man2/setuid.2:63
9600 msgid ""
9601 "If the user is root or the program is set-user-ID-root, special care must be "
9602 "taken.  The B<setuid>()  function checks the effective user ID of the caller "
9603 "and if it is the superuser, all process-related user ID's are set to "
9604 "I<uid>.  After this has occurred, it is impossible for the program to regain "
9605 "root privileges."
9606 msgstr ""
9607
9608 #. type: Plain text
9609 #: build/C/man2/setuid.2:70
9610 msgid ""
9611 "Thus, a set-user-ID-root program wishing to temporarily drop root "
9612 "privileges, assume the identity of an unprivileged user, and then regain "
9613 "root privileges afterward cannot use B<setuid>().  You can accomplish this "
9614 "with B<seteuid>(2)."
9615 msgstr ""
9616
9617 #. type: Plain text
9618 #: build/C/man2/setuid.2:82
9619 msgid ""
9620 "I<Note>: there are cases where B<setuid>()  can fail even when the caller is "
9621 "UID 0; it is a grave security error to omit checking for a failure return "
9622 "from B<setuid>()."
9623 msgstr ""
9624
9625 #. type: Plain text
9626 #: build/C/man2/setuid.2:90
9627 msgid ""
9628 "The call would change the caller's real UID (i.e., I<uid> does not match the "
9629 "caller's real UID), but there was a temporary failure allocating the "
9630 "necessary kernel data structures."
9631 msgstr ""
9632
9633 #. type: Plain text
9634 #: build/C/man2/setuid.2:105
9635 msgid ""
9636 "I<uid> does not match the real user ID of the caller and this call would "
9637 "bring the number of processes belonging to the real user ID I<uid> over the "
9638 "caller's B<RLIMIT_NPROC> resource limit.  Since Linux 3.1, this error case "
9639 "no longer occurs (but robust applications should check for this error); see "
9640 "the description of B<EAGAIN> in B<execve>(2)."
9641 msgstr ""
9642
9643 #. type: Plain text
9644 #: build/C/man2/setuid.2:110
9645 msgid "The user ID specified in I<uid> is not valid in this user namespace."
9646 msgstr ""
9647
9648 #. type: Plain text
9649 #: build/C/man2/setuid.2:117
9650 msgid ""
9651 "The user is not privileged (Linux: does not have the B<CAP_SETUID> "
9652 "capability) and I<uid> does not match the real UID or saved set-user-ID of "
9653 "the calling process."
9654 msgstr ""
9655
9656 #.  SVr4 documents an additional EINVAL error condition.
9657 #. type: Plain text
9658 #: build/C/man2/setuid.2:122
9659 msgid ""
9660 "SVr4, POSIX.1-2001.  Not quite compatible with the 4.4BSD call, which sets "
9661 "all of the real, saved, and effective user IDs."
9662 msgstr ""
9663
9664 #. type: Plain text
9665 #: build/C/man2/setuid.2:130
9666 msgid ""
9667 "Linux has the concept of the filesystem user ID, normally equal to the "
9668 "effective user ID.  The B<setuid>()  call also sets the filesystem user ID "
9669 "of the calling process.  See B<setfsuid>(2)."
9670 msgstr ""
9671
9672 #. type: Plain text
9673 #: build/C/man2/setuid.2:135
9674 msgid ""
9675 "If I<uid> is different from the old effective UID, the process will be "
9676 "forbidden from leaving core dumps."
9677 msgstr ""
9678
9679 #. type: Plain text
9680 #: build/C/man2/setuid.2:145
9681 msgid ""
9682 "The original Linux B<setuid>()  system call supported only 16-bit user IDs.  "
9683 "Subsequently, Linux 2.4 added B<setuid32>()  supporting 32-bit IDs.  The "
9684 "glibc B<setuid>()  wrapper function transparently deals with the variation "
9685 "across kernel versions."
9686 msgstr ""
9687
9688 #. type: Plain text
9689 #: build/C/man2/setuid.2:153
9690 msgid ""
9691 "B<getuid>(2), B<seteuid>(2), B<setfsuid>(2), B<setreuid>(2), "
9692 "B<capabilities>(7), B<credentials>(7), B<user_namespaces>(7)"
9693 msgstr ""
9694
9695 #. type: TH
9696 #: build/C/man7/svipc.7:40
9697 #, no-wrap
9698 msgid "SVIPC"
9699 msgstr ""
9700
9701 #. type: Plain text
9702 #: build/C/man7/svipc.7:43
9703 msgid "svipc - System V interprocess communication mechanisms"
9704 msgstr ""
9705
9706 #. type: Plain text
9707 #: build/C/man7/svipc.7:48
9708 #, no-wrap
9709 msgid ""
9710 "B<#include E<lt>sys/msg.hE<gt>>\n"
9711 "B<#include E<lt>sys/sem.hE<gt>>\n"
9712 "B<#include E<lt>sys/shm.hE<gt>>\n"
9713 msgstr ""
9714
9715 #. type: Plain text
9716 #: build/C/man7/svipc.7:56
9717 msgid ""
9718 "This manual page refers to the Linux implementation of the System V "
9719 "interprocess communication (IPC) mechanisms: message queues, semaphore sets, "
9720 "and shared memory segments.  In the following, the word I<resource> means an "
9721 "instantiation of one among such mechanisms."
9722 msgstr ""
9723
9724 #. type: SS
9725 #: build/C/man7/svipc.7:56
9726 #, no-wrap
9727 msgid "Resource access permissions"
9728 msgstr ""
9729
9730 #. type: Plain text
9731 #: build/C/man7/svipc.7:64
9732 msgid ""
9733 "For each resource, the system uses a common structure of type I<struct "
9734 "ipc_perm> to store information needed in determining permissions to perform "
9735 "an IPC operation.  The I<ipc_perm> structure includes the following members:"
9736 msgstr ""
9737
9738 #. type: Plain text
9739 #: build/C/man7/svipc.7:74
9740 #, no-wrap
9741 msgid ""
9742 "struct ipc_perm {\n"
9743 "    uid_t          cuid;   /* creator user ID */\n"
9744 "    gid_t          cgid;   /* creator group ID */\n"
9745 "    uid_t          uid;    /* owner user ID */\n"
9746 "    gid_t          gid;    /* owner group ID */\n"
9747 "    unsigned short mode;   /* r/w permissions */\n"
9748 "};\n"
9749 msgstr ""
9750
9751 #. type: Plain text
9752 #: build/C/man7/svipc.7:84
9753 msgid ""
9754 "The I<mode> member of the I<ipc_perm> structure defines, with its lower 9 "
9755 "bits, the access permissions to the resource for a process executing an IPC "
9756 "system call.  The permissions are interpreted as follows:"
9757 msgstr ""
9758
9759 #. type: Plain text
9760 #: build/C/man7/svipc.7:88
9761 #, no-wrap
9762 msgid ""
9763 "    0400    Read by user.\n"
9764 "    0200    Write by user.\n"
9765 msgstr ""
9766
9767 #. type: Plain text
9768 #: build/C/man7/svipc.7:91
9769 #, no-wrap
9770 msgid ""
9771 "    0040    Read by group.\n"
9772 "    0020    Write by group.\n"
9773 msgstr ""
9774
9775 #. type: Plain text
9776 #: build/C/man7/svipc.7:94
9777 #, no-wrap
9778 msgid ""
9779 "    0004    Read by others.\n"
9780 "    0002    Write by others.\n"
9781 msgstr ""
9782
9783 #. type: Plain text
9784 #: build/C/man7/svipc.7:102
9785 msgid ""
9786 "Bits 0100, 0010, and 0001 (the execute bits) are unused by the system.  "
9787 "Furthermore, \"write\" effectively means \"alter\" for a semaphore set."
9788 msgstr ""
9789
9790 #. type: Plain text
9791 #: build/C/man7/svipc.7:105
9792 msgid "The same system header file also defines the following symbolic constants:"
9793 msgstr ""
9794
9795 #. type: TP
9796 #: build/C/man7/svipc.7:105
9797 #, no-wrap
9798 msgid "B<IPC_CREAT>"
9799 msgstr ""
9800
9801 #. type: Plain text
9802 #: build/C/man7/svipc.7:108
9803 msgid "Create entry if key doesn't exist."
9804 msgstr ""
9805
9806 #. type: TP
9807 #: build/C/man7/svipc.7:108
9808 #, no-wrap
9809 msgid "B<IPC_EXCL>"
9810 msgstr ""
9811
9812 #. type: Plain text
9813 #: build/C/man7/svipc.7:111
9814 msgid "Fail if key exists."
9815 msgstr ""
9816
9817 #. type: TP
9818 #: build/C/man7/svipc.7:111
9819 #, no-wrap
9820 msgid "B<IPC_NOWAIT>"
9821 msgstr ""
9822
9823 #. type: Plain text
9824 #: build/C/man7/svipc.7:114
9825 msgid "Error if request must wait."
9826 msgstr ""
9827
9828 #. type: TP
9829 #: build/C/man7/svipc.7:114
9830 #, no-wrap
9831 msgid "B<IPC_PRIVATE>"
9832 msgstr ""
9833
9834 #. type: Plain text
9835 #: build/C/man7/svipc.7:117
9836 msgid "Private key."
9837 msgstr ""
9838
9839 #. type: TP
9840 #: build/C/man7/svipc.7:117
9841 #, no-wrap
9842 msgid "B<IPC_RMID>"
9843 msgstr ""
9844
9845 #. type: Plain text
9846 #: build/C/man7/svipc.7:120
9847 msgid "Remove resource."
9848 msgstr ""
9849
9850 #. type: TP
9851 #: build/C/man7/svipc.7:120
9852 #, no-wrap
9853 msgid "B<IPC_SET>"
9854 msgstr ""
9855
9856 #. type: Plain text
9857 #: build/C/man7/svipc.7:123
9858 msgid "Set resource options."
9859 msgstr ""
9860
9861 #. type: TP
9862 #: build/C/man7/svipc.7:123
9863 #, no-wrap
9864 msgid "B<IPC_STAT>"
9865 msgstr ""
9866
9867 #. type: Plain text
9868 #: build/C/man7/svipc.7:126
9869 msgid "Get resource options."
9870 msgstr ""
9871
9872 #. type: Plain text
9873 #: build/C/man7/svipc.7:135
9874 msgid ""
9875 "Note that B<IPC_PRIVATE> is a I<key_t> type, while all the other symbolic "
9876 "constants are flag fields and can be OR'ed into an I<int> type variable."
9877 msgstr ""
9878
9879 #. type: SS
9880 #: build/C/man7/svipc.7:135
9881 #, no-wrap
9882 msgid "Message queues"
9883 msgstr ""
9884
9885 #. type: Plain text
9886 #: build/C/man7/svipc.7:143
9887 msgid ""
9888 "A message queue is uniquely identified by a positive integer (its I<msqid>)  "
9889 "and has an associated data structure of type I<struct msqid_ds>, defined in "
9890 "I<E<lt>sys/msg.hE<gt>>, containing the following members:"
9891 msgstr ""
9892
9893 #. type: Plain text
9894 #: build/C/man7/svipc.7:156
9895 #, no-wrap
9896 msgid ""
9897 "struct msqid_ds {\n"
9898 "    struct ipc_perm msg_perm;\n"
9899 "    msgqnum_t       msg_qnum;    /* no of messages on queue */\n"
9900 "    msglen_t        msg_qbytes;  /* bytes max on a queue */\n"
9901 "    pid_t           msg_lspid;   /* PID of last msgsnd(2) call */\n"
9902 "    pid_t           msg_lrpid;   /* PID of last msgrcv(2) call */\n"
9903 "    time_t          msg_stime;   /* last msgsnd(2) time */\n"
9904 "    time_t          msg_rtime;   /* last msgrcv(2) time */\n"
9905 "    time_t          msg_ctime;   /* last change time */\n"
9906 "};\n"
9907 msgstr ""
9908
9909 #. type: TP
9910 #: build/C/man7/svipc.7:158
9911 #, no-wrap
9912 msgid "I<msg_perm>"
9913 msgstr ""
9914
9915 #. type: Plain text
9916 #: build/C/man7/svipc.7:163
9917 msgid ""
9918 "I<ipc_perm> structure that specifies the access permissions on the message "
9919 "queue."
9920 msgstr ""
9921
9922 #. type: TP
9923 #: build/C/man7/svipc.7:163
9924 #, no-wrap
9925 msgid "I<msg_qnum>"
9926 msgstr ""
9927
9928 #. type: Plain text
9929 #: build/C/man7/svipc.7:166
9930 msgid "Number of messages currently on the message queue."
9931 msgstr ""
9932
9933 #. type: TP
9934 #: build/C/man7/svipc.7:166
9935 #, no-wrap
9936 msgid "I<msg_qbytes>"
9937 msgstr ""
9938
9939 #. type: Plain text
9940 #: build/C/man7/svipc.7:170
9941 msgid "Maximum number of bytes of message text allowed on the message queue."
9942 msgstr ""
9943
9944 #. type: TP
9945 #: build/C/man7/svipc.7:170
9946 #, no-wrap
9947 msgid "I<msg_lspid>"
9948 msgstr ""
9949
9950 #. type: Plain text
9951 #: build/C/man7/svipc.7:175
9952 msgid "ID of the process that performed the last B<msgsnd>(2)  system call."
9953 msgstr ""
9954
9955 #. type: TP
9956 #: build/C/man7/svipc.7:175
9957 #, no-wrap
9958 msgid "I<msg_lrpid>"
9959 msgstr ""
9960
9961 #. type: Plain text
9962 #: build/C/man7/svipc.7:180
9963 msgid "ID of the process that performed the last B<msgrcv>(2)  system call."
9964 msgstr ""
9965
9966 #. type: TP
9967 #: build/C/man7/svipc.7:180
9968 #, no-wrap
9969 msgid "I<msg_stime>"
9970 msgstr ""
9971
9972 #. type: Plain text
9973 #: build/C/man7/svipc.7:185
9974 msgid "Time of the last B<msgsnd>(2)  system call."
9975 msgstr ""
9976
9977 #. type: TP
9978 #: build/C/man7/svipc.7:185
9979 #, no-wrap
9980 msgid "I<msg_rtime>"
9981 msgstr ""
9982
9983 #. type: Plain text
9984 #: build/C/man7/svipc.7:190
9985 msgid "Time of the last B<msgrcv>(2)  system call."
9986 msgstr ""
9987
9988 #. type: TP
9989 #: build/C/man7/svipc.7:190
9990 #, no-wrap
9991 msgid "I<msg_ctime>"
9992 msgstr ""
9993
9994 #. type: Plain text
9995 #: build/C/man7/svipc.7:196
9996 msgid ""
9997 "Time of the last system call that changed a member of the I<msqid_ds> "
9998 "structure."
9999 msgstr ""
10000
10001 #. type: SS
10002 #: build/C/man7/svipc.7:196
10003 #, no-wrap
10004 msgid "Semaphore sets"
10005 msgstr ""
10006
10007 #. type: Plain text
10008 #: build/C/man7/svipc.7:204
10009 msgid ""
10010 "A semaphore set is uniquely identified by a positive integer (its I<semid>)  "
10011 "and has an associated data structure of type I<struct semid_ds>, defined in "
10012 "I<E<lt>sys/sem.hE<gt>>, containing the following members:"
10013 msgstr ""
10014
10015 #. type: Plain text
10016 #: build/C/man7/svipc.7:213
10017 #, no-wrap
10018 msgid ""
10019 "struct semid_ds {\n"
10020 "    struct ipc_perm sem_perm;\n"
10021 "    time_t          sem_otime;   /* last operation time */\n"
10022 "    time_t          sem_ctime;   /* last change time */\n"
10023 "    unsigned long   sem_nsems;   /* count of sems in set */\n"
10024 "};\n"
10025 msgstr ""
10026
10027 #. type: TP
10028 #: build/C/man7/svipc.7:215
10029 #, no-wrap
10030 msgid "I<sem_perm>"
10031 msgstr ""
10032
10033 #. type: Plain text
10034 #: build/C/man7/svipc.7:220
10035 msgid ""
10036 "I<ipc_perm> structure that specifies the access permissions on the semaphore "
10037 "set."
10038 msgstr ""
10039
10040 #. type: TP
10041 #: build/C/man7/svipc.7:220
10042 #, no-wrap
10043 msgid "I<sem_otime>"
10044 msgstr ""
10045
10046 #. type: Plain text
10047 #: build/C/man7/svipc.7:225
10048 msgid "Time of last B<semop>(2)  system call."
10049 msgstr ""
10050
10051 #. type: TP
10052 #: build/C/man7/svipc.7:225
10053 #, no-wrap
10054 msgid "I<sem_ctime>"
10055 msgstr ""
10056
10057 #. type: Plain text
10058 #: build/C/man7/svipc.7:231
10059 msgid ""
10060 "Time of last B<semctl>(2)  system call that changed a member of the above "
10061 "structure or of one semaphore belonging to the set."
10062 msgstr ""
10063
10064 #. type: TP
10065 #: build/C/man7/svipc.7:231
10066 #, no-wrap
10067 msgid "I<sem_nsems>"
10068 msgstr ""
10069
10070 #. type: Plain text
10071 #: build/C/man7/svipc.7:239
10072 msgid ""
10073 "Number of semaphores in the set.  Each semaphore of the set is referenced by "
10074 "a nonnegative integer ranging from B<0> to I<sem_nsems-1>."
10075 msgstr ""
10076
10077 #. type: Plain text
10078 #: build/C/man7/svipc.7:243
10079 msgid ""
10080 "A semaphore is a data structure of type I<struct sem> containing the "
10081 "following members:"
10082 msgstr ""
10083
10084 #.     unsigned short semncnt; /* nr awaiting semval to increase */
10085 #.     unsigned short semzcnt; /* nr awaiting semval = 0 */
10086 #. type: Plain text
10087 #: build/C/man7/svipc.7:252
10088 #, no-wrap
10089 msgid ""
10090 "struct sem {\n"
10091 "    int semval;  /* semaphore value */\n"
10092 "    int sempid;  /* PID for last operation */\n"
10093 "};\n"
10094 msgstr ""
10095
10096 #. type: TP
10097 #: build/C/man7/svipc.7:254
10098 #, no-wrap
10099 msgid "I<semval>"
10100 msgstr ""
10101
10102 #. type: Plain text
10103 #: build/C/man7/svipc.7:257
10104 msgid "Semaphore value: a nonnegative integer."
10105 msgstr ""
10106
10107 #. type: TP
10108 #: build/C/man7/svipc.7:257
10109 #, no-wrap
10110 msgid "I<sempid>"
10111 msgstr ""
10112
10113 #. .TP
10114 #. .I semncnt
10115 #. Number of processes suspended awaiting for
10116 #. .I semval
10117 #. to increase.
10118 #. .TP
10119 #. .I semznt
10120 #. Number of processes suspended awaiting for
10121 #. .I semval
10122 #. to become zero.
10123 #. type: Plain text
10124 #: build/C/man7/svipc.7:271
10125 msgid ""
10126 "ID of the last process that performed a semaphore operation on this "
10127 "semaphore."
10128 msgstr ""
10129
10130 #. type: SS
10131 #: build/C/man7/svipc.7:271
10132 #, no-wrap
10133 msgid "Shared memory segments"
10134 msgstr ""
10135
10136 #. type: Plain text
10137 #: build/C/man7/svipc.7:279
10138 msgid ""
10139 "A shared memory segment is uniquely identified by a positive integer (its "
10140 "I<shmid>)  and has an associated data structure of type I<struct shmid_ds>, "
10141 "defined in I<E<lt>sys/shm.hE<gt>>, containing the following members:"
10142 msgstr ""
10143
10144 #. type: Plain text
10145 #: build/C/man7/svipc.7:292
10146 #, no-wrap
10147 msgid ""
10148 "struct shmid_ds {\n"
10149 "    struct ipc_perm shm_perm;\n"
10150 "    size_t          shm_segsz;   /* size of segment */\n"
10151 "    pid_t           shm_cpid;    /* PID of creator */\n"
10152 "    pid_t           shm_lpid;    /* PID, last operation */\n"
10153 "    shmatt_t        shm_nattch;  /* no. of current attaches */\n"
10154 "    time_t          shm_atime;   /* time of last attach */\n"
10155 "    time_t          shm_dtime;   /* time of last detach */\n"
10156 "    time_t          shm_ctime;   /* time of last change */\n"
10157 "};\n"
10158 msgstr ""
10159
10160 #. type: TP
10161 #: build/C/man7/svipc.7:294
10162 #, no-wrap
10163 msgid "I<shm_perm>"
10164 msgstr ""
10165
10166 #. type: Plain text
10167 #: build/C/man7/svipc.7:299
10168 msgid ""
10169 "I<ipc_perm> structure that specifies the access permissions on the shared "
10170 "memory segment."
10171 msgstr ""
10172
10173 #. type: TP
10174 #: build/C/man7/svipc.7:299
10175 #, no-wrap
10176 msgid "I<shm_segsz>"
10177 msgstr ""
10178
10179 #. type: Plain text
10180 #: build/C/man7/svipc.7:302
10181 msgid "Size in bytes of the shared memory segment."
10182 msgstr ""
10183
10184 #. type: TP
10185 #: build/C/man7/svipc.7:302
10186 #, no-wrap
10187 msgid "I<shm_cpid>"
10188 msgstr ""
10189
10190 #. type: Plain text
10191 #: build/C/man7/svipc.7:305
10192 msgid "ID of the process that created the shared memory segment."
10193 msgstr ""
10194
10195 #. type: TP
10196 #: build/C/man7/svipc.7:305
10197 #, no-wrap
10198 msgid "I<shm_lpid>"
10199 msgstr ""
10200
10201 #. type: Plain text
10202 #: build/C/man7/svipc.7:312
10203 msgid ""
10204 "ID of the last process that executed a B<shmat>(2)  or B<shmdt>(2)  system "
10205 "call."
10206 msgstr ""
10207
10208 #. type: TP
10209 #: build/C/man7/svipc.7:312
10210 #, no-wrap
10211 msgid "I<shm_nattch>"
10212 msgstr ""
10213
10214 #. type: Plain text
10215 #: build/C/man7/svipc.7:315
10216 msgid "Number of current alive attaches for this shared memory segment."
10217 msgstr ""
10218
10219 #. type: TP
10220 #: build/C/man7/svipc.7:315
10221 #, no-wrap
10222 msgid "I<shm_atime>"
10223 msgstr ""
10224
10225 #. type: Plain text
10226 #: build/C/man7/svipc.7:320
10227 msgid "Time of the last B<shmat>(2)  system call."
10228 msgstr ""
10229
10230 #. type: TP
10231 #: build/C/man7/svipc.7:320
10232 #, no-wrap
10233 msgid "I<shm_dtime>"
10234 msgstr ""
10235
10236 #. type: Plain text
10237 #: build/C/man7/svipc.7:325
10238 msgid "Time of the last B<shmdt>(2)  system call."
10239 msgstr ""
10240
10241 #. type: TP
10242 #: build/C/man7/svipc.7:325
10243 #, no-wrap
10244 msgid "I<shm_ctime>"
10245 msgstr ""
10246
10247 #. type: Plain text
10248 #: build/C/man7/svipc.7:331
10249 msgid "Time of the last B<shmctl>(2)  system call that changed I<shmid_ds>."
10250 msgstr ""
10251
10252 #. type: SS
10253 #: build/C/man7/svipc.7:331
10254 #, no-wrap
10255 msgid "IPC namespaces"
10256 msgstr ""
10257
10258 #. type: Plain text
10259 #: build/C/man7/svipc.7:335
10260 msgid ""
10261 "For a discussion of the interaction of System V IPC objects and IPC "
10262 "namespaces, see B<namespaces>(7)."
10263 msgstr ""
10264
10265 #. type: Plain text
10266 #: build/C/man7/svipc.7:353
10267 msgid ""
10268 "B<ipcmk>(1), B<ipcrm>(1), B<ipcs>(1), B<ipc>(2), B<msgctl>(2), B<msgget>(2), "
10269 "B<msgrcv>(2), B<msgsnd>(2), B<semctl>(2), B<semget>(2), B<semop>(2), "
10270 "B<shmat>(2), B<shmctl>(2), B<shmdt>(2), B<shmget>(2), B<ftok>(3), "
10271 "B<namespaces>(7)"
10272 msgstr ""
10273
10274 #. type: TH
10275 #: build/C/man3/ulimit.3:27
10276 #, no-wrap
10277 msgid "ULIMIT"
10278 msgstr ""
10279
10280 #. type: TH
10281 #: build/C/man3/ulimit.3:27
10282 #, no-wrap
10283 msgid "2008-08-06"
10284 msgstr ""
10285
10286 #. type: Plain text
10287 #: build/C/man3/ulimit.3:30
10288 msgid "ulimit - get and set user limits"
10289 msgstr ""
10290
10291 #. type: Plain text
10292 #: build/C/man3/ulimit.3:32
10293 msgid "B<#include E<lt>ulimit.hE<gt>>"
10294 msgstr ""
10295
10296 #. type: Plain text
10297 #: build/C/man3/ulimit.3:34
10298 msgid "B<long ulimit(int >I<cmd>B<, long >I<newlimit>B<);>"
10299 msgstr ""
10300
10301 #. type: Plain text
10302 #: build/C/man3/ulimit.3:46
10303 msgid ""
10304 "Warning: This routine is obsolete.  Use B<getrlimit>(2), B<setrlimit>(2), "
10305 "and B<sysconf>(3)  instead.  For the shell command B<ulimit>(), see "
10306 "B<bash>(1)."
10307 msgstr ""
10308
10309 #. type: Plain text
10310 #: build/C/man3/ulimit.3:53
10311 msgid ""
10312 "The B<ulimit>()  call will get or set some limit for the calling process.  "
10313 "The I<cmd> argument can have one of the following values."
10314 msgstr ""
10315
10316 #. type: TP
10317 #: build/C/man3/ulimit.3:53
10318 #, no-wrap
10319 msgid "B<UL_GETFSIZE>"
10320 msgstr ""
10321
10322 #. type: Plain text
10323 #: build/C/man3/ulimit.3:56
10324 msgid "Return the limit on the size of a file, in units of 512 bytes."
10325 msgstr ""
10326
10327 #. type: TP
10328 #: build/C/man3/ulimit.3:56
10329 #, no-wrap
10330 msgid "B<UL_SETFSIZE>"
10331 msgstr ""
10332
10333 #. type: Plain text
10334 #: build/C/man3/ulimit.3:59
10335 msgid "Set the limit on the size of a file."
10336 msgstr ""
10337
10338 #. type: TP
10339 #: build/C/man3/ulimit.3:59
10340 #, no-wrap
10341 msgid "B<3>"
10342 msgstr ""
10343
10344 #. type: Plain text
10345 #: build/C/man3/ulimit.3:63
10346 msgid ""
10347 "(Not implemented for Linux.)  Return the maximum possible address of the "
10348 "data segment."
10349 msgstr ""
10350
10351 #. type: TP
10352 #: build/C/man3/ulimit.3:63
10353 #, no-wrap
10354 msgid "B<4>"
10355 msgstr ""
10356
10357 #. type: Plain text
10358 #: build/C/man3/ulimit.3:67
10359 msgid ""
10360 "(Implemented but no symbolic constant provided.)  Return the maximum number "
10361 "of files that the calling process can open."
10362 msgstr ""
10363
10364 #. type: Plain text
10365 #: build/C/man3/ulimit.3:74
10366 msgid ""
10367 "On success, B<ulimit>()  returns a nonnegative value.  On error, -1 is "
10368 "returned, and I<errno> is set appropriately."
10369 msgstr ""
10370
10371 #. type: Plain text
10372 #: build/C/man3/ulimit.3:78
10373 msgid "A unprivileged process tried to increase a limit."
10374 msgstr ""
10375
10376 #. type: Plain text
10377 #: build/C/man3/ulimit.3:83
10378 msgid "SVr4, POSIX.1-2001.  POSIX.1-2008 marks B<ulimit>()  as obsolete."
10379 msgstr ""
10380
10381 #. type: Plain text
10382 #: build/C/man3/ulimit.3:88
10383 msgid "B<bash>(1), B<getrlimit>(2), B<setrlimit>(2), B<sysconf>(3)"
10384 msgstr ""
10385
10386 #. type: TH
10387 #: build/C/man7/user_namespaces.7:27
10388 #, no-wrap
10389 msgid "USER_NAMESPACES"
10390 msgstr ""
10391
10392 #. type: Plain text
10393 #: build/C/man7/user_namespaces.7:30
10394 msgid "user_namespaces - overview of Linux user namespaces"
10395 msgstr ""
10396
10397 #.  FIXME: This page says very little about the interaction
10398 #.  of user namespaces and keys. Add something on this topic.
10399 #
10400 #.  ============================================================
10401 #. type: Plain text
10402 #: build/C/man7/user_namespaces.7:56
10403 msgid ""
10404 "User namespaces isolate security-related identifiers and attributes, in "
10405 "particular, user IDs and group IDs (see B<credentials>(7)), the root "
10406 "directory, keys (see B<keyctl>(2)), and capabilities (see "
10407 "B<capabilities>(7)).  A process's user and group IDs can be different inside "
10408 "and outside a user namespace.  In particular, a process can have a normal "
10409 "unprivileged user ID outside a user namespace while at the same time having "
10410 "a user ID of 0 inside the namespace; in other words, the process has full "
10411 "privileges for operations inside the user namespace, but is unprivileged for "
10412 "operations outside the namespace."
10413 msgstr ""
10414
10415 #. type: SS
10416 #: build/C/man7/user_namespaces.7:56
10417 #, no-wrap
10418 msgid "Nested namespaces, namespace membership"
10419 msgstr ""
10420
10421 #. type: Plain text
10422 #: build/C/man7/user_namespaces.7:69
10423 msgid ""
10424 "User namespaces can be nested; that is, each user namespace\\(emexcept the "
10425 "initial (\"root\")  namespace\\(emhas a parent user namespace, and can have "
10426 "zero or more child user namespaces.  The parent user namespace is the user "
10427 "namespace of the process that creates the user namespace via a call to "
10428 "B<unshare>(2)  or B<clone>(2)  with the B<CLONE_NEWUSER> flag."
10429 msgstr ""
10430
10431 #.  commit 8742f229b635bf1c1c84a3dfe5e47c814c20b5c8
10432 #.  FIXME Explain the rationale for this limit. (What is the rationale?)
10433 #. type: Plain text
10434 #: build/C/man7/user_namespaces.7:80
10435 msgid ""
10436 "The kernel imposes (since version 3.11) a limit of 32 nested levels of user "
10437 "namespaces.  Calls to B<unshare>(2)  or B<clone>(2)  that would cause this "
10438 "limit to be exceeded fail with the error B<EUSERS>."
10439 msgstr ""
10440
10441 #. type: Plain text
10442 #: build/C/man7/user_namespaces.7:95
10443 msgid ""
10444 "Each process is a member of exactly one user namespace.  A process created "
10445 "via B<fork>(2)  or B<clone>(2)  without the B<CLONE_NEWUSER> flag is a "
10446 "member of the same user namespace as its parent.  A single-threaded process "
10447 "can join another user namespace with B<setns>(2)  if it has the "
10448 "B<CAP_SYS_ADMIN> in that namespace; upon doing so, it gains a full set of "
10449 "capabilities in that namespace."
10450 msgstr ""
10451
10452 #
10453 #.  ============================================================
10454 #. type: Plain text
10455 #: build/C/man7/user_namespaces.7:110
10456 msgid ""
10457 "A call to B<clone>(2)  or B<unshare>(2)  with the B<CLONE_NEWUSER> flag "
10458 "makes the new child process (for B<clone>(2))  or the caller (for "
10459 "B<unshare>(2))  a member of the new user namespace created by the call."
10460 msgstr ""
10461
10462 #. type: SS
10463 #: build/C/man7/user_namespaces.7:110
10464 #, no-wrap
10465 msgid "Capabilities"
10466 msgstr ""
10467
10468 #. type: Plain text
10469 #: build/C/man7/user_namespaces.7:132
10470 msgid ""
10471 "The child process created by B<clone>(2)  with the B<CLONE_NEWUSER> flag "
10472 "starts out with a complete set of capabilities in the new user namespace.  "
10473 "Likewise, a process that creates a new user namespace using B<unshare>(2)  "
10474 "or joins an existing user namespace using B<setns>(2)  gains a full set of "
10475 "capabilities in that namespace.  On the other hand, that process has no "
10476 "capabilities in the parent (in the case of B<clone>(2))  or previous (in the "
10477 "case of B<unshare>(2)  and B<setns>(2))  user namespace, even if the new "
10478 "namespace is created or joined by the root user (i.e., a process with user "
10479 "ID 0 in the root namespace)."
10480 msgstr ""
10481
10482 #. type: Plain text
10483 #: build/C/man7/user_namespaces.7:142
10484 msgid ""
10485 "Note that a call to B<execve>(2)  will cause a process's capabilities to be "
10486 "recalculated in the usual way (see B<capabilities>(7)), so that usually, "
10487 "unless it has a user ID of 0 within the namespace or the executable file has "
10488 "a nonempty inheritable capabilities mask, it will lose all capabilities.  "
10489 "See the discussion of user and group ID mappings, below."
10490 msgstr ""
10491
10492 #. type: Plain text
10493 #: build/C/man7/user_namespaces.7:167
10494 msgid ""
10495 "A call to B<clone>(2), B<unshare>(2), or B<setns>(2)  using the "
10496 "B<CLONE_NEWUSER> flag sets the \"securebits\" flags (see B<capabilities>(7))  "
10497 "to their default values (all flags disabled) in the child (for B<clone>(2))  "
10498 "or caller (for B<unshare>(2), or B<setns>(2)).  Note that because the caller "
10499 "no longer has capabilities in its original user namespace after a call to "
10500 "B<setns>(2), it is not possible for a process to reset its \"securebits\" "
10501 "flags while retaining its user namespace membership by using a pair of "
10502 "B<setns>(2)  calls to move to another user namespace and then return to its "
10503 "original user namespace."
10504 msgstr ""
10505
10506 #. type: Plain text
10507 #: build/C/man7/user_namespaces.7:173
10508 msgid ""
10509 "Having a capability inside a user namespace permits a process to perform "
10510 "operations (that require privilege)  only on resources governed by that "
10511 "namespace.  The rules for determining whether or not a process has a "
10512 "capability in a particular user namespace are as follows:"
10513 msgstr ""
10514
10515 #.  In the 3.8 sources, see security/commoncap.c::cap_capable():
10516 #. type: Plain text
10517 #: build/C/man7/user_namespaces.7:189
10518 msgid ""
10519 "A process has a capability inside a user namespace if it is a member of that "
10520 "namespace and it has the capability in its effective capability set.  A "
10521 "process can gain capabilities in its effective capability set in various "
10522 "ways.  For example, it may execute a set-user-ID program or an executable "
10523 "with associated file capabilities.  In addition, a process may gain "
10524 "capabilities via the effect of B<clone>(2), B<unshare>(2), or B<setns>(2), "
10525 "as already described."
10526 msgstr ""
10527
10528 #. type: Plain text
10529 #: build/C/man7/user_namespaces.7:193
10530 msgid ""
10531 "If a process has a capability in a user namespace, then it has that "
10532 "capability in all child (and further removed descendant)  namespaces as "
10533 "well."
10534 msgstr ""
10535
10536 #.  * The owner of the user namespace in the parent of the
10537 #.  * user namespace has all caps.
10538 #.  (and likewise associates the effective group ID of the creating process
10539 #.  with the namespace).
10540 #.  See kernel commit 520d9eabce18edfef76a60b7b839d54facafe1f9 for a fix
10541 #.  on this point
10542 #.      This includes the case where the process executes a set-user-ID
10543 #.      program that confers the effective UID of the creator of the namespace.
10544 #
10545 #.  ============================================================
10546 #. type: Plain text
10547 #: build/C/man7/user_namespaces.7:214
10548 msgid ""
10549 "When a user namespace is created, the kernel records the effective user ID "
10550 "of the creating process as being the \"owner\" of the namespace.  A process "
10551 "that resides in the parent of the user namespace and whose effective user ID "
10552 "matches the owner of the namespace has all capabilities in the namespace.  "
10553 "By virtue of the previous rule, this means that the process has all "
10554 "capabilities in all further removed descendant user namespaces as well."
10555 msgstr ""
10556
10557 #. type: SS
10558 #: build/C/man7/user_namespaces.7:214
10559 #, no-wrap
10560 msgid "Interaction of user namespaces and other types of namespaces"
10561 msgstr ""
10562
10563 #. type: Plain text
10564 #: build/C/man7/user_namespaces.7:219
10565 msgid ""
10566 "Starting in Linux 3.8, unprivileged processes can create user namespaces, "
10567 "and mount, PID, IPC, network, and UTS namespaces can be created with just "
10568 "the B<CAP_SYS_ADMIN> capability in the caller's user namespace."
10569 msgstr ""
10570
10571 #. type: Plain text
10572 #: build/C/man7/user_namespaces.7:225
10573 msgid ""
10574 "When a non-user-namespace is created, it is owned by the user namespace in "
10575 "which the creating process was a member at the time of the creation of the "
10576 "namespace.  Actions on the non-user-namespace require capabilities in the "
10577 "corresponding user namespace."
10578 msgstr ""
10579
10580 #. type: Plain text
10581 #: build/C/man7/user_namespaces.7:242
10582 msgid ""
10583 "If B<CLONE_NEWUSER> is specified along with other B<CLONE_NEW*> flags in a "
10584 "single B<clone>(2)  or B<unshare>(2)  call, the user namespace is guaranteed "
10585 "to be created first, giving the child (B<clone>(2))  or caller "
10586 "(B<unshare>(2))  privileges over the remaining namespaces created by the "
10587 "call.  Thus, it is possible for an unprivileged caller to specify this "
10588 "combination of flags."
10589 msgstr ""
10590
10591 #
10592 #.  ============================================================
10593 #. type: Plain text
10594 #: build/C/man7/user_namespaces.7:258
10595 msgid ""
10596 "When a new IPC, mount, network, PID, or UTS namespace is created via "
10597 "B<clone>(2)  or B<unshare>(2), the kernel records the user namespace of the "
10598 "creating process against the new namespace.  (This association can't be "
10599 "changed.)  When a process in the new namespace subsequently performs "
10600 "privileged operations that operate on global resources isolated by the "
10601 "namespace, the permission checks are performed according to the process's "
10602 "capabilities in the user namespace that the kernel associated with the new "
10603 "namespace."
10604 msgstr ""
10605
10606 #. type: SS
10607 #: build/C/man7/user_namespaces.7:258
10608 #, no-wrap
10609 msgid "Restrictions on mount namespaces"
10610 msgstr ""
10611
10612 #. type: Plain text
10613 #: build/C/man7/user_namespaces.7:261
10614 msgid "Note the following points with respect to mount namespaces:"
10615 msgstr ""
10616
10617 #. type: Plain text
10618 #: build/C/man7/user_namespaces.7:266
10619 msgid ""
10620 "A mount namespace has an owner user namespace.  A mount namespace whose "
10621 "owner user namespace is different from the owner user namespace of its "
10622 "parent mount namespace is considered a less privileged mount namespace."
10623 msgstr ""
10624
10625 #. type: Plain text
10626 #: build/C/man7/user_namespaces.7:272
10627 msgid ""
10628 "When creating a less privileged mount namespace, shared mounts are reduced "
10629 "to slave mounts.  This ensures that mappings performed in less privileged "
10630 "mount namespaces will not propagate to more privileged mount namespaces."
10631 msgstr ""
10632
10633 #.  FIXME .
10634 #.      What does "come as a single unit from more privileged mount" mean?
10635 #. type: Plain text
10636 #: build/C/man7/user_namespaces.7:285
10637 msgid ""
10638 "Mounts that come as a single unit from more privileged mount are locked "
10639 "together and may not be separated in a less privileged mount namespace.  "
10640 "(The B<unshare>(2)  B<CLONE_NEWNS> operation brings across all of the mounts "
10641 "from the original mount namespace as a single unit, and recursive mounts "
10642 "that propagate between mount namespaces propagate as a single unit.)"
10643 msgstr ""
10644
10645 #.  commit 9566d6742852c527bf5af38af5cbb878dad75705
10646 #.  Author: Eric W. Biederman <ebiederm@xmission.com>
10647 #.  Date:   Mon Jul 28 17:26:07 2014 -0700
10648 #
10649 #.       mnt: Correct permission checks in do_remount
10650 #. type: Plain text
10651 #: build/C/man7/user_namespaces.7:306
10652 msgid ""
10653 "The B<mount>(2)  flags B<MS_RDONLY>, B<MS_NOSUID>, B<MS_NOEXEC>, and the "
10654 "\"atime\" flags (B<MS_NOATIME>, B<MS_NODIRATIME>, B<MS_RELATIME>)  settings "
10655 "become locked when propagated from a more privileged to a less privileged "
10656 "mount namespace, and may not be changed in the less privileged mount "
10657 "namespace."
10658 msgstr ""
10659
10660 #.  (As of 3.18-rc1 (in Al Viro's 2014-08-30 vfs.git#for-next tree))
10661 #. type: Plain text
10662 #: build/C/man7/user_namespaces.7:313
10663 msgid ""
10664 "A file or directory that is a mount point in one namespace that is not a "
10665 "mount point in another namespace, may be renamed, unlinked, or removed "
10666 "(B<rmdir>(2))  in the mount namespace in which it is not a mount point "
10667 "(subject to the usual permission checks)."
10668 msgstr ""
10669
10670 #
10671 #.  ============================================================
10672 #. type: Plain text
10673 #: build/C/man7/user_namespaces.7:324
10674 msgid ""
10675 "Previously, attempting to unlink, rename, or remove a file or directory that "
10676 "was a mount point in another mount namespace would result in the error "
10677 "B<EBUSY>.  That behavior had technical problems of enforcement (e.g., for "
10678 "NFS)  and permitted denial-of-service attacks against more privileged "
10679 "users.  (i.e., preventing individual files from being updated by bind "
10680 "mounting on top of them)."
10681 msgstr ""
10682
10683 #. type: SS
10684 #: build/C/man7/user_namespaces.7:324
10685 #, no-wrap
10686 msgid "User and group ID mappings: uid_map and gid_map"
10687 msgstr ""
10688
10689 #.  commit 22d917d80e842829d0ca0a561967d728eb1d6303
10690 #. type: Plain text
10691 #: build/C/man7/user_namespaces.7:339
10692 msgid ""
10693 "When a user namespace is created, it starts out without a mapping of user "
10694 "IDs (group IDs)  to the parent user namespace.  The I</proc/[pid]/uid_map> "
10695 "and I</proc/[pid]/gid_map> files (available since Linux 3.5)  expose the "
10696 "mappings for user and group IDs inside the user namespace for the process "
10697 "I<pid>.  These files can be read to view the mappings in a user namespace "
10698 "and written to (once) to define the mappings."
10699 msgstr ""
10700
10701 #. type: Plain text
10702 #: build/C/man7/user_namespaces.7:345
10703 msgid ""
10704 "The description in the following paragraphs explains the details for "
10705 "I<uid_map>; I<gid_map> is exactly the same, but each instance of \"user ID\" "
10706 "is replaced by \"group ID\"."
10707 msgstr ""
10708
10709 #. type: Plain text
10710 #: build/C/man7/user_namespaces.7:359
10711 msgid ""
10712 "The I<uid_map> file exposes the mapping of user IDs from the user namespace "
10713 "of the process I<pid> to the user namespace of the process that opened "
10714 "I<uid_map> (but see a qualification to this point below).  In other words, "
10715 "processes that are in different user namespaces will potentially see "
10716 "different values when reading from a particular I<uid_map> file, depending "
10717 "on the user ID mappings for the user namespaces of the reading processes."
10718 msgstr ""
10719
10720 #. type: Plain text
10721 #: build/C/man7/user_namespaces.7:371
10722 msgid ""
10723 "Each line in the I<uid_map> file specifies a 1-to-1 mapping of a range of "
10724 "contiguous user IDs between two user namespaces.  (When a user namespace is "
10725 "first created, this file is empty.)  The specification in each line takes "
10726 "the form of three numbers delimited by white space.  The first two numbers "
10727 "specify the starting user ID in each of the two user namespaces.  The third "
10728 "number specifies the length of the mapped range.  In detail, the fields are "
10729 "interpreted as follows:"
10730 msgstr ""
10731
10732 #. type: Plain text
10733 #: build/C/man7/user_namespaces.7:375
10734 msgid ""
10735 "The start of the range of user IDs in the user namespace of the process "
10736 "I<pid>."
10737 msgstr ""
10738
10739 #. type: Plain text
10740 #: build/C/man7/user_namespaces.7:383
10741 msgid ""
10742 "The start of the range of user IDs to which the user IDs specified by field "
10743 "one map.  How field two is interpreted depends on whether the process that "
10744 "opened I<uid_map> and the process I<pid> are in the same user namespace, as "
10745 "follows:"
10746 msgstr ""
10747
10748 #. type: Plain text
10749 #: build/C/man7/user_namespaces.7:389
10750 msgid ""
10751 "If the two processes are in different user namespaces: field two is the "
10752 "start of a range of user IDs in the user namespace of the process that "
10753 "opened I<uid_map>."
10754 msgstr ""
10755
10756 #. type: Plain text
10757 #: build/C/man7/user_namespaces.7:400
10758 msgid ""
10759 "If the two processes are in the same user namespace: field two is the start "
10760 "of the range of user IDs in the parent user namespace of the process "
10761 "I<pid>.  This case enables the opener of I<uid_map> (the common case here is "
10762 "opening I</proc/self/uid_map>)  to see the mapping of user IDs into the user "
10763 "namespace of the process that created this user namespace."
10764 msgstr ""
10765
10766 #. type: Plain text
10767 #: build/C/man7/user_namespaces.7:404
10768 msgid ""
10769 "The length of the range of user IDs that is mapped between the two user "
10770 "namespaces."
10771 msgstr ""
10772
10773 #. type: Plain text
10774 #: build/C/man7/user_namespaces.7:411
10775 msgid ""
10776 "System calls that return user IDs (group IDs)\\(emfor example, B<getuid>(2), "
10777 "B<getgid>(2), and the credential fields in the structure returned by "
10778 "B<stat>(2)\\(emreturn the user ID (group ID) mapped into the caller's user "
10779 "namespace."
10780 msgstr ""
10781
10782 #. type: Plain text
10783 #: build/C/man7/user_namespaces.7:419
10784 msgid ""
10785 "When a process accesses a file, its user and group IDs are mapped into the "
10786 "initial user namespace for the purpose of permission checking and assigning "
10787 "IDs when creating a file.  When a process retrieves file user and group IDs "
10788 "via B<stat>(2), the IDs are mapped in the opposite direction, to produce "
10789 "values relative to the process user and group ID mappings."
10790 msgstr ""
10791
10792 #. type: Plain text
10793 #: build/C/man7/user_namespaces.7:428
10794 msgid ""
10795 "The initial user namespace has no parent namespace, but, for consistency, "
10796 "the kernel provides dummy user and group ID mapping files for this "
10797 "namespace.  Looking at the I<uid_map> file (I<gid_map> is the same) from a "
10798 "shell in the initial namespace shows:"
10799 msgstr ""
10800
10801 #. type: Plain text
10802 #: build/C/man7/user_namespaces.7:433
10803 #, no-wrap
10804 msgid ""
10805 "$ B<cat /proc/$$/uid_map>\n"
10806 "         0          0 4294967295\n"
10807 msgstr ""
10808
10809 #
10810 #.  ============================================================
10811 #. type: Plain text
10812 #: build/C/man7/user_namespaces.7:453
10813 msgid ""
10814 "This mapping tells us that the range starting at user ID 0 in this namespace "
10815 "maps to a range starting at 0 in the (nonexistent) parent namespace, and the "
10816 "length of the range is the largest 32-bit unsigned integer.  (This "
10817 "deliberately leaves 4294967295 (the 32-bit signed -1 value) unmapped.  This "
10818 "is deliberate: I<(uid_t)\\ -\\1> is used in several interfaces (e.g., "
10819 "B<setreuid>(2))  as a way to specify \"no user ID\".  Leaving I<(uid_t)\\ "
10820 "-\\1> unmapped and unusable guarantees that there will be no confusion when "
10821 "using these interfaces."
10822 msgstr ""
10823
10824 #. type: SS
10825 #: build/C/man7/user_namespaces.7:453
10826 #, no-wrap
10827 msgid "Defining user and group ID mappings: writing to uid_map and gid_map"
10828 msgstr ""
10829
10830 #. type: Plain text
10831 #: build/C/man7/user_namespaces.7:469
10832 msgid ""
10833 "After the creation of a new user namespace, the I<uid_map> file of I<one> of "
10834 "the processes in the namespace may be written to I<once> to define the "
10835 "mapping of user IDs in the new user namespace.  An attempt to write more "
10836 "than once to a I<uid_map> file in a user namespace fails with the error "
10837 "B<EPERM>.  Similar rules apply for I<gid_map> files."
10838 msgstr ""
10839
10840 #. type: Plain text
10841 #: build/C/man7/user_namespaces.7:474
10842 msgid ""
10843 "The lines written to I<uid_map> (I<gid_map>)  must conform to the following "
10844 "rules:"
10845 msgstr ""
10846
10847 #. type: Plain text
10848 #: build/C/man7/user_namespaces.7:477
10849 msgid ""
10850 "The three fields must be valid numbers, and the last field must be greater "
10851 "than 0."
10852 msgstr ""
10853
10854 #. type: Plain text
10855 #: build/C/man7/user_namespaces.7:479
10856 msgid "Lines are terminated by newline characters."
10857 msgstr ""
10858
10859 #.  FIXME(Eric): the restriction "less than" rather than "less than or equal"
10860 #.  seems strangely arbitrary. Furthermore, the comment does not agree
10861 #.  with the code in kernel/user_namespace.c. Which is correct?
10862 #. type: Plain text
10863 #: build/C/man7/user_namespaces.7:492
10864 msgid ""
10865 "There is an (arbitrary) limit on the number of lines in the file.  As at "
10866 "Linux 3.8, the limit is five lines.  In addition, the number of bytes "
10867 "written to the file must be less than the system page size, and the write "
10868 "must be performed at the start of the file (i.e., B<lseek>(2)  and "
10869 "B<pwrite>(2)  can't be used to write to nonzero offsets in the file)."
10870 msgstr ""
10871
10872 #.  commit 0bd14b4fd72afd5df41e9fd59f356740f22fceba
10873 #. type: Plain text
10874 #: build/C/man7/user_namespaces.7:505
10875 msgid ""
10876 "The range of user IDs (group IDs)  specified in each line cannot overlap "
10877 "with the ranges in any other lines.  In the initial implementation (Linux "
10878 "3.8), this requirement was satisfied by a simplistic implementation that "
10879 "imposed the further requirement that the values in both field 1 and field 2 "
10880 "of successive lines must be in ascending numerical order, which prevented "
10881 "some otherwise valid maps from being created.  Linux 3.9 and later fix this "
10882 "limitation, allowing any valid set of nonoverlapping maps."
10883 msgstr ""
10884
10885 #. type: Plain text
10886 #: build/C/man7/user_namespaces.7:507
10887 msgid "At least one line must be written to the file."
10888 msgstr ""
10889
10890 #. type: Plain text
10891 #: build/C/man7/user_namespaces.7:510
10892 msgid "Writes that violate the above rules fail with the error B<EINVAL>."
10893 msgstr ""
10894
10895 #. type: Plain text
10896 #: build/C/man7/user_namespaces.7:515
10897 msgid ""
10898 "In order for a process to write to the I</proc/[pid]/uid_map> "
10899 "(I</proc/[pid]/gid_map>)  file, all of the following requirements must be "
10900 "met:"
10901 msgstr ""
10902
10903 #. type: Plain text
10904 #: build/C/man7/user_namespaces.7:521
10905 msgid ""
10906 "The writing process must have the B<CAP_SETUID> (B<CAP_SETGID>)  capability "
10907 "in the user namespace of the process I<pid>."
10908 msgstr ""
10909
10910 #. type: Plain text
10911 #: build/C/man7/user_namespaces.7:526
10912 msgid ""
10913 "The writing process must be in either the user namespace of the process "
10914 "I<pid> or inside the parent user namespace of the process I<pid>."
10915 msgstr ""
10916
10917 #. type: Plain text
10918 #: build/C/man7/user_namespaces.7:529
10919 msgid ""
10920 "The mapped user IDs (group IDs) must in turn have a mapping in the parent "
10921 "user namespace."
10922 msgstr ""
10923
10924 #. type: Plain text
10925 #: build/C/man7/user_namespaces.7:531
10926 msgid "One of the following is true:"
10927 msgstr ""
10928
10929 #. type: Plain text
10930 #: build/C/man7/user_namespaces.7:541
10931 msgid ""
10932 "The data written to I<uid_map> (I<gid_map>)  consists of a single line that "
10933 "maps the writing process's filesystem user ID (group ID) in the parent user "
10934 "namespace to a user ID (group ID)  in the user namespace.  The usual case "
10935 "here is that this single line provides a mapping for user ID of the process "
10936 "that created the namespace."
10937 msgstr ""
10938
10939 #. type: Plain text
10940 #: build/C/man7/user_namespaces.7:548
10941 msgid ""
10942 "The opening process has the B<CAP_SETUID> (B<CAP_SETGID>)  capability in the "
10943 "parent user namespace.  Thus, a privileged process can make mappings to "
10944 "arbitrary user IDs (group IDs)  in the parent user namespace."
10945 msgstr ""
10946
10947 #
10948 #.  ============================================================
10949 #. type: Plain text
10950 #: build/C/man7/user_namespaces.7:555
10951 msgid "Writes that violate the above rules fail with the error B<EPERM>."
10952 msgstr ""
10953
10954 #. type: SS
10955 #: build/C/man7/user_namespaces.7:555
10956 #, no-wrap
10957 msgid "Unmapped user and group IDs"
10958 msgstr ""
10959
10960 #.  from_kuid_munged(), from_kgid_munged()
10961 #. type: Plain text
10962 #: build/C/man7/user_namespaces.7:572
10963 msgid ""
10964 "There are various places where an unmapped user ID (group ID)  may be "
10965 "exposed to user space.  For example, the first process in a new user "
10966 "namespace may call B<getuid>()  before a user ID mapping has been defined "
10967 "for the namespace.  In most such cases, an unmapped user ID is converted to "
10968 "the overflow user ID (group ID); the default value for the overflow user ID "
10969 "(group ID) is 65534.  See the descriptions of "
10970 "I</proc/sys/kernel/overflowuid> and I</proc/sys/kernel/overflowgid> in "
10971 "B<proc>(5)."
10972 msgstr ""
10973
10974 #.  also SO_PEERCRED
10975 #. type: Plain text
10976 #: build/C/man7/user_namespaces.7:600
10977 msgid ""
10978 "The cases where unmapped IDs are mapped in this fashion include system calls "
10979 "that return user IDs (B<getuid>(2), B<getgid>(2), and similar), credentials "
10980 "passed over a UNIX domain socket, credentials returned by B<stat>(2), "
10981 "B<waitid>(2), and the System V IPC \"ctl\" B<IPC_STAT> operations, "
10982 "credentials exposed by I</proc/PID/status> and the files in "
10983 "I</proc/sysvipc/*>, credentials returned via the I<si_uid> field in the "
10984 "I<siginfo_t> received with a signal (see B<sigaction>(2)), credentials "
10985 "written to the process accounting file (see B<acct>(5)), and credentials "
10986 "returned with POSIX message queue notifications (see B<mq_notify>(3))."
10987 msgstr ""
10988
10989 #.  from_kuid(), from_kgid()
10990 #.  Also F_GETOWNER_UIDS is an exception
10991 #
10992 #.  ============================================================
10993 #. type: Plain text
10994 #: build/C/man7/user_namespaces.7:615
10995 msgid ""
10996 "There is one notable case where unmapped user and group IDs are I<not> "
10997 "converted to the corresponding overflow ID value.  When viewing a I<uid_map> "
10998 "or I<gid_map> file in which there is no mapping for the second field, that "
10999 "field is displayed as 4294967295 (-1 as an unsigned integer);"
11000 msgstr ""
11001
11002 #. type: SS
11003 #: build/C/man7/user_namespaces.7:615
11004 #, no-wrap
11005 msgid "Set-user-ID and set-group-ID programs"
11006 msgstr ""
11007
11008 #
11009 #.  ============================================================
11010 #. type: Plain text
11011 #: build/C/man7/user_namespaces.7:635
11012 msgid ""
11013 "When a process inside a user namespace executes a set-user-ID (set-group-ID) "
11014 "program, the process's effective user (group) ID inside the namespace is "
11015 "changed to whatever value is mapped for the user (group) ID of the file.  "
11016 "However, if either the user I<or> the group ID of the file has no mapping "
11017 "inside the namespace, the set-user-ID (set-group-ID) bit is silently "
11018 "ignored: the new program is executed, but the process's effective user "
11019 "(group) ID is left unchanged.  (This mirrors the semantics of executing a "
11020 "set-user-ID or set-group-ID program that resides on a filesystem that was "
11021 "mounted with the B<MS_NOSUID> flag, as described in B<mount>(2).)"
11022 msgstr ""
11023
11024 #. type: Plain text
11025 #: build/C/man7/user_namespaces.7:645
11026 msgid ""
11027 "When a process's user and group IDs are passed over a UNIX domain socket to "
11028 "a process in a different user namespace (see the description of "
11029 "B<SCM_CREDENTIALS> in B<unix>(7)), they are translated into the "
11030 "corresponding values as per the receiving process's user and group ID "
11031 "mappings."
11032 msgstr ""
11033
11034 #
11035 #.  ============================================================
11036 #. type: Plain text
11037 #: build/C/man7/user_namespaces.7:658
11038 msgid ""
11039 "Over the years, there have been a lot of features that have been added to "
11040 "the Linux kernel that have been made available only to privileged users "
11041 "because of their potential to confuse set-user-ID-root applications.  In "
11042 "general, it becomes safe to allow the root user in a user namespace to use "
11043 "those features because it is impossible, while in a user namespace, to gain "
11044 "more privilege than the root user of a user namespace has."
11045 msgstr ""
11046
11047 #. type: SS
11048 #: build/C/man7/user_namespaces.7:658
11049 #, no-wrap
11050 msgid "Availability"
11051 msgstr ""
11052
11053 #. type: Plain text
11054 #: build/C/man7/user_namespaces.7:666
11055 msgid ""
11056 "Use of user namespaces requires a kernel that is configured with the "
11057 "B<CONFIG_USER_NS> option.  User namespaces require support in a range of "
11058 "subsystems across the kernel.  When an unsupported subsystem is configured "
11059 "into the kernel, it is not possible to configure user namespaces support."
11060 msgstr ""
11061
11062 #.  commit d6970d4b726cea6d7a9bc4120814f95c09571fc3
11063 #. type: Plain text
11064 #: build/C/man7/user_namespaces.7:677
11065 msgid ""
11066 "As at Linux 3.8, most relevant subsystems supported user namespaces, but a "
11067 "number of filesystems did not have the infrastructure needed to map user and "
11068 "group IDs between user namespaces.  Linux 3.9 added the required "
11069 "infrastructure support for many of the remaining unsupported filesystems "
11070 "(Plan 9 (9P), Andrew File System (AFS), Ceph, CIFS, CODA, NFS, and OCFS2).  "
11071 "Linux 3.11 added support the last of the unsupported major filesystems, XFS."
11072 msgstr ""
11073
11074 #. type: Plain text
11075 #: build/C/man7/user_namespaces.7:686
11076 msgid ""
11077 "The program below is designed to allow experimenting with user namespaces, "
11078 "as well as other types of namespaces.  It creates namespaces as specified by "
11079 "command-line options and then executes a command inside those namespaces.  "
11080 "The comments and I<usage()> function inside the program provide a full "
11081 "explanation of the program.  The following shell session demonstrates its "
11082 "use."
11083 msgstr ""
11084
11085 #. type: Plain text
11086 #: build/C/man7/user_namespaces.7:688
11087 msgid "First, we look at the run-time environment:"
11088 msgstr ""
11089
11090 #. type: Plain text
11091 #: build/C/man7/user_namespaces.7:697
11092 #, no-wrap
11093 msgid ""
11094 "$ B<uname -rs>     # Need Linux 3.8 or later\n"
11095 "Linux 3.8.0\n"
11096 "$ B<id -u>         # Running as unprivileged user\n"
11097 "1000\n"
11098 "$ B<id -g>\n"
11099 "1000\n"
11100 msgstr ""
11101
11102 #. type: Plain text
11103 #: build/C/man7/user_namespaces.7:711
11104 msgid ""
11105 "Now start a new shell in new user (I<-U>), mount (I<-m>), and PID (I<-p>)  "
11106 "namespaces, with user ID (I<-M>)  and group ID (I<-G>)  1000 mapped to 0 "
11107 "inside the user namespace:"
11108 msgstr ""
11109
11110 #. type: Plain text
11111 #: build/C/man7/user_namespaces.7:715
11112 #, no-wrap
11113 msgid "$ B<./userns_child_exec -p -m -U -M '0 1000 1' -G '0 1000 1' bash>\n"
11114 msgstr ""
11115
11116 #. type: Plain text
11117 #: build/C/man7/user_namespaces.7:720
11118 msgid ""
11119 "The shell has PID 1, because it is the first process in the new PID "
11120 "namespace:"
11121 msgstr ""
11122
11123 #. type: Plain text
11124 #: build/C/man7/user_namespaces.7:725
11125 #, no-wrap
11126 msgid ""
11127 "bash$ B<echo $$>\n"
11128 "1\n"
11129 msgstr ""
11130
11131 #. type: Plain text
11132 #: build/C/man7/user_namespaces.7:730
11133 msgid ""
11134 "Inside the user namespace, the shell has user and group ID 0, and a full set "
11135 "of permitted and effective capabilities:"
11136 msgstr ""
11137
11138 #. type: Plain text
11139 #: build/C/man7/user_namespaces.7:740
11140 #, no-wrap
11141 msgid ""
11142 "bash$ B<cat /proc/$$/status | egrep '^[UG]id'>\n"
11143 "Uid:\t0\t0\t0\t0\n"
11144 "Gid:\t0\t0\t0\t0\n"
11145 "bash$ B<cat /proc/$$/status | egrep '^Cap(Prm|Inh|Eff)'>\n"
11146 "CapInh:\t0000000000000000\n"
11147 "CapPrm:\t0000001fffffffff\n"
11148 "CapEff:\t0000001fffffffff\n"
11149 msgstr ""
11150
11151 #. type: Plain text
11152 #: build/C/man7/user_namespaces.7:748
11153 msgid ""
11154 "Mounting a new I</proc> filesystem and listing all of the processes visible "
11155 "in the new PID namespace shows that the shell can't see any processes "
11156 "outside the PID namespace:"
11157 msgstr ""
11158
11159 #. type: Plain text
11160 #: build/C/man7/user_namespaces.7:756
11161 #, no-wrap
11162 msgid ""
11163 "bash$ B<mount -t proc proc /proc>\n"
11164 "bash$ B<ps ax>\n"
11165 "  PID TTY      STAT   TIME COMMAND\n"
11166 "    1 pts/3    S      0:00 bash\n"
11167 "   22 pts/3    R+     0:00 ps ax\n"
11168 msgstr ""
11169
11170 #. type: SS
11171 #: build/C/man7/user_namespaces.7:758 build/C/man2/seccomp.2:574
11172 #, no-wrap
11173 msgid "Program source"
11174 msgstr ""
11175
11176 #. type: Plain text
11177 #: build/C/man7/user_namespaces.7:762
11178 #, no-wrap
11179 msgid "/* userns_child_exec.c\n"
11180 msgstr ""
11181
11182 #. type: Plain text
11183 #: build/C/man7/user_namespaces.7:764
11184 #, no-wrap
11185 msgid "   Licensed under GNU General Public License v2 or later\n"
11186 msgstr ""
11187
11188 #. type: Plain text
11189 #: build/C/man7/user_namespaces.7:780
11190 #, no-wrap
11191 msgid ""
11192 "   Create a child process that executes a shell command in new\n"
11193 "   namespace(s); allow UID and GID mappings to be specified when\n"
11194 "   creating a user namespace.\n"
11195 "*/\n"
11196 "#define _GNU_SOURCE\n"
11197 "#include E<lt>sched.hE<gt>\n"
11198 "#include E<lt>unistd.hE<gt>\n"
11199 "#include E<lt>stdlib.hE<gt>\n"
11200 "#include E<lt>sys/wait.hE<gt>\n"
11201 "#include E<lt>signal.hE<gt>\n"
11202 "#include E<lt>fcntl.hE<gt>\n"
11203 "#include E<lt>stdio.hE<gt>\n"
11204 "#include E<lt>string.hE<gt>\n"
11205 "#include E<lt>limits.hE<gt>\n"
11206 "#include E<lt>errno.hE<gt>\n"
11207 msgstr ""
11208
11209 #. type: Plain text
11210 #: build/C/man7/user_namespaces.7:783
11211 #, no-wrap
11212 msgid ""
11213 "/* A simple error-handling function: print an error message based\n"
11214 "   on the value in \\(aqerrno\\(aq and terminate the calling process */\n"
11215 msgstr ""
11216
11217 #. type: Plain text
11218 #: build/C/man7/user_namespaces.7:786
11219 #, no-wrap
11220 msgid ""
11221 "#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\e\n"
11222 "                        } while (0)\n"
11223 msgstr ""
11224
11225 #. type: Plain text
11226 #: build/C/man7/user_namespaces.7:791
11227 #, no-wrap
11228 msgid ""
11229 "struct child_args {\n"
11230 "    char **argv;        /* Command to be executed by child, with args */\n"
11231 "    int    pipe_fd[2];  /* Pipe used to synchronize parent and child */\n"
11232 "};\n"
11233 msgstr ""
11234
11235 #. type: Plain text
11236 #: build/C/man7/user_namespaces.7:793
11237 #, no-wrap
11238 msgid "static int verbose;\n"
11239 msgstr ""
11240
11241 #. type: Plain text
11242 #: build/C/man7/user_namespaces.7:826
11243 #, no-wrap
11244 msgid ""
11245 "static void\n"
11246 "usage(char *pname)\n"
11247 "{\n"
11248 "    fprintf(stderr, \"Usage: %s [options] cmd [arg...]\\en\\en\", pname);\n"
11249 "    fprintf(stderr, \"Create a child process that executes a shell \"\n"
11250 "            \"command in a new user namespace,\\en\"\n"
11251 "            \"and possibly also other new namespace(s).\\en\\en\");\n"
11252 "    fprintf(stderr, \"Options can be:\\en\\en\");\n"
11253 "#define fpe(str) fprintf(stderr, \"    %s\", str);\n"
11254 "    fpe(\"-i          New IPC namespace\\en\");\n"
11255 "    fpe(\"-m          New mount namespace\\en\");\n"
11256 "    fpe(\"-n          New network namespace\\en\");\n"
11257 "    fpe(\"-p          New PID namespace\\en\");\n"
11258 "    fpe(\"-u          New UTS namespace\\en\");\n"
11259 "    fpe(\"-U          New user namespace\\en\");\n"
11260 "    fpe(\"-M uid_map  Specify UID map for user namespace\\en\");\n"
11261 "    fpe(\"-G gid_map  Specify GID map for user namespace\\en\");\n"
11262 "    fpe(\"-z          Map user\\(aqs UID and GID to 0 in user "
11263 "namespace\\en\");\n"
11264 "    fpe(\"            (equivalent to: -M \\(aq0 E<lt>uidE<gt> 1\\(aq -G "
11265 "\\(aq0 E<lt>gidE<gt> 1\\(aq)\\en\");\n"
11266 "    fpe(\"-v          Display verbose messages\\en\");\n"
11267 "    fpe(\"\\en\");\n"
11268 "    fpe(\"If -z, -M, or -G is specified, -U is required.\\en\");\n"
11269 "    fpe(\"It is not permitted to specify both -z and either -M or "
11270 "-G.\\en\");\n"
11271 "    fpe(\"\\en\");\n"
11272 "    fpe(\"Map strings for -M and -G consist of records of the "
11273 "form:\\en\");\n"
11274 "    fpe(\"\\en\");\n"
11275 "    fpe(\"    ID-inside-ns   ID-outside-ns   len\\en\");\n"
11276 "    fpe(\"\\en\");\n"
11277 "    fpe(\"A map string can contain multiple records, separated\"\n"
11278 "        \" by commas;\\en\");\n"
11279 "    fpe(\"the commas are replaced by newlines before writing\"\n"
11280 "        \" to map files.\\en\");\n"
11281 msgstr ""
11282
11283 #. type: Plain text
11284 #: build/C/man7/user_namespaces.7:834
11285 #, no-wrap
11286 msgid ""
11287 "/* Update the mapping file \\(aqmap_file\\(aq, with the value provided in\n"
11288 "   \\(aqmapping\\(aq, a string that defines a UID or GID mapping. A UID or\n"
11289 "   GID mapping consists of one or more newline-delimited records\n"
11290 "   of the form:\n"
11291 msgstr ""
11292
11293 #. type: Plain text
11294 #: build/C/man7/user_namespaces.7:836
11295 #, no-wrap
11296 msgid "       ID_inside-ns    ID-outside-ns   length\n"
11297 msgstr ""
11298
11299 #. type: Plain text
11300 #: build/C/man7/user_namespaces.7:841
11301 #, no-wrap
11302 msgid ""
11303 "   Requiring the user to supply a string that contains newlines is\n"
11304 "   of course inconvenient for command-line use. Thus, we permit the\n"
11305 "   use of commas to delimit records in this string, and replace them\n"
11306 "   with newlines before writing the string to the file. */\n"
11307 msgstr ""
11308
11309 #. type: Plain text
11310 #: build/C/man7/user_namespaces.7:847
11311 #, no-wrap
11312 msgid ""
11313 "static void\n"
11314 "update_map(char *mapping, char *map_file)\n"
11315 "{\n"
11316 "    int fd, j;\n"
11317 "    size_t map_len;     /* Length of \\(aqmapping\\(aq */\n"
11318 msgstr ""
11319
11320 #. type: Plain text
11321 #: build/C/man7/user_namespaces.7:849
11322 #, no-wrap
11323 msgid "    /* Replace commas in mapping string with newlines */\n"
11324 msgstr ""
11325
11326 #. type: Plain text
11327 #: build/C/man7/user_namespaces.7:854
11328 #, no-wrap
11329 msgid ""
11330 "    map_len = strlen(mapping);\n"
11331 "    for (j = 0; j E<lt> map_len; j++)\n"
11332 "        if (mapping[j] == \\(aq,\\(aq)\n"
11333 "            mapping[j] = \\(aq\\en\\(aq;\n"
11334 msgstr ""
11335
11336 #. type: Plain text
11337 #: build/C/man7/user_namespaces.7:861
11338 #, no-wrap
11339 msgid ""
11340 "    fd = open(map_file, O_RDWR);\n"
11341 "    if (fd == -1) {\n"
11342 "        fprintf(stderr, \"ERROR: open %s: %s\\en\", map_file,\n"
11343 "                strerror(errno));\n"
11344 "        exit(EXIT_FAILURE);\n"
11345 "    }\n"
11346 msgstr ""
11347
11348 #. type: Plain text
11349 #: build/C/man7/user_namespaces.7:867
11350 #, no-wrap
11351 msgid ""
11352 "    if (write(fd, mapping, map_len) != map_len) {\n"
11353 "        fprintf(stderr, \"ERROR: write %s: %s\\en\", map_file,\n"
11354 "                strerror(errno));\n"
11355 "        exit(EXIT_FAILURE);\n"
11356 "    }\n"
11357 msgstr ""
11358
11359 #. type: Plain text
11360 #: build/C/man7/user_namespaces.7:870
11361 #, no-wrap
11362 msgid ""
11363 "    close(fd);\n"
11364 "}\n"
11365 msgstr ""
11366
11367 #. type: Plain text
11368 #: build/C/man7/user_namespaces.7:876
11369 #, no-wrap
11370 msgid ""
11371 "static int              /* Start function for cloned child */\n"
11372 "childFunc(void *arg)\n"
11373 "{\n"
11374 "    struct child_args *args = (struct child_args *) arg;\n"
11375 "    char ch;\n"
11376 msgstr ""
11377
11378 #. type: Plain text
11379 #: build/C/man7/user_namespaces.7:881
11380 #, no-wrap
11381 msgid ""
11382 "    /* Wait until the parent has updated the UID and GID mappings.\n"
11383 "       See the comment in main(). We wait for end of file on a\n"
11384 "       pipe that will be closed by the parent process once it has\n"
11385 "       updated the mappings. */\n"
11386 msgstr ""
11387
11388 #. type: Plain text
11389 #: build/C/man7/user_namespaces.7:890
11390 #, no-wrap
11391 msgid ""
11392 "    close(args-E<gt>pipe_fd[1]);    /* Close our descriptor for the write\n"
11393 "                                   end of the pipe so that we see EOF\n"
11394 "                                   when parent closes its descriptor */\n"
11395 "    if (read(args-E<gt>pipe_fd[0], &ch, 1) != 0) {\n"
11396 "        fprintf(stderr,\n"
11397 "                \"Failure in child: read from pipe returned != 0\\en\");\n"
11398 "        exit(EXIT_FAILURE);\n"
11399 "    }\n"
11400 msgstr ""
11401
11402 #. type: Plain text
11403 #: build/C/man7/user_namespaces.7:892
11404 #, no-wrap
11405 msgid "    /* Execute a shell command */\n"
11406 msgstr ""
11407
11408 #. type: Plain text
11409 #: build/C/man7/user_namespaces.7:897
11410 #, no-wrap
11411 msgid ""
11412 "    printf(\"About to exec %s\\en\", args-E<gt>argv[0]);\n"
11413 "    execvp(args-E<gt>argv[0], args-E<gt>argv);\n"
11414 "    errExit(\"execvp\");\n"
11415 "}\n"
11416 msgstr ""
11417
11418 #. type: Plain text
11419 #: build/C/man7/user_namespaces.7:899
11420 #, no-wrap
11421 msgid "#define STACK_SIZE (1024 * 1024)\n"
11422 msgstr ""
11423
11424 #. type: Plain text
11425 #: build/C/man7/user_namespaces.7:901
11426 #, no-wrap
11427 msgid "static char child_stack[STACK_SIZE];    /* Space for child\\(aqs stack */\n"
11428 msgstr ""
11429
11430 #. type: Plain text
11431 #: build/C/man7/user_namespaces.7:912
11432 #, no-wrap
11433 msgid ""
11434 "int\n"
11435 "main(int argc, char *argv[])\n"
11436 "{\n"
11437 "    int flags, opt, map_zero;\n"
11438 "    pid_t child_pid;\n"
11439 "    struct child_args args;\n"
11440 "    char *uid_map, *gid_map;\n"
11441 "    const int MAP_BUF_SIZE = 100;\n"
11442 "    char map_buf[MAP_BUF_SIZE];\n"
11443 "    char map_path[PATH_MAX];\n"
11444 msgstr ""
11445
11446 #. type: Plain text
11447 #: build/C/man7/user_namespaces.7:919
11448 #, no-wrap
11449 msgid ""
11450 "    /* Parse command-line options. The initial \\(aq+\\(aq character in\n"
11451 "       the final getopt() argument prevents GNU-style permutation\n"
11452 "       of command-line options. That\\(aqs useful, since sometimes\n"
11453 "       the \\(aqcommand\\(aq to be executed by this program itself\n"
11454 "       has command-line options. We don\\(aqt want getopt() to treat\n"
11455 "       those as options to this program. */\n"
11456 msgstr ""
11457
11458 #. type: Plain text
11459 #: build/C/man7/user_namespaces.7:940
11460 #, no-wrap
11461 msgid ""
11462 "    flags = 0;\n"
11463 "    verbose = 0;\n"
11464 "    gid_map = NULL;\n"
11465 "    uid_map = NULL;\n"
11466 "    map_zero = 0;\n"
11467 "    while ((opt = getopt(argc, argv, \"+imnpuUM:G:zv\")) != -1) {\n"
11468 "        switch (opt) {\n"
11469 "        case \\(aqi\\(aq: flags |= CLONE_NEWIPC;        break;\n"
11470 "        case \\(aqm\\(aq: flags |= CLONE_NEWNS;         break;\n"
11471 "        case \\(aqn\\(aq: flags |= CLONE_NEWNET;        break;\n"
11472 "        case \\(aqp\\(aq: flags |= CLONE_NEWPID;        break;\n"
11473 "        case \\(aqu\\(aq: flags |= CLONE_NEWUTS;        break;\n"
11474 "        case \\(aqv\\(aq: verbose = 1;                  break;\n"
11475 "        case \\(aqz\\(aq: map_zero = 1;                 break;\n"
11476 "        case \\(aqM\\(aq: uid_map = optarg;             break;\n"
11477 "        case \\(aqG\\(aq: gid_map = optarg;             break;\n"
11478 "        case \\(aqU\\(aq: flags |= CLONE_NEWUSER;       break;\n"
11479 "        default:  usage(argv[0]);\n"
11480 "        }\n"
11481 "    }\n"
11482 msgstr ""
11483
11484 #. type: Plain text
11485 #: build/C/man7/user_namespaces.7:942
11486 #, no-wrap
11487 msgid "    /* -M or -G without -U is nonsensical */\n"
11488 msgstr ""
11489
11490 #. type: Plain text
11491 #: build/C/man7/user_namespaces.7:947
11492 #, no-wrap
11493 msgid ""
11494 "    if (((uid_map != NULL || gid_map != NULL || map_zero) &&\n"
11495 "                !(flags & CLONE_NEWUSER)) ||\n"
11496 "            (map_zero && (uid_map != NULL || gid_map != NULL)))\n"
11497 "        usage(argv[0]);\n"
11498 msgstr ""
11499
11500 #. type: Plain text
11501 #: build/C/man7/user_namespaces.7:949
11502 #, no-wrap
11503 msgid "    args.argv = &argv[optind];\n"
11504 msgstr ""
11505
11506 #. type: Plain text
11507 #: build/C/man7/user_namespaces.7:959
11508 #, no-wrap
11509 msgid ""
11510 "    /* We use a pipe to synchronize the parent and child, in order to\n"
11511 "       ensure that the parent sets the UID and GID maps before the child\n"
11512 "       calls execve(). This ensures that the child maintains its\n"
11513 "       capabilities during the execve() in the common case where we\n"
11514 "       want to map the child\\(aqs effective user ID to 0 in the new user\n"
11515 "       namespace. Without this synchronization, the child would lose\n"
11516 "       its capabilities if it performed an execve() with nonzero\n"
11517 "       user IDs (see the capabilities(7) man page for details of the\n"
11518 "       transformation of a process\\(aqs capabilities during execve()). */\n"
11519 msgstr ""
11520
11521 #. type: Plain text
11522 #: build/C/man7/user_namespaces.7:962
11523 #, no-wrap
11524 msgid ""
11525 "    if (pipe(args.pipe_fd) == -1)\n"
11526 "        errExit(\"pipe\");\n"
11527 msgstr ""
11528
11529 #. type: Plain text
11530 #: build/C/man7/user_namespaces.7:964
11531 #, no-wrap
11532 msgid "    /* Create the child in new namespace(s) */\n"
11533 msgstr ""
11534
11535 #. type: Plain text
11536 #: build/C/man7/user_namespaces.7:969
11537 #, no-wrap
11538 msgid ""
11539 "    child_pid = clone(childFunc, child_stack + STACK_SIZE,\n"
11540 "                      flags | SIGCHLD, &args);\n"
11541 "    if (child_pid == -1)\n"
11542 "        errExit(\"clone\");\n"
11543 msgstr ""
11544
11545 #. type: Plain text
11546 #: build/C/man7/user_namespaces.7:971
11547 #, no-wrap
11548 msgid "    /* Parent falls through to here */\n"
11549 msgstr ""
11550
11551 #. type: Plain text
11552 #: build/C/man7/user_namespaces.7:975
11553 #, no-wrap
11554 msgid ""
11555 "    if (verbose)\n"
11556 "        printf(\"%s: PID of child created by clone() is %ld\\en\",\n"
11557 "                argv[0], (long) child_pid);\n"
11558 msgstr ""
11559
11560 #. type: Plain text
11561 #: build/C/man7/user_namespaces.7:977
11562 #, no-wrap
11563 msgid "    /* Update the UID and GID maps in the child */\n"
11564 msgstr ""
11565
11566 #. type: Plain text
11567 #: build/C/man7/user_namespaces.7:996
11568 #, no-wrap
11569 msgid ""
11570 "    if (uid_map != NULL || map_zero) {\n"
11571 "        snprintf(map_path, PATH_MAX, \"/proc/%ld/uid_map\",\n"
11572 "                (long) child_pid);\n"
11573 "        if (map_zero) {\n"
11574 "            snprintf(map_buf, MAP_BUF_SIZE, \"0 %ld 1\", (long) getuid());\n"
11575 "            uid_map = map_buf;\n"
11576 "        }\n"
11577 "        update_map(uid_map, map_path);\n"
11578 "    }\n"
11579 "    if (gid_map != NULL || map_zero) {\n"
11580 "        snprintf(map_path, PATH_MAX, \"/proc/%ld/gid_map\",\n"
11581 "                (long) child_pid);\n"
11582 "        if (map_zero) {\n"
11583 "            snprintf(map_buf, MAP_BUF_SIZE, \"0 %ld 1\", (long) getgid());\n"
11584 "            gid_map = map_buf;\n"
11585 "        }\n"
11586 "        update_map(gid_map, map_path);\n"
11587 "    }\n"
11588 msgstr ""
11589
11590 #. type: Plain text
11591 #: build/C/man7/user_namespaces.7:999
11592 #, no-wrap
11593 msgid ""
11594 "    /* Close the write end of the pipe, to signal to the child that we\n"
11595 "       have updated the UID and GID maps */\n"
11596 msgstr ""
11597
11598 #. type: Plain text
11599 #: build/C/man7/user_namespaces.7:1001
11600 #, no-wrap
11601 msgid "    close(args.pipe_fd[1]);\n"
11602 msgstr ""
11603
11604 #. type: Plain text
11605 #: build/C/man7/user_namespaces.7:1004
11606 #, no-wrap
11607 msgid ""
11608 "    if (waitpid(child_pid, NULL, 0) == -1)      /* Wait for child */\n"
11609 "        errExit(\"waitpid\");\n"
11610 msgstr ""
11611
11612 #. type: Plain text
11613 #: build/C/man7/user_namespaces.7:1007
11614 #, no-wrap
11615 msgid ""
11616 "    if (verbose)\n"
11617 "        printf(\"%s: terminating\\en\", argv[0]);\n"
11618 msgstr ""
11619
11620 #. type: Plain text
11621 #: build/C/man7/user_namespaces.7:1010
11622 #, no-wrap
11623 msgid ""
11624 "    exit(EXIT_SUCCESS);\n"
11625 "}\n"
11626 msgstr ""
11627
11628 #.  From the shadow package
11629 #.  From the shadow package
11630 #.  From the shadow package
11631 #.  From the shadow package
11632 #. type: Plain text
11633 #: build/C/man7/user_namespaces.7:1024
11634 msgid ""
11635 "B<newgidmap>(1), B<newuidmap>(1), B<clone>(2), B<setns>(2), B<unshare>(2), "
11636 "B<proc>(5), B<subgid>(5), B<subuid>(5), B<credentials>(7), "
11637 "B<capabilities>(7), B<namespaces>(7), B<pid_namespaces>(7)"
11638 msgstr ""
11639
11640 #. type: Plain text
11641 #: build/C/man7/user_namespaces.7:1027
11642 msgid "The kernel source file I<Documentation/namespaces/resource-control.txt>."
11643 msgstr ""
11644
11645 #. type: TH
11646 #: build/C/man2/seccomp.2:27
11647 #, no-wrap
11648 msgid "SECCOMP"
11649 msgstr ""
11650
11651 #. type: Plain text
11652 #: build/C/man2/seccomp.2:30
11653 msgid "seccomp - operate on Secure Computing state of the process"
11654 msgstr ""
11655
11656 #.  Kees Cook noted: Anything that uses SECCOMP_RET_TRACE returns will
11657 #.                   need <sys/ptrace.h>
11658 #. type: Plain text
11659 #: build/C/man2/seccomp.2:39
11660 #, no-wrap
11661 msgid ""
11662 "B<#include E<lt>linux/seccomp.hE<gt>>\n"
11663 "B<#include E<lt>linux/filter.hE<gt>>\n"
11664 "B<#include E<lt>linux/audit.hE<gt>>\n"
11665 "B<#include E<lt>linux/signal.hE<gt>>\n"
11666 "B<#include E<lt>sys/ptrace.hE<gt>>\n"
11667 msgstr ""
11668
11669 #. type: Plain text
11670 #: build/C/man2/seccomp.2:42
11671 #, no-wrap
11672 msgid ""
11673 "B<int seccomp(unsigned int >I<operation>B<, unsigned int >I<flags>B<, void "
11674 "*>I<args>B<);>\n"
11675 msgstr ""
11676
11677 #. type: Plain text
11678 #: build/C/man2/seccomp.2:48
11679 msgid ""
11680 "The B<seccomp>()  system call operates on the Secure Computing (seccomp) "
11681 "state of the calling process."
11682 msgstr ""
11683
11684 #. type: Plain text
11685 #: build/C/man2/seccomp.2:52
11686 msgid "Currently, Linux supports the following I<operation> values:"
11687 msgstr ""
11688
11689 #. type: TP
11690 #: build/C/man2/seccomp.2:52
11691 #, no-wrap
11692 msgid "B<SECCOMP_SET_MODE_STRICT>"
11693 msgstr ""
11694
11695 #. type: Plain text
11696 #: build/C/man2/seccomp.2:66
11697 msgid ""
11698 "The only system calls that the calling thread is permitted to make are "
11699 "B<read>(2), B<write>(2), B<_exit>(2), and B<sigreturn>(2).  Other system "
11700 "calls result in the delivery of a B<SIGKILL> signal.  Strict secure "
11701 "computing mode is useful for number-crunching applications that may need to "
11702 "execute untrusted byte code, perhaps obtained by reading from a pipe or "
11703 "socket."
11704 msgstr ""
11705
11706 #. type: Plain text
11707 #: build/C/man2/seccomp.2:70
11708 msgid ""
11709 "This operation is available only if the kernel is configured with "
11710 "B<CONFIG_SECCOMP> enabled."
11711 msgstr ""
11712
11713 #. type: Plain text
11714 #: build/C/man2/seccomp.2:76
11715 msgid "The value of I<flags> must be 0, and I<args> must be NULL."
11716 msgstr ""
11717
11718 #. type: Plain text
11719 #: build/C/man2/seccomp.2:78
11720 msgid "This operation is functionally identical to the call:"
11721 msgstr ""
11722
11723 #. type: Plain text
11724 #: build/C/man2/seccomp.2:80
11725 #, no-wrap
11726 msgid "    prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT);\n"
11727 msgstr ""
11728
11729 #. type: TP
11730 #: build/C/man2/seccomp.2:80
11731 #, no-wrap
11732 msgid "B<SECCOMP_SET_MODE_FILTER>"
11733 msgstr ""
11734
11735 #. type: Plain text
11736 #: build/C/man2/seccomp.2:95
11737 msgid ""
11738 "The system calls allowed are defined by a pointer to a Berkeley Packet "
11739 "Filter (BPF) passed via I<args>.  This argument is a pointer to a I<struct\\ "
11740 "sock_fprog>; it can be designed to filter arbitrary system calls and system "
11741 "call arguments.  If the filter is invalid, B<seccomp>()  fails, returning "
11742 "B<EINVAL> in I<errno>."
11743 msgstr ""
11744
11745 #. type: Plain text
11746 #: build/C/man2/seccomp.2:107
11747 msgid ""
11748 "If B<fork>(2)  or B<clone>(2)  is allowed by the filter, any child processes "
11749 "will be constrained to the same system call filters as the parent.  If "
11750 "B<execve>(2)  is allowed, the existing filters will be preserved across a "
11751 "call to B<execve>(2)."
11752 msgstr ""
11753
11754 #. type: Plain text
11755 #: build/C/man2/seccomp.2:117
11756 msgid ""
11757 "In order to use the B<SECCOMP_SET_MODE_FILTER> operation, either the caller "
11758 "must have the B<CAP_SYS_ADMIN> capability, or the thread must already have "
11759 "the I<no_new_privs> bit set.  If that bit was not already set by an ancestor "
11760 "of this thread, the thread must make the following call:"
11761 msgstr ""
11762
11763 #. type: Plain text
11764 #: build/C/man2/seccomp.2:119
11765 #, no-wrap
11766 msgid "    prctl(PR_SET_NO_NEW_PRIVS, 1);\n"
11767 msgstr ""
11768
11769 #. type: Plain text
11770 #: build/C/man2/seccomp.2:138
11771 msgid ""
11772 "Otherwise, the B<SECCOMP_SET_MODE_FILTER> operation will fail and return "
11773 "B<EACCES> in I<errno>.  This requirement ensures that an unprivileged "
11774 "process cannot apply a malicious filter and then invoke a set-user-ID or "
11775 "other privileged program using B<execve>(2), thus potentially compromising "
11776 "that program.  (Such a malicious filter might, for example, cause an attempt "
11777 "to use B<setuid>(2)  to set the caller's user IDs to non-zero values to "
11778 "instead return 0 without actually making the system call.  Thus, the program "
11779 "might be tricked into retaining superuser privileges in circumstances where "
11780 "it is possible to influence it to do dangerous things because it did not "
11781 "actually drop privileges.)"
11782 msgstr ""
11783
11784 #. type: Plain text
11785 #: build/C/man2/seccomp.2:146
11786 msgid ""
11787 "If B<prctl>(2)  or B<seccomp>(2)  is allowed by the attached filter, further "
11788 "filters may be added.  This will increase evaluation time, but allows for "
11789 "further reduction of the attack surface during execution of a thread."
11790 msgstr ""
11791
11792 #. type: Plain text
11793 #: build/C/man2/seccomp.2:152
11794 msgid ""
11795 "The B<SECCOMP_SET_MODE_FILTER> operation is available only if the kernel is "
11796 "configured with B<CONFIG_SECCOMP_FILTER> enabled."
11797 msgstr ""
11798
11799 #. type: Plain text
11800 #: build/C/man2/seccomp.2:156
11801 msgid "When I<flags> is 0, this operation is functionally identical to the call:"
11802 msgstr ""
11803
11804 #. type: Plain text
11805 #: build/C/man2/seccomp.2:158
11806 #, no-wrap
11807 msgid "    prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, args);\n"
11808 msgstr ""
11809
11810 #. type: Plain text
11811 #: build/C/man2/seccomp.2:162
11812 msgid "The recognized I<flags> are:"
11813 msgstr ""
11814
11815 #. type: TP
11816 #: build/C/man2/seccomp.2:163
11817 #, no-wrap
11818 msgid "B<SECCOMP_FILTER_FLAG_TSYNC>"
11819 msgstr ""
11820
11821 #. type: Plain text
11822 #: build/C/man2/seccomp.2:171
11823 msgid ""
11824 "When adding a new filter, synchronize all other threads of the calling "
11825 "process to the same seccomp filter tree.  A \"filter tree\" is the ordered "
11826 "list of filters attached to a thread.  (Attaching identical filters in "
11827 "separate B<seccomp>()  calls results in different filters from this "
11828 "perspective.)"
11829 msgstr ""
11830
11831 #. type: Plain text
11832 #: build/C/man2/seccomp.2:179
11833 msgid ""
11834 "If any thread cannot synchronize to the same filter tree, the call will not "
11835 "attach the new seccomp filter, and will fail, returning the first thread ID "
11836 "found that cannot synchronize.  Synchronization will fail if another thread "
11837 "in the same process is in B<SECCOMP_MODE_STRICT> or if it has attached new "
11838 "seccomp filters to itself, diverging from the calling thread's filter tree."
11839 msgstr ""
11840
11841 #. type: SS
11842 #: build/C/man2/seccomp.2:180
11843 #, no-wrap
11844 msgid "Filters"
11845 msgstr ""
11846
11847 #. type: Plain text
11848 #: build/C/man2/seccomp.2:185
11849 msgid ""
11850 "When adding filters via B<SECCOMP_SET_MODE_FILTER>, I<args> points to a "
11851 "filter program:"
11852 msgstr ""
11853
11854 #. type: Plain text
11855 #: build/C/man2/seccomp.2:193
11856 #, no-wrap
11857 msgid ""
11858 "struct sock_fprog {\n"
11859 "    unsigned short      len;    /* Number of BPF instructions */\n"
11860 "    struct sock_filter *filter; /* Pointer to array of\n"
11861 "                                   BPF instructions */\n"
11862 "};\n"
11863 msgstr ""
11864
11865 #. type: Plain text
11866 #: build/C/man2/seccomp.2:197
11867 msgid "Each program must contain one or more BPF instructions:"
11868 msgstr ""
11869
11870 #. type: Plain text
11871 #: build/C/man2/seccomp.2:206
11872 #, no-wrap
11873 msgid ""
11874 "struct sock_filter {            /* Filter block */\n"
11875 "    __u16 code;                 /* Actual filter code */\n"
11876 "    __u8  jt;                   /* Jump true */\n"
11877 "    __u8  jf;                   /* Jump false */\n"
11878 "    __u32 k;                    /* Generic multiuse field */\n"
11879 "};\n"
11880 msgstr ""
11881
11882 #. type: Plain text
11883 #: build/C/man2/seccomp.2:213
11884 msgid ""
11885 "When executing the instructions, the BPF program operates on the system call "
11886 "information made available (i.e., use the B<BPF_ABS> addressing mode) as a "
11887 "buffer of the following form:"
11888 msgstr ""
11889
11890 #. type: Plain text
11891 #: build/C/man2/seccomp.2:223
11892 #, no-wrap
11893 msgid ""
11894 "struct seccomp_data {\n"
11895 "    int   nr;                   /* System call number */\n"
11896 "    __u32 arch;                 /* AUDIT_ARCH_* value\n"
11897 "                                   (see E<lt>linux/audit.hE<gt>) */\n"
11898 "    __u64 instruction_pointer;  /* CPU instruction pointer */\n"
11899 "    __u64 args[6];              /* Up to 6 system call arguments */\n"
11900 "};\n"
11901 msgstr ""
11902
11903 #. type: Plain text
11904 #: build/C/man2/seccomp.2:234
11905 msgid ""
11906 "A seccomp filter returns a 32-bit value consisting of two parts: the most "
11907 "significant 16 bits (corresponding to the mask defined by the constant "
11908 "B<SECCOMP_RET_ACTION>)  contain one of the \"action\" values listed below; "
11909 "the least significant 16-bits (defined by the constant B<SECCOMP_RET_DATA>)  "
11910 "are \"data\" to be associated with this return value."
11911 msgstr ""
11912
11913 #. type: Plain text
11914 #: build/C/man2/seccomp.2:242
11915 msgid ""
11916 "If multiple filters exist, they are all executed, in reverse order of their "
11917 "addition to the filter tree (i.e., the most recently installed filter is "
11918 "executed first).  The return value for the evaluation of a given system call "
11919 "is the first-seen B<SECCOMP_RET_ACTION> value of highest precedence (along "
11920 "with its accompanying data)  returned by execution of all of the filters."
11921 msgstr ""
11922
11923 #. type: Plain text
11924 #: build/C/man2/seccomp.2:245
11925 msgid ""
11926 "In decreasing order of precedence, the values that may be returned by a "
11927 "seccomp filter are:"
11928 msgstr ""
11929
11930 #. type: TP
11931 #: build/C/man2/seccomp.2:245
11932 #, no-wrap
11933 msgid "B<SECCOMP_RET_KILL>"
11934 msgstr ""
11935
11936 #. type: Plain text
11937 #: build/C/man2/seccomp.2:254
11938 msgid ""
11939 "This value results in the process exiting immediately without executing the "
11940 "system call.  The process terminates as though killed by a B<SIGSYS> signal "
11941 "(I<not> B<SIGKILL>)."
11942 msgstr ""
11943
11944 #. type: TP
11945 #: build/C/man2/seccomp.2:254
11946 #, no-wrap
11947 msgid "B<SECCOMP_RET_TRAP>"
11948 msgstr ""
11949
11950 #. type: Plain text
11951 #: build/C/man2/seccomp.2:264
11952 msgid ""
11953 "This value results in the kernel sending a B<SIGSYS> signal to the "
11954 "triggering process without executing the system call.  Various fields will "
11955 "be set in the I<siginfo_t> structure (see B<sigaction>(2))  associated with "
11956 "signal:"
11957 msgstr ""
11958
11959 #. type: Plain text
11960 #: build/C/man2/seccomp.2:269
11961 msgid "I<si_signo> will contain B<SIGSYS>."
11962 msgstr ""
11963
11964 #. type: Plain text
11965 #: build/C/man2/seccomp.2:272
11966 msgid "I<si_call_addr> will show the address of the system call instruction."
11967 msgstr ""
11968
11969 #. type: Plain text
11970 #: build/C/man2/seccomp.2:277
11971 msgid "I<si_syscall> and I<si_arch> will indicate which system call was attempted."
11972 msgstr ""
11973
11974 #. type: Plain text
11975 #: build/C/man2/seccomp.2:281
11976 msgid "I<si_code> will contain B<SYS_SECCOMP>."
11977 msgstr ""
11978
11979 #. type: Plain text
11980 #: build/C/man2/seccomp.2:286
11981 msgid ""
11982 "I<si_errno> will contain the B<SECCOMP_RET_DATA> portion of the filter "
11983 "return value."
11984 msgstr ""
11985
11986 #. type: Plain text
11987 #: build/C/man2/seccomp.2:295
11988 msgid ""
11989 "The program counter will be as though the system call happened (i.e., it "
11990 "will not point to the system call instruction).  The return value register "
11991 "will contain an architecture-dependent value; if resuming execution, set it "
11992 "to something appropriate for the system call.  (The architecture dependency "
11993 "is because replacing it with B<ENOSYS> could overwrite some useful "
11994 "information.)"
11995 msgstr ""
11996
11997 #. type: TP
11998 #: build/C/man2/seccomp.2:295
11999 #, no-wrap
12000 msgid "B<SECCOMP_RET_ERRNO>"
12001 msgstr ""
12002
12003 #. type: Plain text
12004 #: build/C/man2/seccomp.2:302
12005 msgid ""
12006 "This value results in the B<SECCOMP_RET_DATA> portion of the filter's return "
12007 "value being passed to user space as the I<errno> value without executing the "
12008 "system call."
12009 msgstr ""
12010
12011 #. type: TP
12012 #: build/C/man2/seccomp.2:302
12013 #, no-wrap
12014 msgid "B<SECCOMP_RET_TRACE>"
12015 msgstr ""
12016
12017 #. type: Plain text
12018 #: build/C/man2/seccomp.2:312
12019 msgid ""
12020 "When returned, this value will cause the kernel to attempt to notify a "
12021 "B<ptrace>(2)-based tracer prior to executing the system call.  If there is "
12022 "no tracer present, the system call is not executed and returns a failure "
12023 "status with I<errno> set to B<ENOSYS>."
12024 msgstr ""
12025
12026 #. type: Plain text
12027 #: build/C/man2/seccomp.2:323
12028 msgid ""
12029 "A tracer will be notified if it requests B<PTRACE_O_TRACESECCOMP> using "
12030 "I<ptrace(PTRACE_SETOPTIONS)>.  The tracer will be notified of a "
12031 "B<PTRACE_EVENT_SECCOMP> and the B<SECCOMP_RET_DATA> portion of the filter's "
12032 "return value will be available to the tracer via B<PTRACE_GETEVENTMSG>."
12033 msgstr ""
12034
12035 #. type: Plain text
12036 #: build/C/man2/seccomp.2:330
12037 msgid ""
12038 "The tracer can skip the system call by changing the system call number to "
12039 "-1.  Alternatively, the tracer can change the system call requested by "
12040 "changing the system call to a valid system call number.  If the tracer asks "
12041 "to skip the system call, then the system call will appear to return the "
12042 "value that the tracer puts in the return value register."
12043 msgstr ""
12044
12045 #. type: Plain text
12046 #: build/C/man2/seccomp.2:339
12047 msgid ""
12048 "The seccomp check will not be run again after the tracer is notified.  (This "
12049 "means that seccomp-based sandboxes B<must not> allow use of "
12050 "B<ptrace>(2)\\(emeven of other sandboxed processes\\(emwithout extreme care; "
12051 "ptracers can use this mechanism to escape from the seccomp sandbox.)"
12052 msgstr ""
12053
12054 #. type: TP
12055 #: build/C/man2/seccomp.2:339
12056 #, no-wrap
12057 msgid "B<SECCOMP_RET_ALLOW>"
12058 msgstr ""
12059
12060 #. type: Plain text
12061 #: build/C/man2/seccomp.2:342
12062 msgid "This value results in the system call being executed."
12063 msgstr ""
12064
12065 #. type: Plain text
12066 #: build/C/man2/seccomp.2:358
12067 msgid ""
12068 "On success, B<seccomp>()  returns 0.  On error, if "
12069 "B<SECCOMP_FILTER_FLAG_TSYNC> was used, the return value is the ID of the "
12070 "thread that caused the synchronization failure.  (This ID is a kernel thread "
12071 "ID of the type returned by B<clone>(2)  and B<gettid>(2).)  On other errors, "
12072 "-1 is returned, and I<errno> is set to indicate the cause of the error."
12073 msgstr ""
12074
12075 #. type: Plain text
12076 #: build/C/man2/seccomp.2:361
12077 msgid "B<seccomp>()  can fail for the following reasons:"
12078 msgstr ""
12079
12080 #. type: TP
12081 #: build/C/man2/seccomp.2:361
12082 #, no-wrap
12083 msgid "B<EACCESS>"
12084 msgstr ""
12085
12086 #. type: Plain text
12087 #: build/C/man2/seccomp.2:369
12088 msgid ""
12089 "The caller did not have the B<CAP_SYS_ADMIN> capability, or had not set "
12090 "I<no_new_privs> before using B<SECCOMP_SET_MODE_FILTER>."
12091 msgstr ""
12092
12093 #. type: Plain text
12094 #: build/C/man2/seccomp.2:373
12095 msgid "I<args> was not a valid address."
12096 msgstr ""
12097
12098 #. type: Plain text
12099 #: build/C/man2/seccomp.2:380
12100 msgid "I<operation> is unknown; or I<flags> are invalid for the given I<operation>."
12101 msgstr ""
12102
12103 #. type: Plain text
12104 #: build/C/man2/seccomp.2:387
12105 msgid ""
12106 "I<operation> included B<BPF_ABS>, but the specified offset was not aligned "
12107 "to a 32-bit boundary or exceeded I<sizeof(struct\\ seccomp_data)>."
12108 msgstr ""
12109
12110 #.  See kernel/seccomp.c::seccomp_may_assign_mode() in 3.18 sources
12111 #. type: Plain text
12112 #: build/C/man2/seccomp.2:393
12113 msgid ""
12114 "A secure computing mode has already been set, and I<operation> differs from "
12115 "the existing setting."
12116 msgstr ""
12117
12118 #.  See stub kernel/seccomp.c::seccomp_set_mode_filter() in 3.18 sources
12119 #. type: Plain text
12120 #: build/C/man2/seccomp.2:402
12121 msgid ""
12122 "I<operation> specified B<SECCOMP_SET_MODE_FILTER>, but the kernel was not "
12123 "built with B<CONFIG_SECCOMP_FILTER> enabled."
12124 msgstr ""
12125
12126 #. type: Plain text
12127 #: build/C/man2/seccomp.2:413
12128 msgid ""
12129 "I<operation> specified B<SECCOMP_SET_MODE_FILTER>, but the filter program "
12130 "pointed to by I<args> was not valid or the length of the filter program was "
12131 "zero or exceeded B<BPF_MAXINSNS> (4096) instructions.  B<EINVAL>"
12132 msgstr ""
12133
12134 #.  ENOMEM in kernel/seccomp.c::seccomp_attach_filter() in 3.18 sources
12135 #. type: Plain text
12136 #: build/C/man2/seccomp.2:426
12137 msgid ""
12138 "The total length of all filter programs attached to the calling thread would "
12139 "exceed B<MAX_INSNS_PER_PATH> (32768) instructions.  Note that for the "
12140 "purposes of calculating this limit, each already existing filter program "
12141 "incurs an overhead penalty of 4 instructions."
12142 msgstr ""
12143
12144 #. type: Plain text
12145 #: build/C/man2/seccomp.2:430
12146 msgid ""
12147 "Another thread caused a failure during thread sync, but its ID could not be "
12148 "determined."
12149 msgstr ""
12150
12151 #.  FIXME . Add glibc version
12152 #. type: Plain text
12153 #: build/C/man2/seccomp.2:435
12154 msgid "The B<seccomp>()  system call first appeared in Linux 3.17."
12155 msgstr ""
12156
12157 #. type: Plain text
12158 #: build/C/man2/seccomp.2:439
12159 msgid "The B<seccomp>()  system call is a nonstandard Linux extension."
12160 msgstr ""
12161
12162 #. type: Plain text
12163 #: build/C/man2/seccomp.2:446
12164 msgid ""
12165 "The I<Seccomp> field of the I</proc/[pid]/status> file provides a method of "
12166 "viewing the seccomp mode of a process; see B<proc>(5)."
12167 msgstr ""
12168
12169 #. type: Plain text
12170 #: build/C/man2/seccomp.2:453
12171 msgid ""
12172 "B<seccomp>()  provides a superset of the functionality provided by the "
12173 "B<prctl>(2)  B<PR_SET_SECCOMP> operation (which does not support I<flags>)."
12174 msgstr ""
12175
12176 #. type: SS
12177 #: build/C/man2/seccomp.2:453
12178 #, no-wrap
12179 msgid "Seccomp-specific BPF details"
12180 msgstr ""
12181
12182 #. type: Plain text
12183 #: build/C/man2/seccomp.2:455
12184 msgid "Note the following BPF details specific to seccomp filters:"
12185 msgstr ""
12186
12187 #. type: Plain text
12188 #: build/C/man2/seccomp.2:463
12189 msgid ""
12190 "The B<BPF_H> and B<BPF_B> size modifiers are not supported: all operations "
12191 "must load and store (4-byte) words (B<BPF_W>)."
12192 msgstr ""
12193
12194 #. type: Plain text
12195 #: build/C/man2/seccomp.2:469
12196 msgid ""
12197 "To access the contents of the I<seccomp_data> buffer, use the B<BPF_ABS> "
12198 "addressing mode modifier."
12199 msgstr ""
12200
12201 #. type: Plain text
12202 #: build/C/man2/seccomp.2:476
12203 msgid ""
12204 "The B<BPF_LEN> addressing mode modifier yields an immediate mode operand "
12205 "whose value is the size of the I<seccomp_data> buffer."
12206 msgstr ""
12207
12208 #. type: Plain text
12209 #: build/C/man2/seccomp.2:482
12210 msgid ""
12211 "The program below accepts four or more arguments.  The first three arguments "
12212 "are a system call number, a numeric architecture identifier, and an error "
12213 "number.  The program uses these values to construct a BPF filter that is "
12214 "used at run time to perform the following checks:"
12215 msgstr ""
12216
12217 #. type: IP
12218 #: build/C/man2/seccomp.2:482
12219 #, no-wrap
12220 msgid "[1]"
12221 msgstr ""
12222
12223 #. type: Plain text
12224 #: build/C/man2/seccomp.2:486
12225 msgid ""
12226 "If the program is not running on the specified architecture, the BPF filter "
12227 "causes system calls to fail with the error B<ENOSYS>."
12228 msgstr ""
12229
12230 #. type: IP
12231 #: build/C/man2/seccomp.2:486
12232 #, no-wrap
12233 msgid "[2]"
12234 msgstr ""
12235
12236 #. type: Plain text
12237 #: build/C/man2/seccomp.2:491
12238 msgid ""
12239 "If the program attempts to execute the system call with the specified "
12240 "number, the BPF filter causes the system call to fail, with I<errno> being "
12241 "set to the specified error number."
12242 msgstr ""
12243
12244 #. type: Plain text
12245 #: build/C/man2/seccomp.2:500
12246 msgid ""
12247 "The remaining command-line arguments specify the pathname and additional "
12248 "arguments of a program that the example program should attempt to execute "
12249 "using B<execve>(3)  (a library function that employs the B<execve>(2)  "
12250 "system call).  Some example runs of the program are shown below."
12251 msgstr ""
12252
12253 #. type: Plain text
12254 #: build/C/man2/seccomp.2:504
12255 msgid ""
12256 "First, we display the architecture that we are running on (x86-64)  and then "
12257 "construct a shell function that looks up system call numbers on this "
12258 "architecture:"
12259 msgstr ""
12260
12261 #. type: Plain text
12262 #: build/C/man2/seccomp.2:513
12263 #, no-wrap
12264 msgid ""
12265 "$ B<uname -m>\n"
12266 "x86_64\n"
12267 "$ B<syscall_nr() {\n"
12268 "    cat /usr/src/linux/arch/x86/syscalls/syscall_64.tbl | \\e\n"
12269 "    awk '$2 != \"x32\" && $3 == \"'$1'\" { print $1 }'\n"
12270 "}>\n"
12271 msgstr ""
12272
12273 #. type: Plain text
12274 #: build/C/man2/seccomp.2:520
12275 msgid ""
12276 "When the BPF filter rejects a system call (case [2] above), it causes the "
12277 "system call to fail with the error number specified on the command line.  In "
12278 "the experiments shown here, we'll use error number 99:"
12279 msgstr ""
12280
12281 #. type: Plain text
12282 #: build/C/man2/seccomp.2:525
12283 #, no-wrap
12284 msgid ""
12285 "$ B<errno 99>\n"
12286 "EADDRNOTAVAIL 99 Cannot assign requested address\n"
12287 msgstr ""
12288
12289 #. type: Plain text
12290 #: build/C/man2/seccomp.2:533
12291 msgid ""
12292 "In the following example, we attempt to run the command B<whoami>(1), but "
12293 "the BPF filter rejects the B<execve>(2)  system call, so that the command is "
12294 "not even executed:"
12295 msgstr ""
12296
12297 #. type: Plain text
12298 #: build/C/man2/seccomp.2:544
12299 #, no-wrap
12300 msgid ""
12301 "$ B<syscall_nr execve>\n"
12302 "59\n"
12303 "$ B<./a.out>\n"
12304 "Usage: ./a.out E<lt>syscall_nrE<gt> E<lt>archE<gt> E<lt>errnoE<gt> "
12305 "E<lt>progE<gt> [E<lt>argsE<gt>]\n"
12306 "Hint for E<lt>archE<gt>: AUDIT_ARCH_I386: 0x40000003\n"
12307 "                 AUDIT_ARCH_X86_64: 0xC000003E\n"
12308 "$ B<./a.out 59 0xC000003E 99 /bin/whoami>\n"
12309 "execv: Cannot assign requested address\n"
12310 msgstr ""
12311
12312 #. type: Plain text
12313 #: build/C/man2/seccomp.2:552
12314 msgid ""
12315 "In the next example, the BPF filter rejects the B<write>(2)  system call, so "
12316 "that, although it is successfully started, the B<whoami>(1)  command is not "
12317 "able to write output:"
12318 msgstr ""
12319
12320 #. type: Plain text
12321 #: build/C/man2/seccomp.2:558
12322 #, no-wrap
12323 msgid ""
12324 "$ B<syscall_nr write>\n"
12325 "1\n"
12326 "$ B<./a.out 1 0xC000003E 99 /bin/whoami>\n"
12327 msgstr ""
12328
12329 #. type: Plain text
12330 #: build/C/man2/seccomp.2:565
12331 msgid ""
12332 "In the final example, the BPF filter rejects a system call that is not used "
12333 "by the B<whoami>(1)  command, so it is able to successfully execute and "
12334 "produce output:"
12335 msgstr ""
12336
12337 #. type: Plain text
12338 #: build/C/man2/seccomp.2:572
12339 #, no-wrap
12340 msgid ""
12341 "$ B<syscall_nr preadv>\n"
12342 "295\n"
12343 "$ B<./a.out 295 0xC000003E 99 /bin/whoami>\n"
12344 "cecilia\n"
12345 msgstr ""
12346
12347 #. type: Plain text
12348 #: build/C/man2/seccomp.2:586
12349 #, no-wrap
12350 msgid ""
12351 "#include E<lt>errno.hE<gt>\n"
12352 "#include E<lt>stddef.hE<gt>\n"
12353 "#include E<lt>stdio.hE<gt>\n"
12354 "#include E<lt>stdlib.hE<gt>\n"
12355 "#include E<lt>unistd.hE<gt>\n"
12356 "#include E<lt>linux/audit.hE<gt>\n"
12357 "#include E<lt>linux/filter.hE<gt>\n"
12358 "#include E<lt>linux/seccomp.hE<gt>\n"
12359 "#include E<lt>sys/prctl.hE<gt>\n"
12360 msgstr ""
12361
12362 #. type: Plain text
12363 #: build/C/man2/seccomp.2:595
12364 #, no-wrap
12365 msgid ""
12366 "static int\n"
12367 "install_filter(int syscall_nr, int t_arch, int f_errno)\n"
12368 "{\n"
12369 "    struct sock_filter filter[] = {\n"
12370 "        /* [0] Load architecture from 'seccomp_data' buffer into\n"
12371 "               accumulator */\n"
12372 "        BPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n"
12373 "                 (offsetof(struct seccomp_data, arch))),\n"
12374 msgstr ""
12375
12376 #. type: Plain text
12377 #: build/C/man2/seccomp.2:599
12378 #, no-wrap
12379 msgid ""
12380 "        /* [1] Jump forward 4 instructions if architecture does not\n"
12381 "               match 't_arch' */\n"
12382 "        BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, t_arch, 0, 4),\n"
12383 msgstr ""
12384
12385 #. type: Plain text
12386 #: build/C/man2/seccomp.2:604
12387 #, no-wrap
12388 msgid ""
12389 "        /* [2] Load system call number from 'seccomp_data' buffer into\n"
12390 "               accumulator */\n"
12391 "        BPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n"
12392 "                 (offsetof(struct seccomp_data, nr))),\n"
12393 msgstr ""
12394
12395 #. type: Plain text
12396 #: build/C/man2/seccomp.2:608
12397 #, no-wrap
12398 msgid ""
12399 "        /* [3] Jump forward 1 instruction if system call number\n"
12400 "               does not match 'syscall_nr' */\n"
12401 "        BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, syscall_nr, 0, 1),\n"
12402 msgstr ""
12403
12404 #. type: Plain text
12405 #: build/C/man2/seccomp.2:613
12406 #, no-wrap
12407 msgid ""
12408 "        /* [4] Matching architecture and system call: don't execute\n"
12409 "\t       the system call, and return 'f_errno' in 'errno' */\n"
12410 "        BPF_STMT(BPF_RET | BPF_K,\n"
12411 "                 SECCOMP_RET_ERRNO | (f_errno & SECCOMP_RET_DATA)),\n"
12412 msgstr ""
12413
12414 #. type: Plain text
12415 #: build/C/man2/seccomp.2:617
12416 #, no-wrap
12417 msgid ""
12418 "        /* [5] Destination of system call number mismatch: allow other\n"
12419 "               system calls */\n"
12420 "        BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),\n"
12421 msgstr ""
12422
12423 #. type: Plain text
12424 #: build/C/man2/seccomp.2:621
12425 #, no-wrap
12426 msgid ""
12427 "        /* [6] Destination of architecture mismatch: kill process */\n"
12428 "        BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_KILL),\n"
12429 "    };\n"
12430 msgstr ""
12431
12432 #. type: Plain text
12433 #: build/C/man2/seccomp.2:626
12434 #, no-wrap
12435 msgid ""
12436 "    struct sock_fprog prog = {\n"
12437 "        .len = (unsigned short) (sizeof(filter) / sizeof(filter[0])),\n"
12438 "        .filter = filter,\n"
12439 "    };\n"
12440 msgstr ""
12441
12442 #. type: Plain text
12443 #: build/C/man2/seccomp.2:631
12444 #, no-wrap
12445 msgid ""
12446 "    if (seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog)) {\n"
12447 "        perror(\"seccomp\");\n"
12448 "        return 1;\n"
12449 "    }\n"
12450 msgstr ""
12451
12452 #. type: Plain text
12453 #: build/C/man2/seccomp.2:634
12454 #, no-wrap
12455 msgid ""
12456 "    return 0;\n"
12457 "}\n"
12458 msgstr ""
12459
12460 #. type: Plain text
12461 #: build/C/man2/seccomp.2:646
12462 #, no-wrap
12463 msgid ""
12464 "int\n"
12465 "main(int argc, char **argv)\n"
12466 "{\n"
12467 "    if (argc E<lt> 5) {\n"
12468 "        fprintf(stderr, \"Usage: \"\n"
12469 "                \"%s E<lt>syscall_nrE<gt> E<lt>archE<gt> E<lt>errnoE<gt> "
12470 "E<lt>progE<gt> [E<lt>argsE<gt>]\\en\"\n"
12471 "                \"Hint for E<lt>archE<gt>: AUDIT_ARCH_I386: 0x%X\\en\"\n"
12472 "                \"                 AUDIT_ARCH_X86_64: 0x%X\\en\"\n"
12473 "                \"\\en\", argv[0], AUDIT_ARCH_I386, AUDIT_ARCH_X86_64);\n"
12474 "        exit(EXIT_FAILURE);\n"
12475 "    }\n"
12476 msgstr ""
12477
12478 #. type: Plain text
12479 #: build/C/man2/seccomp.2:651
12480 #, no-wrap
12481 msgid ""
12482 "    if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) {\n"
12483 "        perror(\"prctl\");\n"
12484 "        exit(EXIT_FAILURE);\n"
12485 "    }\n"
12486 msgstr ""
12487
12488 #. type: Plain text
12489 #: build/C/man2/seccomp.2:656
12490 #, no-wrap
12491 msgid ""
12492 "    if (install_filter(strtol(argv[1], NULL, 0),\n"
12493 "                       strtol(argv[2], NULL, 0),\n"
12494 "                       strtol(argv[3], NULL, 0)))\n"
12495 "        exit(EXIT_FAILURE);\n"
12496 msgstr ""
12497
12498 #. type: Plain text
12499 #: build/C/man2/seccomp.2:661
12500 #, no-wrap
12501 msgid ""
12502 "    execv(argv[4], &argv[4]);\n"
12503 "    perror(\"execv\");\n"
12504 "    exit(EXIT_FAILURE);\n"
12505 "}\n"
12506 msgstr ""
12507
12508 #. type: Plain text
12509 #: build/C/man2/seccomp.2:668
12510 msgid "B<prctl>(2), B<ptrace>(2), B<sigaction>(2), B<signal>(7), B<socket>(7)"
12511 msgstr ""
12512
12513 #. type: Plain text
12514 #: build/C/man2/seccomp.2:673
12515 msgid ""
12516 "The kernel source files I<Documentation/networking/filter.txt> and "
12517 "I<Documentation/prctl/seccomp_filter.txt>."
12518 msgstr ""
12519
12520 #. type: Plain text
12521 #: build/C/man2/seccomp.2:679
12522 msgid ""
12523 "McCanne, S. and Jacobson, V. (1992)  I<The BSD Packet Filter: A New "
12524 "Architecture for User-level Packet Capture>, Proceedings of the USENIX "
12525 "Winter 1993 Conference E<.UR http://www.tcpdump.org/papers/bpf-usenix93.pdf> "
12526 "E<.UE>"
12527 msgstr ""