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.
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2012-03-22 04:26+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"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: build/C/man2/acct.2:32 build/C/man5/acct.5:23
26 #: build/C/man2/acct.2:32
32 #: build/C/man2/acct.2:32 build/C/man5/acct.5:23 build/C/man7/capabilities.7:46 build/C/man2/capget.2:11 build/C/man7/cpuset.7:24 build/C/man7/credentials.7:25 build/C/man2/getgid.2:25 build/C/man2/getgroups.2:31 build/C/man2/getpid.2:23 build/C/man2/getpriority.2:46 build/C/man2/getresuid.2:27 build/C/man2/getrlimit.2:64 build/C/man2/getrusage.2:39 build/C/man2/getsid.2:25 build/C/man2/getuid.2:26 build/C/man2/iopl.2:33 build/C/man2/ioprio_set.2:25 build/C/man2/ipc.2:26 build/C/man2/seteuid.2:27 build/C/man2/setfsgid.2:29 build/C/man2/setfsuid.2:29 build/C/man2/setgid.2:27 build/C/man2/setpgid.2:46 build/C/man2/setresuid.2:26 build/C/man2/setreuid.2:43 build/C/man2/setsid.2:29 build/C/man2/setuid.2:28 build/C/man7/svipc.7:25 build/C/man3/ulimit.3:27
38 #: build/C/man2/acct.2:32 build/C/man5/acct.5:23 build/C/man7/capabilities.7:46 build/C/man2/capget.2:11 build/C/man7/cpuset.7:24 build/C/man7/credentials.7:25 build/C/man2/getgid.2:25 build/C/man2/getgroups.2:31 build/C/man2/getpid.2:23 build/C/man2/getpriority.2:46 build/C/man2/getresuid.2:27 build/C/man2/getrlimit.2:64 build/C/man2/getrusage.2:39 build/C/man2/getsid.2:25 build/C/man2/getuid.2:26 build/C/man2/iopl.2:33 build/C/man2/ioprio_set.2:25 build/C/man2/ipc.2:26 build/C/man2/seteuid.2:27 build/C/man2/setfsgid.2:29 build/C/man2/setfsuid.2:29 build/C/man2/setgid.2:27 build/C/man2/setpgid.2:46 build/C/man2/setresuid.2:26 build/C/man2/setreuid.2:43 build/C/man2/setsid.2:29 build/C/man2/setuid.2:28 build/C/man7/svipc.7:25 build/C/man3/ulimit.3:27
40 msgid "Linux Programmer's Manual"
44 #: build/C/man2/acct.2:33 build/C/man5/acct.5:24 build/C/man7/capabilities.7:47 build/C/man2/capget.2:12 build/C/man7/cpuset.7:25 build/C/man7/credentials.7:26 build/C/man2/getgid.2:26 build/C/man2/getgroups.2:32 build/C/man2/getpid.2:24 build/C/man2/getpriority.2:47 build/C/man2/getresuid.2:28 build/C/man2/getrlimit.2:65 build/C/man2/getrusage.2:40 build/C/man2/getsid.2:26 build/C/man2/getuid.2:27 build/C/man2/iopl.2:34 build/C/man2/ioprio_set.2:26 build/C/man2/ipc.2:27 build/C/man2/seteuid.2:28 build/C/man2/setfsgid.2:30 build/C/man2/setfsuid.2:30 build/C/man2/setgid.2:28 build/C/man2/setpgid.2:47 build/C/man2/setresuid.2:27 build/C/man2/setreuid.2:44 build/C/man2/setsid.2:30 build/C/man2/setuid.2:29 build/C/man7/svipc.7:26 build/C/man3/ulimit.3:28
50 #: build/C/man2/acct.2:35
51 msgid "acct - switch process accounting on or off"
55 #: build/C/man2/acct.2:35 build/C/man5/acct.5:26 build/C/man2/capget.2:14 build/C/man2/getgid.2:28 build/C/man2/getgroups.2:34 build/C/man2/getpid.2:26 build/C/man2/getpriority.2:49 build/C/man2/getresuid.2:30 build/C/man2/getrlimit.2:67 build/C/man2/getrusage.2:42 build/C/man2/getsid.2:28 build/C/man2/getuid.2:29 build/C/man2/iopl.2:36 build/C/man2/ioprio_set.2:28 build/C/man2/ipc.2:29 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:29 build/C/man2/setreuid.2:46 build/C/man2/setsid.2:32 build/C/man2/setuid.2:31 build/C/man7/svipc.7:28 build/C/man3/ulimit.3:30
61 #: build/C/man2/acct.2:39
63 msgid "B<#include E<lt>unistd.hE<gt>>\n"
67 #: build/C/man2/acct.2:41
69 msgid "B<int acct(const char *>I<filename>B<);>\n"
73 #: build/C/man2/acct.2:47 build/C/man2/getgroups.2:48 build/C/man2/getrlimit.2:84 build/C/man2/getsid.2:36 build/C/man2/seteuid.2:42 build/C/man2/setpgid.2:69 build/C/man2/setreuid.2:58
74 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
78 #: build/C/man2/acct.2:51
79 msgid "B<acct>(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\\ E<lt>\\ 500)"
83 #: build/C/man2/acct.2:51 build/C/man5/acct.5:28 build/C/man7/capabilities.7:49 build/C/man2/capget.2:20 build/C/man7/cpuset.7:27 build/C/man7/credentials.7:28 build/C/man2/getgid.2:36 build/C/man2/getgroups.2:52 build/C/man2/getpid.2:34 build/C/man2/getpriority.2:57 build/C/man2/getresuid.2:38 build/C/man2/getrlimit.2:88 build/C/man2/getrusage.2:48 build/C/man2/getsid.2:49 build/C/man2/getuid.2:37 build/C/man2/iopl.2:40 build/C/man2/ioprio_set.2:33 build/C/man2/ipc.2:35 build/C/man2/seteuid.2:51 build/C/man2/setfsgid.2:37 build/C/man2/setfsuid.2:37 build/C/man2/setgid.2:36 build/C/man2/setpgid.2:96 build/C/man2/setresuid.2:37 build/C/man2/setreuid.2:68 build/C/man2/setsid.2:39 build/C/man2/setuid.2:37 build/C/man7/svipc.7:36 build/C/man3/ulimit.3:34
89 #: build/C/man2/acct.2:60
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 "
99 #: build/C/man2/acct.2:60 build/C/man2/capget.2:152 build/C/man2/getgroups.2:92 build/C/man2/getpriority.2:105 build/C/man2/getresuid.2:49 build/C/man2/getrlimit.2:430 build/C/man2/getrusage.2:180 build/C/man2/getsid.2:57 build/C/man2/iopl.2:65 build/C/man2/ioprio_set.2:139 build/C/man2/seteuid.2:65 build/C/man2/setfsgid.2:67 build/C/man2/setfsuid.2:67 build/C/man2/setgid.2:51 build/C/man2/setpgid.2:170 build/C/man2/setresuid.2:64 build/C/man2/setreuid.2:89 build/C/man2/setsid.2:50 build/C/man2/setuid.2:68 build/C/man3/ulimit.3:67
105 #: build/C/man2/acct.2:65 build/C/man2/capget.2:157 build/C/man2/getresuid.2:54 build/C/man2/getrusage.2:185 build/C/man2/iopl.2:70 build/C/man2/seteuid.2:70 build/C/man2/setgid.2:56 build/C/man2/setresuid.2:69 build/C/man2/setreuid.2:94 build/C/man2/setuid.2:73
107 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
112 #: build/C/man2/acct.2:65 build/C/man2/capget.2:171 build/C/man7/cpuset.7:1099 build/C/man2/getgid.2:42 build/C/man2/getgroups.2:106 build/C/man2/getpid.2:42 build/C/man2/getpriority.2:118 build/C/man2/getresuid.2:54 build/C/man2/getrlimit.2:435 build/C/man2/getrusage.2:185 build/C/man2/getsid.2:62 build/C/man2/getuid.2:43 build/C/man2/iopl.2:70 build/C/man2/ioprio_set.2:159 build/C/man2/seteuid.2:70 build/C/man2/setgid.2:56 build/C/man2/setpgid.2:191 build/C/man2/setresuid.2:69 build/C/man2/setreuid.2:94 build/C/man2/setsid.2:57 build/C/man2/setuid.2:73 build/C/man3/ulimit.3:74
118 #: build/C/man2/acct.2:66 build/C/man7/cpuset.7:1115 build/C/man7/cpuset.7:1122 build/C/man7/cpuset.7:1128 build/C/man7/cpuset.7:1136 build/C/man7/cpuset.7:1143 build/C/man2/getpriority.2:138 build/C/man2/setpgid.2:192
124 #: build/C/man2/acct.2:77
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."
132 #: build/C/man2/acct.2:77 build/C/man2/capget.2:172 build/C/man7/cpuset.7:1171 build/C/man2/getgroups.2:107 build/C/man2/getresuid.2:55 build/C/man2/getrlimit.2:436 build/C/man2/getrusage.2:186
138 #: build/C/man2/acct.2:81
139 msgid "I<filename> points outside your accessible address space."
143 #: build/C/man2/acct.2:81 build/C/man7/cpuset.7:1237 build/C/man7/cpuset.7:1245
149 #: build/C/man2/acct.2:85
150 msgid "Error writing to the file I<filename>."
154 #: build/C/man2/acct.2:85
160 #: build/C/man2/acct.2:89
161 msgid "I<filename> is a directory."
165 #: build/C/man2/acct.2:89
171 #: build/C/man2/acct.2:93
172 msgid "Too many symbolic links were encountered in resolving I<filename>."
176 #: build/C/man2/acct.2:93 build/C/man7/cpuset.7:1250 build/C/man7/cpuset.7:1257 build/C/man7/cpuset.7:1262
178 msgid "B<ENAMETOOLONG>"
182 #: build/C/man2/acct.2:97
183 msgid "I<filename> was too long."
187 #: build/C/man2/acct.2:97
193 #: build/C/man2/acct.2:100
194 msgid "The system limit on the total number of open files has been reached."
198 #: build/C/man2/acct.2:100 build/C/man7/cpuset.7:1274 build/C/man7/cpuset.7:1279
204 #: build/C/man2/acct.2:103
205 msgid "The specified filename does not exist."
209 #: build/C/man2/acct.2:103 build/C/man7/cpuset.7:1286 build/C/man2/getgroups.2:127
215 #: build/C/man2/acct.2:106 build/C/man2/getgroups.2:130
216 msgid "Out of memory."
220 #: build/C/man2/acct.2:106 build/C/man2/iopl.2:75
226 #: build/C/man2/acct.2:112
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>."
234 #: build/C/man2/acct.2:112 build/C/man7/cpuset.7:1313
240 #: build/C/man2/acct.2:117
241 msgid "A component used as a directory in I<filename> is not in fact a directory."
245 #: build/C/man2/acct.2:117 build/C/man2/capget.2:183 build/C/man2/capget.2:188 build/C/man7/cpuset.7:1318 build/C/man2/getgroups.2:130 build/C/man2/getpriority.2:150 build/C/man2/getrlimit.2:452 build/C/man2/getsid.2:63 build/C/man2/iopl.2:78 build/C/man2/ioprio_set.2:169 build/C/man2/seteuid.2:73 build/C/man2/setgid.2:57 build/C/man2/setpgid.2:206 build/C/man2/setresuid.2:77 build/C/man2/setreuid.2:95 build/C/man2/setsid.2:58 build/C/man2/setuid.2:83 build/C/man3/ulimit.3:75
251 #: build/C/man2/acct.2:123
253 "The calling process has insufficient privilege to enable process "
254 "accounting. On Linux the B<CAP_SYS_PACCT> capability is required."
258 #: build/C/man2/acct.2:123
264 #: build/C/man2/acct.2:127
265 msgid "I<filename> refers to a file on a read-only file system."
269 #: build/C/man2/acct.2:127
275 #: build/C/man2/acct.2:130
276 msgid "There are no more free file structures or we ran out of memory."
280 #: build/C/man2/acct.2:130 build/C/man5/acct.5:152 build/C/man7/capabilities.7:997 build/C/man2/capget.2:210 build/C/man7/credentials.7:232 build/C/man2/getgid.2:44 build/C/man2/getgroups.2:133 build/C/man2/getpid.2:44 build/C/man2/getpriority.2:158 build/C/man2/getresuid.2:66 build/C/man2/getrlimit.2:473 build/C/man2/getrusage.2:194 build/C/man2/getsid.2:78 build/C/man2/getuid.2:45 build/C/man2/iopl.2:85 build/C/man2/ioprio_set.2:186 build/C/man2/ipc.2:46 build/C/man2/seteuid.2:89 build/C/man2/setfsgid.2:78 build/C/man2/setfsuid.2:78 build/C/man2/setgid.2:74 build/C/man2/setpgid.2:225 build/C/man2/setresuid.2:83 build/C/man2/setreuid.2:111 build/C/man2/setsid.2:64 build/C/man2/setuid.2:90 build/C/man3/ulimit.3:78
282 msgid "CONFORMING TO"
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).
291 #: build/C/man2/acct.2:137
292 msgid "SVr4, 4.3BSD (but not POSIX)."
296 #: build/C/man2/acct.2:137 build/C/man5/acct.5:156 build/C/man7/capabilities.7:1002 build/C/man2/capget.2:212 build/C/man7/cpuset.7:1340 build/C/man7/credentials.7:238 build/C/man2/getgid.2:46 build/C/man2/getgroups.2:141 build/C/man2/getpid.2:46 build/C/man2/getpriority.2:161 build/C/man2/getresuid.2:69 build/C/man2/getrlimit.2:496 build/C/man2/getrusage.2:205 build/C/man2/getsid.2:80 build/C/man2/getuid.2:47 build/C/man2/getuid.2:57 build/C/man2/iopl.2:89 build/C/man2/ioprio_set.2:188 build/C/man2/ipc.2:50 build/C/man2/seteuid.2:91 build/C/man2/setfsgid.2:82 build/C/man2/setfsuid.2:82 build/C/man2/setgid.2:64 build/C/man2/setpgid.2:247 build/C/man2/setresuid.2:86 build/C/man2/setreuid.2:117 build/C/man2/setsid.2:66 build/C/man2/setuid.2:95
302 #: build/C/man2/acct.2:140
304 "No accounting is produced for programs running when a system crash occurs. "
305 "In particular, nonterminating processes are never accounted for."
309 #: build/C/man2/acct.2:143
311 "The structure of the records written to the accounting file is described in "
316 #: build/C/man2/acct.2:143 build/C/man5/acct.5:173 build/C/man7/capabilities.7:1050 build/C/man2/capget.2:219 build/C/man7/cpuset.7:1487 build/C/man7/credentials.7:250 build/C/man2/getgid.2:62 build/C/man2/getgroups.2:171 build/C/man2/getpid.2:98 build/C/man2/getpriority.2:223 build/C/man2/getresuid.2:85 build/C/man2/getrlimit.2:620 build/C/man2/getrusage.2:245 build/C/man2/getsid.2:83 build/C/man2/getuid.2:73 build/C/man2/iopl.2:98 build/C/man2/ioprio_set.2:317 build/C/man2/ipc.2:58 build/C/man2/seteuid.2:117 build/C/man2/setfsgid.2:110 build/C/man2/setfsuid.2:110 build/C/man2/setgid.2:76 build/C/man2/setpgid.2:315 build/C/man2/setresuid.2:106 build/C/man2/setreuid.2:157 build/C/man2/setsid.2:83 build/C/man2/setuid.2:118 build/C/man7/svipc.7:320 build/C/man3/ulimit.3:83
322 #: build/C/man2/acct.2:145
327 #: build/C/man2/acct.2:145 build/C/man5/acct.5:178 build/C/man7/capabilities.7:1071 build/C/man2/capget.2:223 build/C/man7/cpuset.7:1504 build/C/man7/credentials.7:281 build/C/man2/getgid.2:67 build/C/man2/getgroups.2:178 build/C/man2/getpid.2:108 build/C/man2/getpriority.2:231 build/C/man2/getresuid.2:91 build/C/man2/getrlimit.2:637 build/C/man2/getrusage.2:252 build/C/man2/getsid.2:87 build/C/man2/getuid.2:78 build/C/man2/iopl.2:101 build/C/man2/ioprio_set.2:323 build/C/man2/ipc.2:71 build/C/man2/seteuid.2:124 build/C/man2/setfsgid.2:115 build/C/man2/setfsuid.2:115 build/C/man2/setgid.2:82 build/C/man2/setpgid.2:322 build/C/man2/setresuid.2:115 build/C/man2/setreuid.2:165 build/C/man2/setsid.2:89 build/C/man2/setuid.2:125 build/C/man7/svipc.7:334 build/C/man3/ulimit.3:88
333 #: build/C/man2/acct.2:152 build/C/man5/acct.5:185 build/C/man7/capabilities.7:1078 build/C/man2/capget.2:230 build/C/man7/cpuset.7:1511 build/C/man7/credentials.7:288 build/C/man2/getgid.2:74 build/C/man2/getgroups.2:185 build/C/man2/getpid.2:115 build/C/man2/getpriority.2:238 build/C/man2/getresuid.2:98 build/C/man2/getrlimit.2:644 build/C/man2/getrusage.2:259 build/C/man2/getsid.2:94 build/C/man2/getuid.2:85 build/C/man2/iopl.2:108 build/C/man2/ioprio_set.2:330 build/C/man2/ipc.2:78 build/C/man2/seteuid.2:131 build/C/man2/setfsgid.2:122 build/C/man2/setfsuid.2:122 build/C/man2/setgid.2:89 build/C/man2/setpgid.2:329 build/C/man2/setresuid.2:122 build/C/man2/setreuid.2:172 build/C/man2/setsid.2:96 build/C/man2/setuid.2:132 build/C/man7/svipc.7:341 build/C/man3/ulimit.3:95
335 "This page is part of release 3.37 of the Linux I<man-pages> project. A "
336 "description of the project, and information about reporting bugs, can be "
337 "found at http://www.kernel.org/doc/man-pages/."
341 #: build/C/man5/acct.5:23
347 #: build/C/man5/acct.5:26
348 msgid "acct - process accounting file"
352 #: build/C/man5/acct.5:28
353 msgid "B<#include E<lt>sys/acct.hE<gt>>"
357 #: build/C/man5/acct.5:34
359 "If the kernel is built with the process accounting option enabled "
360 "(B<CONFIG_BSD_PROCESS_ACCT>), then calling B<acct>(2) starts process "
361 "accounting, for example:"
365 #: build/C/man5/acct.5:37
366 msgid "acct(\"/var/log/pacct\");"
370 #: build/C/man5/acct.5:45
372 "When process accounting is enabled, the kernel writes a record to the "
373 "accounting file as each process on the system terminates. This record "
374 "contains information about the terminated process, and is defined in "
375 "I<E<lt>sys/acct.hE<gt>> as follows:"
379 #: build/C/man5/acct.5:49
381 msgid "#define ACCT_COMM 16\n"
385 #: build/C/man5/acct.5:51
387 msgid "typedef u_int16_t comp_t;\n"
391 #: build/C/man5/acct.5:75
395 " char ac_flag; /* Accounting flags */\n"
396 " u_int16_t ac_uid; /* Accounting user ID */\n"
397 " u_int16_t ac_gid; /* Accounting group ID */\n"
398 " u_int16_t ac_tty; /* Controlling terminal */\n"
399 " u_int32_t ac_btime; /* Process creation time\n"
400 " (seconds since the Epoch) */\n"
401 " comp_t ac_utime; /* User CPU time */\n"
402 " comp_t ac_stime; /* System CPU time */\n"
403 " comp_t ac_etime; /* Elapsed time */\n"
404 " comp_t ac_mem; /* Average memory usage (kB) */\n"
405 " comp_t ac_io; /* Characters transferred (unused) */\n"
406 " comp_t ac_rw; /* Blocks read or written (unused) */\n"
407 " comp_t ac_minflt; /* Minor page faults */\n"
408 " comp_t ac_majflt; /* Major page faults */\n"
409 " comp_t ac_swaps; /* Number of swaps (unused) */\n"
410 " u_int32_t ac_exitcode; /* Process termination status\n"
411 " (see wait(2)) */\n"
412 " char ac_comm[ACCT_COMM+1];\n"
413 " /* Command name (basename of last\n"
414 " executed command; null-terminated) */\n"
415 " char ac_pad[I<X>]; /* padding bytes */\n"
420 #: build/C/man5/acct.5:82
423 "enum { /* Bits that may be set in ac_flag field */\n"
424 " AFORK = 0x01, /* Has executed fork, but no exec */\n"
425 " ASU = 0x02, /* Used superuser privileges */\n"
426 " ACORE = 0x08, /* Dumped core */\n"
427 " AXSIG = 0x10 /* Killed by a signal */\n"
432 #: build/C/man5/acct.5:92
434 "The I<comp_t> data type is a floating-point value consisting of a 3-bit, "
435 "base-8 exponent, and a 13-bit mantissa. A value, I<c>, of this type can be "
436 "converted to a (long) integer as follows:"
440 #: build/C/man5/acct.5:95
442 msgid " v = (c & 0x1fff) E<lt>E<lt> (((c E<gt>E<gt> 13) & 0x7) * 3);\n"
446 #: build/C/man5/acct.5:105
448 "The I<ac_utime>, I<ac_stime>, and I<ac_etime> fields measure time in \"clock "
449 "ticks\"; divide these values by I<sysconf(_SC_CLK_TCK)> to convert them to "
454 #: build/C/man5/acct.5:105
456 msgid "Version 3 Accounting File Format"
460 #: build/C/man5/acct.5:120
462 "Since kernel 2.6.8, an optional alternative version of the accounting file "
463 "can be produced if the B<CONFIG_BSD_PROCESS_ACCT_V3> option is set when "
464 "building the kernel. With this option is set, the records written to the "
465 "accounting file contain additional fields, and the width of I<c_uid> and "
466 "I<ac_gid> fields is widened from 16 to 32 bits (in line with the increased "
467 "size of UID and GIDs in Linux 2.4 and later). The records are defined as "
472 #: build/C/man5/acct.5:145
476 " char ac_flag; /* Flags */\n"
477 " char ac_version; /* Always set to ACCT_VERSION (3) */\n"
478 " u_int16_t ac_tty; /* Controlling terminal */\n"
479 " u_int32_t ac_exitcode; /* Process termination status */\n"
480 " u_int32_t ac_uid; /* Real user ID */\n"
481 " u_int32_t ac_gid; /* Real group ID */\n"
482 " u_int32_t ac_pid; /* Process ID */\n"
483 " u_int32_t ac_ppid; /* Parent process ID */\n"
484 " u_int32_t ac_btime; /* Process creation time */\n"
485 " float ac_etime; /* Elapsed time */\n"
486 " comp_t ac_utime; /* User CPU time */\n"
487 " comp_t ac_stime; /* System time */\n"
488 " comp_t ac_mem; /* Average memory usage (kB) */\n"
489 " comp_t ac_io; /* Characters transferred (unused) */\n"
490 " comp_t ac_rw; /* Blocks read or written\n"
492 " comp_t ac_minflt; /* Minor page faults */\n"
493 " comp_t ac_majflt; /* Major page faults */\n"
494 " comp_t ac_swaps; /* Number of swaps (unused) */\n"
495 " char ac_comm[ACCT_COMM]; /* Command name */\n"
500 #: build/C/man5/acct.5:148 build/C/man7/cpuset.7:1337 build/C/man2/getresuid.2:59 build/C/man2/getrlimit.2:468 build/C/man2/getsid.2:74 build/C/man2/ioprio_set.2:183 build/C/man2/setfsgid.2:74 build/C/man2/setfsuid.2:74 build/C/man2/setresuid.2:81
506 #: build/C/man5/acct.5:152
507 msgid "The I<acct_v3> structure is defined in glibc since version 2.6."
511 #: build/C/man5/acct.5:156
513 "Process accounting originated on BSD. Although it is present on most "
514 "systems, it is not standardized, and the details vary somewhat between "
519 #: build/C/man5/acct.5:159
521 "Records in the accounting file are ordered by termination time of the "
526 #: build/C/man5/acct.5:166
528 "In kernels up to and including 2.6.9, a separate accounting record is "
529 "written for each thread created using the NPTL threading library; since "
530 "Linux 2.6.10, a single accounting record is written for the entire process "
531 "on termination of the last thread in the process."
535 #: build/C/man5/acct.5:173
537 "The I<proc/sys/kernel/acct> file, described in B<proc>(5), defines settings "
538 "that control the behavior of process accounting when disk space runs low."
542 #: build/C/man5/acct.5:178
543 msgid "B<lastcomm>(1), B<acct>(2), B<accton>(8), B<sa>(8)"
547 #: build/C/man7/capabilities.7:46
553 #: build/C/man7/capabilities.7:46
559 #: build/C/man7/capabilities.7:49
560 msgid "capabilities - overview of Linux capabilities"
564 #: build/C/man7/capabilities.7:61
566 "For the purpose of performing permission checks, traditional UNIX "
567 "implementations distinguish two categories of processes: I<privileged> "
568 "processes (whose effective user ID is 0, referred to as superuser or root), "
569 "and I<unprivileged> processes (whose effective UID is nonzero). Privileged "
570 "processes bypass all kernel permission checks, while unprivileged processes "
571 "are subject to full permission checking based on the process's credentials "
572 "(usually: effective UID, effective GID, and supplementary group list)."
576 #: build/C/man7/capabilities.7:68
578 "Starting with kernel 2.2, Linux divides the privileges traditionally "
579 "associated with superuser into distinct units, known as I<capabilities>, "
580 "which can be independently enabled and disabled. Capabilities are a "
581 "per-thread attribute."
585 #: build/C/man7/capabilities.7:68
587 msgid "Capabilities List"
591 #: build/C/man7/capabilities.7:71
593 "The following list shows the capabilities implemented on Linux, and the "
594 "operations or behaviors that each capability permits:"
598 #: build/C/man7/capabilities.7:71
600 msgid "B<CAP_AUDIT_CONTROL> (since Linux 2.6.11)"
604 #: build/C/man7/capabilities.7:75
606 "Enable and disable kernel auditing; change auditing filter rules; retrieve "
607 "auditing status and filtering rules."
611 #: build/C/man7/capabilities.7:75
613 msgid "B<CAP_AUDIT_WRITE> (since Linux 2.6.11)"
617 #: build/C/man7/capabilities.7:78
618 msgid "Write records to kernel auditing log."
622 #: build/C/man7/capabilities.7:78
628 #: build/C/man7/capabilities.7:82
629 msgid "Make arbitrary changes to file UIDs and GIDs (see B<chown>(2))."
633 #: build/C/man7/capabilities.7:82
635 msgid "B<CAP_DAC_OVERRIDE>"
639 #: build/C/man7/capabilities.7:86
641 "Bypass file read, write, and execute permission checks. (DAC is an "
642 "abbreviation of \"discretionary access control\".)"
646 #: build/C/man7/capabilities.7:86
648 msgid "B<CAP_DAC_READ_SEARCH>"
652 #: build/C/man7/capabilities.7:90
654 "Bypass file read permission checks and directory read and execute permission "
659 #: build/C/man7/capabilities.7:90
661 msgid "B<CAP_FOWNER>"
665 #: build/C/man7/capabilities.7:94 build/C/man7/capabilities.7:104 build/C/man7/capabilities.7:108 build/C/man7/capabilities.7:110 build/C/man7/capabilities.7:112 build/C/man7/capabilities.7:182 build/C/man7/capabilities.7:184 build/C/man7/capabilities.7:186 build/C/man7/capabilities.7:188 build/C/man7/capabilities.7:190 build/C/man7/capabilities.7:192 build/C/man7/capabilities.7:194 build/C/man7/capabilities.7:196 build/C/man7/capabilities.7:198 build/C/man7/capabilities.7:222 build/C/man7/capabilities.7:224 build/C/man7/capabilities.7:270 build/C/man7/capabilities.7:280 build/C/man7/capabilities.7:286 build/C/man7/capabilities.7:291 build/C/man7/capabilities.7:297 build/C/man7/capabilities.7:304 build/C/man7/capabilities.7:307 build/C/man7/capabilities.7:315 build/C/man7/capabilities.7:317 build/C/man7/capabilities.7:326 build/C/man7/capabilities.7:333 build/C/man7/capabilities.7:336 build/C/man7/capabilities.7:338 build/C/man7/capabilities.7:343 build/C/man7/capabilities.7:346 build/C/man7/capabilities.7:353 build/C/man7/capabilities.7:358 build/C/man7/capabilities.7:364 build/C/man7/capabilities.7:368 build/C/man7/capabilities.7:372 build/C/man7/capabilities.7:376 build/C/man7/capabilities.7:380 build/C/man7/capabilities.7:407 build/C/man7/capabilities.7:412 build/C/man7/capabilities.7:417 build/C/man7/capabilities.7:420 build/C/man7/capabilities.7:423 build/C/man7/capabilities.7:432 build/C/man7/capabilities.7:436 build/C/man7/capabilities.7:472 build/C/man7/capabilities.7:474 build/C/man7/capabilities.7:478 build/C/man7/capabilities.7:480 build/C/man7/capabilities.7:483 build/C/man7/capabilities.7:487 build/C/man7/capabilities.7:489 build/C/man7/capabilities.7:491 build/C/man7/capabilities.7:493 build/C/man7/capabilities.7:502 build/C/man7/capabilities.7:509 build/C/man7/capabilities.7:514 build/C/man7/capabilities.7:724 build/C/man7/capabilities.7:732 build/C/man7/capabilities.7:1039 build/C/man7/capabilities.7:1044 build/C/man7/cpuset.7:539 build/C/man7/cpuset.7:544 build/C/man7/cpuset.7:549 build/C/man7/cpuset.7:725 build/C/man7/cpuset.7:729 build/C/man7/cpuset.7:926 build/C/man7/cpuset.7:929 build/C/man7/cpuset.7:933 build/C/man7/cpuset.7:937 build/C/man7/cpuset.7:941 build/C/man7/credentials.7:123 build/C/man7/credentials.7:129 build/C/man7/credentials.7:141 build/C/man7/credentials.7:163 build/C/man7/credentials.7:180 build/C/man7/credentials.7:212 build/C/man7/credentials.7:215 build/C/man7/credentials.7:225 build/C/man7/credentials.7:228
671 #: build/C/man7/capabilities.7:104
673 "Bypass permission checks on operations that normally require the file system "
674 "UID of the process to match the UID of the file (e.g., B<chmod>(2), "
675 "B<utime>(2)), excluding those operations covered by B<CAP_DAC_OVERRIDE> and "
676 "B<CAP_DAC_READ_SEARCH>;"
680 #: build/C/man7/capabilities.7:108
681 msgid "set extended file attributes (see B<chattr>(1)) on arbitrary files;"
685 #: build/C/man7/capabilities.7:110
686 msgid "set Access Control Lists (ACLs) on arbitrary files;"
690 #: build/C/man7/capabilities.7:112
691 msgid "ignore directory sticky bit on file deletion;"
695 #: build/C/man7/capabilities.7:119
696 msgid "specify B<O_NOATIME> for arbitrary files in B<open>(2) and B<fcntl>(2)."
700 #: build/C/man7/capabilities.7:121
702 msgid "B<CAP_FSETID>"
706 #: build/C/man7/capabilities.7:127
708 "Don't clear set-user-ID and set-group-ID permission bits when a file is "
709 "modified; set the set-group-ID bit for a file whose GID does not match the "
710 "file system or any of the supplementary GIDs of the calling process."
714 #: build/C/man7/capabilities.7:127
716 msgid "B<CAP_IPC_LOCK>"
719 #. FIXME As at Linux 3.2, there are some strange uses of this capability
720 #. in other places; they probably should be replaced with something else.
722 #: build/C/man7/capabilities.7:136
723 msgid "Lock memory (B<mlock>(2), B<mlockall>(2), B<mmap>(2), B<shmctl>(2))."
727 #: build/C/man7/capabilities.7:136
729 msgid "B<CAP_IPC_OWNER>"
733 #: build/C/man7/capabilities.7:139
734 msgid "Bypass permission checks for operations on System V IPC objects."
738 #: build/C/man7/capabilities.7:139
743 #. FIXME CAP_KILL also has an effect for threads + setting child
744 #. termination signal to other than SIGCHLD: without this
745 #. capability, the termination signal reverts to SIGCHLD
746 #. if the child does an exec(). What is the rationale
749 #: build/C/man7/capabilities.7:152
751 "Bypass permission checks for sending signals (see B<kill>(2)). This "
752 "includes use of the B<ioctl>(2) B<KDSIGACCEPT> operation."
756 #: build/C/man7/capabilities.7:152
758 msgid "B<CAP_LEASE> (since Linux 2.4)"
762 #: build/C/man7/capabilities.7:156
763 msgid "Establish leases on arbitrary files (see B<fcntl>(2))."
767 #: build/C/man7/capabilities.7:156
769 msgid "B<CAP_LINUX_IMMUTABLE>"
772 #. These attributes are now available on ext2, ext3, Reiserfs, XFS, JFS
774 #: build/C/man7/capabilities.7:165
776 "Set the B<FS_APPEND_FL> and B<FS_IMMUTABLE_FL> i-node flags (see "
781 #: build/C/man7/capabilities.7:165
783 msgid "B<CAP_MAC_ADMIN> (since Linux 2.6.25)"
787 #: build/C/man7/capabilities.7:169
789 "Override Mandatory Access Control (MAC). Implemented for the Smack Linux "
790 "Security Module (LSM)."
794 #: build/C/man7/capabilities.7:169
796 msgid "B<CAP_MAC_OVERRIDE> (since Linux 2.6.25)"
800 #: build/C/man7/capabilities.7:173
801 msgid "Allow MAC configuration or state changes. Implemented for the Smack LSM."
805 #: build/C/man7/capabilities.7:173
807 msgid "B<CAP_MKNOD> (since Linux 2.4)"
811 #: build/C/man7/capabilities.7:177
812 msgid "Create special files using B<mknod>(2)."
816 #: build/C/man7/capabilities.7:177
818 msgid "B<CAP_NET_ADMIN>"
822 #: build/C/man7/capabilities.7:180
823 msgid "Perform various network-related operations:"
827 #: build/C/man7/capabilities.7:184
828 msgid "interface configuration;"
832 #: build/C/man7/capabilities.7:186
833 msgid "administration of IP firewall, masquerading, and accounting"
837 #: build/C/man7/capabilities.7:188
838 msgid "modify routing tables;"
842 #: build/C/man7/capabilities.7:190
843 msgid "bind to any address for transparent proxying;"
847 #: build/C/man7/capabilities.7:192
848 msgid "set type-of-service (TOS)"
852 #: build/C/man7/capabilities.7:194
853 msgid "clear driver statistics;"
857 #: build/C/man7/capabilities.7:196
858 msgid "set promiscuous mode;"
862 #: build/C/man7/capabilities.7:198
863 msgid "enabling multicasting;"
867 #: build/C/man7/capabilities.7:209
869 "use B<setsockopt>(2) to set the following socket options: B<SO_DEBUG>, "
870 "B<SO_MARK>, B<SO_PRIORITY> (for a priority outside the range 0 to 6), "
871 "B<SO_RCVBUFFORCE>, and B<SO_SNDBUFFORCE>."
875 #: build/C/man7/capabilities.7:211
877 msgid "B<CAP_NET_BIND_SERVICE>"
881 #: build/C/man7/capabilities.7:215
883 "Bind a socket to Internet domain privileged ports (port numbers less than "
888 #: build/C/man7/capabilities.7:215
890 msgid "B<CAP_NET_BROADCAST>"
894 #: build/C/man7/capabilities.7:218
895 msgid "(Unused) Make socket broadcasts, and listen to multicasts."
899 #: build/C/man7/capabilities.7:218
901 msgid "B<CAP_NET_RAW>"
905 #: build/C/man7/capabilities.7:224
906 msgid "use RAW and PACKET sockets;"
910 #: build/C/man7/capabilities.7:226
911 msgid "bind to any address for transparent proxying."
915 #: build/C/man7/capabilities.7:229
917 msgid "B<CAP_SETGID>"
921 #: build/C/man7/capabilities.7:233
923 "Make arbitrary manipulations of process GIDs and supplementary GID list; "
924 "forge GID when passing socket credentials via UNIX domain sockets."
928 #: build/C/man7/capabilities.7:233
930 msgid "B<CAP_SETFCAP> (since Linux 2.6.24)"
934 #: build/C/man7/capabilities.7:236
935 msgid "Set file capabilities."
939 #: build/C/man7/capabilities.7:236
941 msgid "B<CAP_SETPCAP>"
945 #: build/C/man7/capabilities.7:247
947 "If file capabilities are not supported: grant or remove any capability in "
948 "the caller's permitted capability set to or from any other process. (This "
949 "property of B<CAP_SETPCAP> is not available when the kernel is configured to "
950 "support file capabilities, since B<CAP_SETPCAP> has entirely different "
951 "semantics for such kernels.)"
955 #: build/C/man7/capabilities.7:257
957 "If file capabilities are supported: add any capability from the calling "
958 "thread's bounding set to its inheritable set; drop capabilities from the "
959 "bounding set (via B<prctl>(2) B<PR_CAPBSET_DROP>); make changes to the "
960 "I<securebits> flags."
964 #: build/C/man7/capabilities.7:257
966 msgid "B<CAP_SETUID>"
969 #. FIXME CAP_SETUID also an effect in exec(); document this.
971 #: build/C/man7/capabilities.7:266
973 "Make arbitrary manipulations of process UIDs (B<setuid>(2), B<setreuid>(2), "
974 "B<setresuid>(2), B<setfsuid>(2)); make forged UID when passing socket "
975 "credentials via UNIX domain sockets."
979 #: build/C/man7/capabilities.7:266
981 msgid "B<CAP_SYS_ADMIN>"
985 #: build/C/man7/capabilities.7:280
987 "Perform a range of system administration operations including: "
988 "B<quotactl>(2), B<mount>(2), B<umount>(2), B<swapon>(2), B<swapoff>(2), "
989 "B<sethostname>(2), and B<setdomainname>(2);"
993 #: build/C/man7/capabilities.7:286
995 "perform privileged B<syslog>(2) operations (since Linux 2.6.37, "
996 "B<CAP_SYSLOG> should be used to permit such operations);"
1000 #: build/C/man7/capabilities.7:291
1001 msgid "perform B<VM86_REQUEST_IRQ> B<vm86>(2) command;"
1005 #: build/C/man7/capabilities.7:297
1007 "perform B<IPC_SET> and B<IPC_RMID> operations on arbitrary System V IPC "
1012 #: build/C/man7/capabilities.7:304
1014 "perform operations on I<trusted> and I<security> Extended Attributes (see "
1019 #: build/C/man7/capabilities.7:307
1020 msgid "use B<lookup_dcookie>(2);"
1024 #: build/C/man7/capabilities.7:315
1026 "use B<ioprio_set>(2) to assign B<IOPRIO_CLASS_RT> and (before Linux 2.6.25) "
1027 "B<IOPRIO_CLASS_IDLE> I/O scheduling classes;"
1031 #: build/C/man7/capabilities.7:317
1032 msgid "forge UID when passing socket credentials;"
1036 #: build/C/man7/capabilities.7:326
1038 "exceed I</proc/sys/fs/file-max>, the system-wide limit on the number of open "
1039 "files, in system calls that open files (e.g., B<accept>(2), B<execve>(2), "
1040 "B<open>(2), B<pipe>(2));"
1044 #: build/C/man7/capabilities.7:333
1046 "employ B<CLONE_*> flags that create new namespaces with B<clone>(2) and "
1051 #: build/C/man7/capabilities.7:336
1052 msgid "call B<perf_event_open>(2);"
1056 #: build/C/man7/capabilities.7:338
1061 #: build/C/man7/capabilities.7:343
1062 msgid "access privileged I<perf> event information; B<setns>(2);"
1066 #: build/C/man7/capabilities.7:346
1067 msgid "call B<fanotify_init>(2);"
1071 #: build/C/man7/capabilities.7:353
1072 msgid "perform B<KEYCTL_CHOWN> and B<KEYCTL_SETPERM> B<keyctl>(2) operations;"
1076 #: build/C/man7/capabilities.7:358
1077 msgid "perform B<madvise>(2) B<MADV_HWPOISON> operation;"
1081 #: build/C/man7/capabilities.7:364
1083 "employ the B<TIOCSTI> B<ioctl>(2) to insert characters into the input queue "
1084 "of a terminal other than the caller's controlling terminal."
1088 #: build/C/man7/capabilities.7:368
1089 msgid "employ the obsolete B<nfsservctl>(2); system call;"
1093 #: build/C/man7/capabilities.7:372
1094 msgid "employ the obsolete B<bdflush>(2) system call;"
1098 #: build/C/man7/capabilities.7:376
1099 msgid "perform various privileged block-device B<ioctl>(2) operations;"
1103 #: build/C/man7/capabilities.7:380
1104 msgid "perform various privileged file-system B<ioctl>(2) operations;"
1108 #: build/C/man7/capabilities.7:382
1109 msgid "perform administrative operations on many device drivers."
1113 #: build/C/man7/capabilities.7:384
1115 msgid "B<CAP_SYS_BOOT>"
1119 #: build/C/man7/capabilities.7:390
1120 msgid "Use B<reboot>(2) and B<kexec_load>(2)."
1124 #: build/C/man7/capabilities.7:390
1126 msgid "B<CAP_SYS_CHROOT>"
1130 #: build/C/man7/capabilities.7:394
1131 msgid "Use B<chroot>(2)."
1135 #: build/C/man7/capabilities.7:394
1137 msgid "B<CAP_SYS_MODULE>"
1141 #: build/C/man7/capabilities.7:403
1143 "Load and unload kernel modules (see B<init_module>(2) and "
1144 "B<delete_module>(2)); in kernels before 2.6.25: drop capabilities from the "
1145 "system-wide capability bounding set."
1149 #: build/C/man7/capabilities.7:403
1151 msgid "B<CAP_SYS_NICE>"
1155 #: build/C/man7/capabilities.7:412
1157 "Raise process nice value (B<nice>(2), B<setpriority>(2)) and change the "
1158 "nice value for arbitrary processes;"
1162 #: build/C/man7/capabilities.7:417
1164 "set real-time scheduling policies for calling process, and set scheduling "
1165 "policies and priorities for arbitrary processes (B<sched_setscheduler>(2), "
1166 "B<sched_setparam>(2));"
1170 #: build/C/man7/capabilities.7:420
1171 msgid "set CPU affinity for arbitrary processes (B<sched_setaffinity>(2));"
1175 #: build/C/man7/capabilities.7:423
1177 "set I/O scheduling class and priority for arbitrary processes "
1178 "(B<ioprio_set>(2));"
1181 #. FIXME CAP_SYS_NICE also has the following effect for
1182 #. migrate_pages(2):
1183 #. do_migrate_pages(mm, &old, &new,
1184 #. capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
1186 #: build/C/man7/capabilities.7:432
1188 "apply B<migrate_pages>(2) to arbitrary processes and allow processes to be "
1189 "migrated to arbitrary nodes;"
1193 #: build/C/man7/capabilities.7:436
1194 msgid "apply B<move_pages>(2) to arbitrary processes;"
1198 #: build/C/man7/capabilities.7:443
1199 msgid "use the B<MPOL_MF_MOVE_ALL> flag with B<mbind>(2) and B<move_pages>(2)."
1203 #: build/C/man7/capabilities.7:445
1205 msgid "B<CAP_SYS_PACCT>"
1209 #: build/C/man7/capabilities.7:449
1210 msgid "Use B<acct>(2)."
1214 #: build/C/man7/capabilities.7:449
1216 msgid "B<CAP_SYS_PTRACE>"
1220 #: build/C/man7/capabilities.7:456
1222 "Trace arbitrary processes using B<ptrace>(2); apply B<get_robust_list>(2) "
1223 "to arbitrary processes."
1227 #: build/C/man7/capabilities.7:456
1229 msgid "B<CAP_SYS_RAWIO>"
1233 #: build/C/man7/capabilities.7:468
1235 "Perform I/O port operations (B<iopl>(2) and B<ioperm>(2)); access "
1236 "I</proc/kcore>; employ the B<FIBMAP> B<ioctl>(2) operation."
1240 #: build/C/man7/capabilities.7:468
1242 msgid "B<CAP_SYS_RESOURCE>"
1246 #: build/C/man7/capabilities.7:474
1247 msgid "Use reserved space on ext2 file systems;"
1251 #: build/C/man7/capabilities.7:478
1252 msgid "make B<ioctl>(2) calls controlling ext3 journaling;"
1256 #: build/C/man7/capabilities.7:480
1257 msgid "override disk quota limits;"
1261 #: build/C/man7/capabilities.7:483
1262 msgid "increase resource limits (see B<setrlimit>(2));"
1266 #: build/C/man7/capabilities.7:487
1267 msgid "override B<RLIMIT_NPROC> resource limit;"
1271 #: build/C/man7/capabilities.7:489
1272 msgid "override maximum number of consoles on console allocation;"
1276 #: build/C/man7/capabilities.7:491
1277 msgid "override maximum number of keymaps;"
1281 #: build/C/man7/capabilities.7:493
1282 msgid "allow more than 64hz interrupts from the real-time clock;"
1286 #: build/C/man7/capabilities.7:502
1288 "raise I<msg_qbytes> limit for a System V message queue above the limit in "
1289 "I</proc/sys/kernel/msgmnb> (see B<msgop>(2) and B<msgctl>(2));"
1293 #: build/C/man7/capabilities.7:509
1295 "override the I</proc/sys/fs/pipe-size-max> limit when setting the capacity "
1296 "of a pipe using the B<F_SETPIPE_SZ> B<fcntl>(2) command."
1300 #: build/C/man7/capabilities.7:514
1302 "use B<F_SETPIPE_SZ> to increase the capacity of a pipe above the limit "
1303 "specified by I</proc/sys/fs/pipe-max-size>;"
1307 #: build/C/man7/capabilities.7:519
1309 "override I</proc/sys/fs/mqueue/queues_max> limit when creating POSIX message "
1310 "queues (see B<mq_overview>(7))."
1314 #: build/C/man7/capabilities.7:521
1316 msgid "B<CAP_SYS_TIME>"
1320 #: build/C/man7/capabilities.7:528
1322 "Set system clock (B<settimeofday>(2), B<stime>(2), B<adjtimex>(2)); set "
1323 "real-time (hardware) clock."
1327 #: build/C/man7/capabilities.7:528
1329 msgid "B<CAP_SYS_TTY_CONFIG>"
1333 #: build/C/man7/capabilities.7:535
1335 "Use B<vhangup>(2); employ various privileged B<ioctl>(2) operations on "
1336 "virtual terminals."
1340 #: build/C/man7/capabilities.7:535
1342 msgid "B<CAP_SYSLOG> (since Linux 2.6.37)"
1346 #: build/C/man7/capabilities.7:543
1348 "Perform privileged B<syslog>(2) operations. See B<syslog>(2) for "
1349 "information on which operations require privilege."
1353 #: build/C/man7/capabilities.7:543
1355 msgid "B<CAP_WAKE_ALARM> (since Linux 3.0)"
1359 #: build/C/man7/capabilities.7:551
1361 "Trigger something that will wake up the system (set B<CLOCK_REALTIME_ALARM> "
1362 "and B<CLOCK_BOOTTIME_ALARM> timers)."
1366 #: build/C/man7/capabilities.7:551
1368 msgid "Past and Current Implementation"
1372 #: build/C/man7/capabilities.7:553
1373 msgid "A full implementation of capabilities requires that:"
1377 #: build/C/man7/capabilities.7:553 build/C/man7/capabilities.7:696 build/C/man7/capabilities.7:843 build/C/man7/capabilities.7:896
1383 #: build/C/man7/capabilities.7:557
1385 "For all privileged operations, the kernel must check whether the thread has "
1386 "the required capability in its effective set."
1390 #: build/C/man7/capabilities.7:557 build/C/man7/capabilities.7:701 build/C/man7/capabilities.7:849 build/C/man7/capabilities.7:902
1396 #: build/C/man7/capabilities.7:560
1398 "The kernel must provide system calls allowing a thread's capability sets to "
1399 "be changed and retrieved."
1403 #: build/C/man7/capabilities.7:560 build/C/man7/capabilities.7:852 build/C/man7/capabilities.7:906
1409 #: build/C/man7/capabilities.7:563
1411 "The file system must support attaching capabilities to an executable file, "
1412 "so that a process gains those capabilities when the file is executed."
1416 #: build/C/man7/capabilities.7:567
1418 "Before kernel 2.6.24, only the first two of these requirements are met; "
1419 "since kernel 2.6.24, all three requirements are met."
1423 #: build/C/man7/capabilities.7:567
1425 msgid "Thread Capability Sets"
1429 #: build/C/man7/capabilities.7:570
1431 "Each thread has three capability sets containing zero or more of the above "
1436 #: build/C/man7/capabilities.7:570
1438 msgid "I<Permitted>:"
1442 #: build/C/man7/capabilities.7:578
1444 "This is a limiting superset for the effective capabilities that the thread "
1445 "may assume. It is also a limiting superset for the capabilities that may be "
1446 "added to the inheritable set by a thread that does not have the "
1447 "B<CAP_SETPCAP> capability in its effective set."
1451 #: build/C/man7/capabilities.7:584
1453 "If a thread drops a capability from its permitted set, it can never "
1454 "reacquire that capability (unless it B<execve>(2)s either a set-user-ID-root "
1455 "program, or a program whose associated file capabilities grant that "
1460 #: build/C/man7/capabilities.7:584
1462 msgid "I<Inheritable>:"
1466 #: build/C/man7/capabilities.7:591
1468 "This is a set of capabilities preserved across an B<execve>(2). It provides "
1469 "a mechanism for a process to assign capabilities to the permitted set of the "
1470 "new program during an B<execve>(2)."
1474 #: build/C/man7/capabilities.7:591 build/C/man7/capabilities.7:633
1476 msgid "I<Effective>:"
1480 #: build/C/man7/capabilities.7:595
1482 "This is the set of capabilities used by the kernel to perform permission "
1483 "checks for the thread."
1487 #: build/C/man7/capabilities.7:601
1489 "A child created via B<fork>(2) inherits copies of its parent's capability "
1490 "sets. See below for a discussion of the treatment of capabilities during "
1495 #: build/C/man7/capabilities.7:606
1497 "Using B<capset>(2), a thread may manipulate its own capability sets (see "
1502 #: build/C/man7/capabilities.7:606
1504 msgid "File Capabilities"
1508 #: build/C/man7/capabilities.7:621
1510 "Since kernel 2.6.24, the kernel supports associating capability sets with an "
1511 "executable file using B<setcap>(8). The file capability sets are stored in "
1512 "an extended attribute (see B<setxattr>(2)) named I<security.capability>. "
1513 "Writing to this extended attribute requires the B<CAP_SETFCAP> capability. "
1514 "The file capability sets, in conjunction with the capability sets of the "
1515 "thread, determine the capabilities of a thread after an B<execve>(2)."
1519 #: build/C/man7/capabilities.7:623
1520 msgid "The three file capability sets are:"
1524 #: build/C/man7/capabilities.7:623
1526 msgid "I<Permitted> (formerly known as I<forced>):"
1530 #: build/C/man7/capabilities.7:627
1532 "These capabilities are automatically permitted to the thread, regardless of "
1533 "the thread's inheritable capabilities."
1537 #: build/C/man7/capabilities.7:627
1539 msgid "I<Inheritable> (formerly known as I<allowed>):"
1543 #: build/C/man7/capabilities.7:633
1545 "This set is ANDed with the thread's inheritable set to determine which "
1546 "inheritable capabilities are enabled in the permitted set of the thread "
1547 "after the B<execve>(2)."
1551 #: build/C/man7/capabilities.7:643
1553 "This is not a set, but rather just a single bit. If this bit is set, then "
1554 "during an B<execve>(2) all of the new permitted capabilities for the thread "
1555 "are also raised in the effective set. If this bit is not set, then after an "
1556 "B<execve>(2), none of the new permitted capabilities is in the new effective "
1561 #: build/C/man7/capabilities.7:659
1563 "Enabling the file effective capability bit implies that any file permitted "
1564 "or inheritable capability that causes a thread to acquire the corresponding "
1565 "permitted capability during an B<execve>(2) (see the transformation rules "
1566 "described below) will also acquire that capability in its effective set. "
1567 "Therefore, when assigning capabilities to a file (B<setcap>(8), "
1568 "B<cap_set_file>(3), B<cap_set_fd>(3)), if we specify the effective flag as "
1569 "being enabled for any capability, then the effective flag must also be "
1570 "specified as enabled for all other capabilities for which the corresponding "
1571 "permitted or inheritable flags is enabled."
1575 #: build/C/man7/capabilities.7:659
1577 msgid "Transformation of Capabilities During execve()"
1581 #: build/C/man7/capabilities.7:665
1583 "During an B<execve>(2), the kernel calculates the new capabilities of the "
1584 "process using the following algorithm:"
1588 #: build/C/man7/capabilities.7:670
1591 "P'(permitted) = (P(inheritable) & F(inheritable)) |\n"
1592 " (F(permitted) & cap_bset)\n"
1596 #: build/C/man7/capabilities.7:672
1598 msgid "P'(effective) = F(effective) ? P'(permitted) : 0\n"
1602 #: build/C/man7/capabilities.7:674
1604 msgid "P'(inheritable) = P(inheritable) [i.e., unchanged]\n"
1608 #: build/C/man7/capabilities.7:678
1613 #: build/C/man7/capabilities.7:679
1619 #: build/C/man7/capabilities.7:682
1620 msgid "denotes the value of a thread capability set before the B<execve>(2)"
1624 #: build/C/man7/capabilities.7:682
1630 #: build/C/man7/capabilities.7:685
1631 msgid "denotes the value of a capability set after the B<execve>(2)"
1635 #: build/C/man7/capabilities.7:685
1641 #: build/C/man7/capabilities.7:687
1642 msgid "denotes a file capability set"
1646 #: build/C/man7/capabilities.7:687
1652 #: build/C/man7/capabilities.7:689
1653 msgid "is the value of the capability bounding set (described below)."
1657 #: build/C/man7/capabilities.7:691
1659 msgid "Capabilities and execution of programs by root"
1663 #: build/C/man7/capabilities.7:696
1665 "In order to provide an all-powerful I<root> using capability sets, during an "
1670 #: build/C/man7/capabilities.7:701
1672 "If a set-user-ID-root program is being executed, or the real user ID of the "
1673 "process is 0 (root) then the file inheritable and permitted sets are "
1674 "defined to be all ones (i.e., all capabilities enabled)."
1678 #: build/C/man7/capabilities.7:704
1680 "If a set-user-ID-root program is being executed, then the file effective bit "
1681 "is defined to be one (enabled)."
1684 #. If a process with real UID 0, and nonzero effective UID does an
1685 #. exec(), then it gets all capabilities in its
1686 #. permitted set, and no effective capabilities
1688 #: build/C/man7/capabilities.7:719
1690 "The upshot of the above rules, combined with the capabilities "
1691 "transformations described above, is that when a process B<execve>(2)s a "
1692 "set-user-ID-root program, or when a process with an effective UID of 0 "
1693 "B<execve>(2)s a program, it gains all capabilities in its permitted and "
1694 "effective capability sets, except those masked out by the capability "
1695 "bounding set. This provides semantics that are the same as those provided "
1696 "by traditional UNIX systems."
1700 #: build/C/man7/capabilities.7:719
1702 msgid "Capability bounding set"
1706 #: build/C/man7/capabilities.7:724
1708 "The capability bounding set is a security mechanism that can be used to "
1709 "limit the capabilities that can be gained during an B<execve>(2). The "
1710 "bounding set is used in the following ways:"
1714 #: build/C/man7/capabilities.7:732
1716 "During an B<execve>(2), the capability bounding set is ANDed with the file "
1717 "permitted capability set, and the result of this operation is assigned to "
1718 "the thread's permitted capability set. The capability bounding set thus "
1719 "places a limit on the permitted capabilities that may be granted by an "
1724 #: build/C/man7/capabilities.7:744
1726 "(Since Linux 2.6.25) The capability bounding set acts as a limiting "
1727 "superset for the capabilities that a thread can add to its inheritable set "
1728 "using B<capset>(2). This means that if a capability is not in the bounding "
1729 "set, then a thread can't add this capability to its inheritable set, even if "
1730 "it was in its permitted capabilities, and thereby cannot have this "
1731 "capability preserved in its permitted set when it B<execve>(2)s a file that "
1732 "has the capability in its inheritable set."
1736 #: build/C/man7/capabilities.7:751
1738 "Note that the bounding set masks the file permitted capabilities, but not "
1739 "the inherited capabilities. If a thread maintains a capability in its "
1740 "inherited set that is not in its bounding set, then it can still gain that "
1741 "capability in its permitted set by executing a file that has the capability "
1742 "in its inherited set."
1746 #: build/C/man7/capabilities.7:754
1748 "Depending on the kernel version, the capability bounding set is either a "
1749 "system-wide attribute, or a per-process attribute."
1753 #: build/C/man7/capabilities.7:756
1754 msgid "B<Capability bounding set prior to Linux 2.6.25>"
1758 #: build/C/man7/capabilities.7:764
1760 "In kernels before 2.6.25, the capability bounding set is a system-wide "
1761 "attribute that affects all threads on the system. The bounding set is "
1762 "accessible via the file I</proc/sys/kernel/cap-bound>. (Confusingly, this "
1763 "bit mask parameter is expressed as a signed decimal number in "
1764 "I</proc/sys/kernel/cap-bound>.)"
1768 #: build/C/man7/capabilities.7:771
1770 "Only the B<init> process may set capabilities in the capability bounding "
1771 "set; other than that, the superuser (more precisely: programs with the "
1772 "B<CAP_SYS_MODULE> capability) may only clear capabilities from this set."
1776 #: build/C/man7/capabilities.7:780
1778 "On a standard system the capability bounding set always masks out the "
1779 "B<CAP_SETPCAP> capability. To remove this restriction (dangerous!), modify "
1780 "the definition of B<CAP_INIT_EFF_SET> in I<include/linux/capability.h> and "
1781 "rebuild the kernel."
1785 #: build/C/man7/capabilities.7:784
1787 "The system-wide capability bounding set feature was added to Linux starting "
1788 "with kernel version 2.2.11."
1792 #: build/C/man7/capabilities.7:786
1793 msgid "B<Capability bounding set from Linux 2.6.25 onward>"
1797 #: build/C/man7/capabilities.7:791
1799 "From Linux 2.6.25, the I<capability bounding set> is a per-thread "
1800 "attribute. (There is no longer a system-wide capability bounding set.)"
1804 #: build/C/man7/capabilities.7:796
1806 "The bounding set is inherited at B<fork>(2) from the thread's parent, and "
1807 "is preserved across an B<execve>(2)."
1811 #: build/C/man7/capabilities.7:809
1813 "A thread may remove capabilities from its capability bounding set using the "
1814 "B<prctl>(2) B<PR_CAPBSET_DROP> operation, provided it has the "
1815 "B<CAP_SETPCAP> capability. Once a capability has been dropped from the "
1816 "bounding set, it cannot be restored to that set. A thread can determine if "
1817 "a capability is in its bounding set using the B<prctl>(2) "
1818 "B<PR_CAPBSET_READ> operation."
1822 #: build/C/man7/capabilities.7:827
1824 "Removing capabilities from the bounding set is only supported if file "
1825 "capabilities are compiled into the kernel. In kernels before Linux 2.6.33, "
1826 "file capabilities were an optional feature configurable via the "
1827 "CONFIG_SECURITY_FILE_CAPABILITIES option. Since Linux 2.6.33, the "
1828 "configuration option has been removed and file capabilities are always part "
1829 "of the kernel. When file capabilities are compiled into the kernel, the "
1830 "B<init> process (the ancestor of all processes) begins with a full bounding "
1831 "set. If file capabilities are not compiled into the kernel, then B<init> "
1832 "begins with a full bounding set minus B<CAP_SETPCAP>, because this "
1833 "capability has a different meaning when there are no file capabilities."
1837 #: build/C/man7/capabilities.7:834
1839 "Removing a capability from the bounding set does not remove it from the "
1840 "thread's inherited set. However it does prevent the capability from being "
1841 "added back into the thread's inherited set in the future."
1845 #: build/C/man7/capabilities.7:834
1847 msgid "Effect of User ID Changes on Capabilities"
1851 #: build/C/man7/capabilities.7:843
1853 "To preserve the traditional semantics for transitions between 0 and nonzero "
1854 "user IDs, the kernel makes the following changes to a thread's capability "
1855 "sets on changes to the thread's real, effective, saved set, and file system "
1856 "user IDs (using B<setuid>(2), B<setresuid>(2), or similar):"
1860 #: build/C/man7/capabilities.7:849
1862 "If one or more of the real, effective or saved set user IDs was previously "
1863 "0, and as a result of the UID changes all of these IDs have a nonzero value, "
1864 "then all capabilities are cleared from the permitted and effective "
1869 #: build/C/man7/capabilities.7:852
1871 "If the effective user ID is changed from 0 to nonzero, then all capabilities "
1872 "are cleared from the effective set."
1876 #: build/C/man7/capabilities.7:855
1878 "If the effective user ID is changed from nonzero to 0, then the permitted "
1879 "set is copied to the effective set."
1883 #: build/C/man7/capabilities.7:855 build/C/man7/capabilities.7:910
1889 #: build/C/man7/capabilities.7:873
1891 "If the file system user ID is changed from 0 to nonzero (see B<setfsuid>(2)) "
1892 "then the following capabilities are cleared from the effective set: "
1893 "B<CAP_CHOWN>, B<CAP_DAC_OVERRIDE>, B<CAP_DAC_READ_SEARCH>, B<CAP_FOWNER>, "
1894 "B<CAP_FSETID>, B<CAP_LINUX_IMMUTABLE> (since Linux 2.2.30), "
1895 "B<CAP_MAC_OVERRIDE>, and B<CAP_MKNOD> (since Linux 2.2.30). If the file "
1896 "system UID is changed from nonzero to 0, then any of these capabilities that "
1897 "are enabled in the permitted set are enabled in the effective set."
1901 #: build/C/man7/capabilities.7:881
1903 "If a thread that has a 0 value for one or more of its user IDs wants to "
1904 "prevent its permitted capability set being cleared when it resets all of its "
1905 "user IDs to nonzero values, it can do so using the B<prctl>(2) "
1906 "B<PR_SET_KEEPCAPS> operation."
1910 #: build/C/man7/capabilities.7:881
1912 msgid "Programmatically adjusting capability sets"
1916 #: build/C/man7/capabilities.7:896
1918 "A thread can retrieve and change its capability sets using the B<capget>(2) "
1919 "and B<capset>(2) system calls. However, the use of B<cap_get_proc>(3) and "
1920 "B<cap_set_proc>(3), both provided in the I<libcap> package, is preferred for "
1921 "this purpose. The following rules govern changes to the thread capability "
1926 #: build/C/man7/capabilities.7:902
1928 "If the caller does not have the B<CAP_SETPCAP> capability, the new "
1929 "inheritable set must be a subset of the combination of the existing "
1930 "inheritable and permitted sets."
1934 #: build/C/man7/capabilities.7:906
1936 "(Since kernel 2.6.25) The new inheritable set must be a subset of the "
1937 "combination of the existing inheritable set and the capability bounding set."
1941 #: build/C/man7/capabilities.7:910
1943 "The new permitted set must be a subset of the existing permitted set (i.e., "
1944 "it is not possible to acquire permitted capabilities that the thread does "
1945 "not currently have)."
1949 #: build/C/man7/capabilities.7:912
1950 msgid "The new effective set must be a subset of the new permitted set."
1954 #: build/C/man7/capabilities.7:912
1956 msgid "The \"securebits\" flags: establishing a capabilities-only environment"
1959 #. For some background:
1960 #. see http://lwn.net/Articles/280279/ and
1961 #. http://article.gmane.org/gmane.linux.kernel.lsm/5476/
1963 #: build/C/man7/capabilities.7:923
1965 "Starting with kernel 2.6.26, and with a kernel in which file capabilities "
1966 "are enabled, Linux implements a set of per-thread I<securebits> flags that "
1967 "can be used to disable special handling of capabilities for UID 0 "
1968 "(I<root>). These flags are as follows:"
1972 #: build/C/man7/capabilities.7:923
1974 msgid "B<SECBIT_KEEP_CAPS>"
1978 #: build/C/man7/capabilities.7:935
1980 "Setting this flag allows a thread that has one or more 0 UIDs to retain its "
1981 "capabilities when it switches all of its UIDs to a nonzero value. If this "
1982 "flag is not set, then such a UID switch causes the thread to lose all "
1983 "capabilities. This flag is always cleared on an B<execve>(2). (This flag "
1984 "provides the same functionality as the older B<prctl>(2) B<PR_SET_KEEPCAPS> "
1989 #: build/C/man7/capabilities.7:935
1991 msgid "B<SECBIT_NO_SETUID_FIXUP>"
1995 #: build/C/man7/capabilities.7:942
1997 "Setting this flag stops the kernel from adjusting capability sets when the "
1998 "threads's effective and file system UIDs are switched between zero and "
1999 "nonzero values. (See the subsection I<Effect of User ID Changes on "
2004 #: build/C/man7/capabilities.7:942
2006 msgid "B<SECBIT_NOROOT>"
2010 #: build/C/man7/capabilities.7:950
2012 "If this bit is set, then the kernel does not grant capabilities when a "
2013 "set-user-ID-root program is executed, or when a process with an effective or "
2014 "real UID of 0 calls B<execve>(2). (See the subsection I<Capabilities and "
2015 "execution of programs by root>.)"
2019 #: build/C/man7/capabilities.7:960
2021 "Each of the above \"base\" flags has a companion \"locked\" flag. Setting "
2022 "any of the \"locked\" flags is irreversible, and has the effect of "
2023 "preventing further changes to the corresponding \"base\" flag. The locked "
2024 "flags are: B<SECBIT_KEEP_CAPS_LOCKED>, B<SECBIT_NO_SETUID_FIXUP_LOCKED>, and "
2025 "B<SECBIT_NOROOT_LOCKED>."
2029 #: build/C/man7/capabilities.7:972
2031 "The I<securebits> flags can be modified and retrieved using the B<prctl>(2) "
2032 "B<PR_SET_SECUREBITS> and B<PR_GET_SECUREBITS> operations. The "
2033 "B<CAP_SETPCAP> capability is required to modify the flags."
2037 #: build/C/man7/capabilities.7:981
2039 "The I<securebits> flags are inherited by child processes. During an "
2040 "B<execve>(2), all of the flags are preserved, except B<SECBIT_KEEP_CAPS> "
2041 "which is always cleared."
2045 #: build/C/man7/capabilities.7:986
2047 "An application can use the following call to lock itself, and all of its "
2048 "descendants, into an environment where the only way of gaining capabilities "
2049 "is by executing a program with associated file capabilities:"
2053 #: build/C/man7/capabilities.7:995
2056 "prctl(PR_SET_SECUREBITS,\n"
2057 " SECBIT_KEEP_CAPS_LOCKED |\n"
2058 " SECBIT_NO_SETUID_FIXUP |\n"
2059 " SECBIT_NO_SETUID_FIXUP_LOCKED |\n"
2060 " SECBIT_NOROOT |\n"
2061 " SECBIT_NOROOT_LOCKED);\n"
2065 #: build/C/man7/capabilities.7:1002
2067 "No standards govern capabilities, but the Linux capability implementation is "
2068 "based on the withdrawn POSIX.1e draft standard; see "
2069 "I<http://wt.xpilot.org/publications/posix.1e/>."
2073 #: build/C/man7/capabilities.7:1006
2075 "Since kernel 2.5.27, capabilities are an optional kernel component, and can "
2076 "be enabled/disabled via the CONFIG_SECURITY_CAPABILITIES kernel "
2077 "configuration option."
2081 #: build/C/man7/capabilities.7:1013
2083 "The I</proc/PID/task/TID/status> file can be used to view the capability "
2084 "sets of a thread. The I</proc/PID/status> file shows the capability sets of "
2085 "a process's main thread."
2089 #: build/C/man7/capabilities.7:1028
2091 "The I<libcap> package provides a suite of routines for setting and getting "
2092 "capabilities that is more comfortable and less likely to change than the "
2093 "interface provided by B<capset>(2) and B<capget>(2). This package also "
2094 "provides the B<setcap>(8) and B<getcap>(8) programs. It can be found at"
2098 #: build/C/man7/capabilities.7:1030
2099 msgid "I<http://www.kernel.org/pub/linux/libs/security/linux-privs>."
2103 #: build/C/man7/capabilities.7:1039
2105 "Before kernel 2.6.24, and since kernel 2.6.24 if file capabilities are not "
2106 "enabled, a thread with the B<CAP_SETPCAP> capability can manipulate the "
2107 "capabilities of threads other than itself. However, this is only "
2108 "theoretically possible, since no thread ever has B<CAP_SETPCAP> in either of "
2113 #: build/C/man7/capabilities.7:1044
2115 "In the pre-2.6.25 implementation the system-wide capability bounding set, "
2116 "I</proc/sys/kernel/cap-bound>, always masks out this capability, and this "
2117 "can not be changed without modifying the kernel source and rebuilding."
2121 #: build/C/man7/capabilities.7:1050
2123 "If file capabilities are disabled in the current implementation, then "
2124 "B<init> starts out with this capability removed from its per-process "
2125 "bounding set, and that bounding set is inherited by all other processes "
2126 "created on the system."
2130 #: build/C/man7/capabilities.7:1067
2132 "B<capget>(2), B<prctl>(2), B<setfsuid>(2), B<cap_clear>(3), "
2133 "B<cap_copy_ext>(3), B<cap_from_text>(3), B<cap_get_file>(3), "
2134 "B<cap_get_proc>(3), B<cap_init>(3), B<capgetp>(3), B<capsetp>(3), "
2135 "B<libcap>(3), B<credentials>(7), B<pthreads>(7), B<getcap>(8), B<setcap>(8)"
2139 #: build/C/man7/capabilities.7:1071
2141 "Comments on the purposes of various capabilities in "
2142 "I<include/linux/capability.h> in the kernel source"
2146 #: build/C/man2/capget.2:11
2152 #: build/C/man2/capget.2:11
2158 #: build/C/man2/capget.2:14
2159 msgid "capget, capset - set/get capabilities of thread(s)"
2163 #: build/C/man2/capget.2:16
2164 msgid "B<#include E<lt>sys/capability.hE<gt>>"
2168 #: build/C/man2/capget.2:18
2169 msgid "B<int capget(cap_user_header_t >I<hdrp>B<, cap_user_data_t >I<datap>B<);>"
2173 #: build/C/man2/capget.2:20
2175 "B<int capset(cap_user_header_t >I<hdrp>B<, const cap_user_data_t "
2180 #: build/C/man2/capget.2:31
2182 "As of Linux 2.2, the power of the superuser (root) has been partitioned into "
2183 "a set of discrete capabilities. Each thread has a set of effective "
2184 "capabilities identifying which capabilities (if any) it may currently "
2185 "exercise. Each thread also has a set of inheritable capabilities that may "
2186 "be passed through an B<execve>(2) call, and a set of permitted capabilities "
2187 "that it can make effective or inheritable."
2191 #: build/C/man2/capget.2:40
2193 "These two functions are the raw kernel interface for getting and setting "
2194 "thread capabilities. Not only are these system calls specific to Linux, but "
2195 "the kernel API is likely to change and use of these functions (in particular "
2196 "the format of the I<cap_user_*_t> types) is subject to extension with each "
2197 "kernel revision, but old programs will keep working."
2201 #: build/C/man2/capget.2:51
2203 "The portable interfaces are B<cap_set_proc>(3) and B<cap_get_proc>(3); if "
2204 "possible you should use those interfaces in applications. If you wish to "
2205 "use the Linux extensions in applications, you should use the easier-to-use "
2206 "interfaces B<capsetp>(3) and B<capgetp>(3)."
2210 #: build/C/man2/capget.2:51
2212 msgid "Current details"
2216 #: build/C/man2/capget.2:54
2218 "Now that you have been warned, some current kernel details. The structures "
2219 "are defined as follows."
2223 #: build/C/man2/capget.2:59
2226 "#define _LINUX_CAPABILITY_VERSION_1 0x19980330\n"
2227 "#define _LINUX_CAPABILITY_U32S_1 1\n"
2231 #: build/C/man2/capget.2:62
2234 "#define _LINUX_CAPABILITY_VERSION_2 0x20071026\n"
2235 "#define _LINUX_CAPABILITY_U32S_2 2\n"
2239 #: build/C/man2/capget.2:67
2242 "typedef struct __user_cap_header_struct {\n"
2245 "} *cap_user_header_t;\n"
2249 #: build/C/man2/capget.2:73
2252 "typedef struct __user_cap_data_struct {\n"
2253 " __u32 effective;\n"
2254 " __u32 permitted;\n"
2255 " __u32 inheritable;\n"
2256 "} *cap_user_data_t;\n"
2260 #: build/C/man2/capget.2:88
2262 "I<effective, permitted, inheritable> are bitmasks of the capabilities "
2263 "defined in I<capability(7).> Note the I<CAP_*> values are bit indexes and "
2264 "need to be bit-shifted before ORing into the bit fields. To define the "
2265 "structures for passing to the system call you have to use the I<struct "
2266 "__user_cap_header_struct> and I<struct __user_cap_data_struct> names because "
2267 "the typedefs are only pointers."
2271 #: build/C/man2/capget.2:100
2273 "Kernels prior to 2.6.25 prefer 32-bit capabilities with version "
2274 "B<_LINUX_CAPABILITY_VERSION_1>, and kernels 2.6.25+ prefer 64-bit "
2275 "capabilities with version B<_LINUX_CAPABILITY_VERSION_2>. Note, 64-bit "
2276 "capabilities use I<datap>[0] and I<datap>[1], whereas 32-bit capabilities "
2277 "use only I<datap>[0]."
2281 #: build/C/man2/capget.2:104
2283 "Another change affecting the behavior of these system calls is kernel "
2284 "support for file capabilities (VFS capability support). This support is "
2285 "currently a compile time option (added in kernel 2.6.24)."
2289 #: build/C/man2/capget.2:111
2291 "For B<capget>() calls, one can probe the capabilities of any process by "
2292 "specifying its process ID with the I<hdrp-E<gt>pid> field value."
2296 #: build/C/man2/capget.2:111
2298 msgid "With VFS Capability Support"
2302 #: build/C/man2/capget.2:123
2304 "VFS Capability support creates a file-attribute method for adding "
2305 "capabilities to privileged executables. This privilege model obsoletes "
2306 "kernel support for one process asynchronously setting the capabilities of "
2307 "another. That is, with VFS support, for B<capset>() calls the only "
2308 "permitted values for I<hdrp-E<gt>pid> are 0 or B<getpid>(2), which are "
2313 #: build/C/man2/capget.2:123
2315 msgid "Without VFS Capability Support"
2319 #: build/C/man2/capget.2:149
2321 "When the kernel does not support VFS capabilities, B<capset>() calls can "
2322 "operate on the capabilities of the thread specified by the I<pid> field of "
2323 "I<hdrp> when that is nonzero, or on the capabilities of the calling thread "
2324 "if I<pid> is 0. If I<pid> refers to a single-threaded process, then I<pid> "
2325 "can be specified as a traditional process ID; operating on a thread of a "
2326 "multithreaded process requires a thread ID of the type returned by "
2327 "B<gettid>(2). For B<capset>(), I<pid> can also be: -1, meaning perform the "
2328 "change on all threads except the caller and B<init>(8); or a value less than "
2329 "-1, in which case the change is applied to all members of the process group "
2330 "whose ID is -I<pid>."
2334 #: build/C/man2/capget.2:152
2335 msgid "For details on the data, see B<capabilities>(7)."
2339 #: build/C/man2/capget.2:171
2341 "The calls will fail with the error B<EINVAL>, and set the I<version> field "
2342 "of I<hdrp> to the kernel preferred value of B<_LINUX_CAPABILITY_VERSION_?> "
2343 "when an unsupported I<version> value is specified. In this way, one can "
2344 "probe what the current preferred capability revision is."
2348 #: build/C/man2/capget.2:180
2350 "Bad memory address. I<hdrp> must not be NULL. I<datap> may be NULL only "
2351 "when the user is trying to determine the preferred capability version format "
2352 "supported by the kernel."
2356 #: build/C/man2/capget.2:180 build/C/man7/cpuset.7:1179 build/C/man7/cpuset.7:1188 build/C/man7/cpuset.7:1197 build/C/man7/cpuset.7:1207 build/C/man7/cpuset.7:1216 build/C/man7/cpuset.7:1223 build/C/man7/cpuset.7:1230 build/C/man2/getgroups.2:114 build/C/man2/getgroups.2:121 build/C/man2/getpriority.2:119 build/C/man2/getrlimit.2:440 build/C/man2/getrusage.2:190 build/C/man2/iopl.2:71 build/C/man2/ioprio_set.2:160 build/C/man2/setpgid.2:200
2362 #: build/C/man2/capget.2:183
2363 msgid "One of the arguments was invalid."
2367 #: build/C/man2/capget.2:188
2369 "An attempt was made to add a capability to the Permitted set, or to set a "
2370 "capability in the Effective or Inheritable sets that is not in the Permitted "
2375 #: build/C/man2/capget.2:207
2377 "The caller attempted to use B<capset>() to modify the capabilities of a "
2378 "thread other than itself, but lacked sufficient privilege. For kernels "
2379 "supporting VFS capabilities, this is never permitted. For kernels lacking "
2380 "VFS support, the B<CAP_SETPCAP> capability is required. (A bug in kernels "
2381 "before 2.6.11 meant that this error could also occur if a thread without "
2382 "this capability tried to change its own capabilities by specifying the "
2383 "I<pid> field as a nonzero value (i.e., the value returned by B<getpid>(2)) "
2388 #: build/C/man2/capget.2:207 build/C/man7/cpuset.7:1329 build/C/man2/getpriority.2:127 build/C/man2/getrlimit.2:464 build/C/man2/getsid.2:69 build/C/man2/ioprio_set.2:177 build/C/man2/setpgid.2:215
2394 #: build/C/man2/capget.2:210
2395 msgid "No such thread."
2399 #: build/C/man2/capget.2:212 build/C/man2/ioprio_set.2:188
2400 msgid "These system calls are Linux-specific."
2404 #: build/C/man2/capget.2:217
2406 "The portable interface to the capability querying and setting functions is "
2407 "provided by the I<libcap> library and is available here:"
2411 #: build/C/man2/capget.2:219
2412 msgid "http://www.kernel.org/pub/linux/libs/security/linux-privs"
2416 #: build/C/man2/capget.2:223
2417 msgid "B<clone>(2), B<gettid>(2), B<capabilities>(7)"
2421 #: build/C/man7/cpuset.7:24
2427 #: build/C/man7/cpuset.7:24
2433 #: build/C/man7/cpuset.7:27
2434 msgid "cpuset - confine processes to processor and memory node subsets"
2438 #: build/C/man7/cpuset.7:34
2440 "The cpuset file system is a pseudo-file-system interface to the kernel "
2441 "cpuset mechanism, which is used to control the processor placement and "
2442 "memory placement of processes. It is commonly mounted at I</dev/cpuset>."
2446 #: build/C/man7/cpuset.7:51
2448 "On systems with kernels compiled with built in support for cpusets, all "
2449 "processes are attached to a cpuset, and cpusets are always present. If a "
2450 "system supports cpusets, then it will have the entry B<nodev cpuset> in the "
2451 "file I</proc/filesystems>. By mounting the cpuset file system (see the "
2452 "B<EXAMPLE> section below), the administrator can configure the cpusets on a "
2453 "system to control the processor and memory placement of processes on that "
2454 "system. By default, if the cpuset configuration on a system is not modified "
2455 "or if the cpuset file system is not even mounted, then the cpuset mechanism, "
2456 "though present, has no affect on the system's behavior."
2460 #: build/C/man7/cpuset.7:53
2461 msgid "A cpuset defines a list of CPUs and memory nodes."
2465 #: build/C/man7/cpuset.7:62
2467 "The CPUs of a system include all the logical processing units on which a "
2468 "process can execute, including, if present, multiple processor cores within "
2469 "a package and Hyper-Threads within a processor core. Memory nodes include "
2470 "all distinct banks of main memory; small and SMP systems typically have just "
2471 "one memory node that contains all the system's main memory, while NUMA "
2472 "(non-uniform memory access) systems have multiple memory nodes."
2476 #: build/C/man7/cpuset.7:72
2478 "Cpusets are represented as directories in a hierarchical pseudo-file system, "
2479 "where the top directory in the hierarchy (I</dev/cpuset>) represents the "
2480 "entire system (all online CPUs and memory nodes) and any cpuset that is the "
2481 "child (descendant) of another parent cpuset contains a subset of that "
2482 "parent's CPUs and memory nodes. The directories and files representing "
2483 "cpusets have normal file-system permissions."
2487 #: build/C/man7/cpuset.7:83
2489 "Every process in the system belongs to exactly one cpuset. A process is "
2490 "confined to only run on the CPUs in the cpuset it belongs to, and to "
2491 "allocate memory only on the memory nodes in that cpuset. When a process "
2492 "B<fork>(2)s, the child process is placed in the same cpuset as its parent. "
2493 "With sufficient privilege, a process may be moved from one cpuset to another "
2494 "and the allowed CPUs and memory nodes of an existing cpuset may be changed."
2498 #: build/C/man7/cpuset.7:91
2500 "When the system begins booting, a single cpuset is defined that includes all "
2501 "CPUs and memory nodes on the system, and all processes are in that cpuset. "
2502 "During the boot process, or later during normal system operation, other "
2503 "cpusets may be created, as subdirectories of this top cpuset, under the "
2504 "control of the system administrator, and processes may be placed in these "
2509 #: build/C/man7/cpuset.7:113
2511 "Cpusets are integrated with the B<sched_setaffinity>(2) scheduling affinity "
2512 "mechanism and the B<mbind>(2) and B<set_mempolicy>(2) memory-placement "
2513 "mechanisms in the kernel. Neither of these mechanisms let a process make "
2514 "use of a CPU or memory node that is not allowed by that process's cpuset. "
2515 "If changes to a process's cpuset placement conflict with these other "
2516 "mechanisms, then cpuset placement is enforced even if it means overriding "
2517 "these other mechanisms. The kernel accomplishes this overriding by silently "
2518 "restricting the CPUs and memory nodes requested by these other mechanisms to "
2519 "those allowed by the invoking process's cpuset. This can result in these "
2520 "other calls returning an error, if for example, such a call ends up "
2521 "requesting an empty set of CPUs or memory nodes, after that request is "
2522 "restricted to the invoking process's cpuset."
2526 #: build/C/man7/cpuset.7:119
2528 "Typically, a cpuset is used to manage the CPU and memory-node confinement "
2529 "for a set of cooperating processes such as a batch scheduler job, and these "
2530 "other mechanisms are used to manage the placement of individual processes or "
2531 "memory regions within that set or job."
2535 #: build/C/man7/cpuset.7:119
2541 #: build/C/man7/cpuset.7:124
2543 "Each directory below I</dev/cpuset> represents a cpuset and contains a fixed "
2544 "set of pseudo-files describing the state of that cpuset."
2548 #: build/C/man7/cpuset.7:134
2550 "New cpusets are created using the B<mkdir>(2) system call or the "
2551 "B<mkdir>(1) command. The properties of a cpuset, such as its flags, "
2552 "allowed CPUs and memory nodes, and attached processes, are queried and "
2553 "modified by reading or writing to the appropriate file in that cpuset's "
2554 "directory, as listed below."
2558 #: build/C/man7/cpuset.7:140
2560 "The pseudo-files in each cpuset directory are automatically created when the "
2561 "cpuset is created, as a result of the B<mkdir>(2) invocation. It is not "
2562 "possible to directly add or remove these pseudo-files."
2566 #: build/C/man7/cpuset.7:148
2568 "A cpuset directory that contains no child cpuset directories, and has no "
2569 "attached processes, can be removed using B<rmdir>(2) or B<rmdir>(1). It is "
2570 "not necessary, or possible, to remove the pseudo-files inside the directory "
2571 "before removing it."
2575 #: build/C/man7/cpuset.7:162
2577 "The pseudo-files in each cpuset directory are small text files that may be "
2578 "read and written using traditional shell utilities such as B<cat>(1), and "
2579 "B<echo>(1), or from a program by using file I/O library functions or system "
2580 "calls, such as B<open>(2), B<read>(2), B<write>(2), and B<close>(2)."
2583 #. ====================== tasks ======================
2585 #: build/C/man7/cpuset.7:167
2587 "The pseudo-files in a cpuset directory represent internal kernel state and "
2588 "do not have any persistent image on disk. Each of these per-cpuset files is "
2589 "listed and described below."
2593 #: build/C/man7/cpuset.7:167
2599 #: build/C/man7/cpuset.7:177
2601 "List of the process IDs (PIDs) of the processes in that cpuset. The list is "
2602 "formatted as a series of ASCII decimal numbers, each followed by a newline. "
2603 "A process may be added to a cpuset (automatically removing it from the "
2604 "cpuset that previously contained it) by writing its PID to that cpuset's "
2605 "I<tasks> file (with or without a trailing newline.)"
2608 #. =================== notify_on_release ===================
2610 #: build/C/man7/cpuset.7:185
2612 "B<Warning:> only one PID may be written to the I<tasks> file at a time. If "
2613 "a string is written that contains more than one PID, only the first one will "
2618 #: build/C/man7/cpuset.7:185
2620 msgid "I<notify_on_release>"
2623 #. ====================== cpus ======================
2625 #: build/C/man7/cpuset.7:194
2627 "Flag (0 or 1). If set (1), that cpuset will receive special handling after "
2628 "it is released, that is, after all processes cease using it (i.e., terminate "
2629 "or are moved to a different cpuset) and all child cpuset directories have "
2630 "been removed. See the B<Notify On Release> section, below."
2634 #: build/C/man7/cpuset.7:194
2640 #: build/C/man7/cpuset.7:201
2642 "List of the physical numbers of the CPUs on which processes in that cpuset "
2643 "are allowed to execute. See B<List Format> below for a description of the "
2644 "format of I<cpus>."
2647 #. ==================== cpu_exclusive ====================
2649 #: build/C/man7/cpuset.7:207
2651 "The CPUs allowed to a cpuset may be changed by writing a new list to its "
2656 #: build/C/man7/cpuset.7:207
2658 msgid "I<cpu_exclusive>"
2662 #: build/C/man7/cpuset.7:214
2664 "Flag (0 or 1). If set (1), the cpuset has exclusive use of its CPUs (no "
2665 "sibling or cousin cpuset may overlap CPUs). By default this is off (0). "
2666 "Newly created cpusets also initially default this to off (0)."
2669 #. ====================== mems ======================
2671 #: build/C/man7/cpuset.7:236
2673 "Two cpusets are I<sibling> cpusets if they share the same parent cpuset in "
2674 "the I</dev/cpuset> hierarchy. Two cpusets are I<cousin> cpusets if neither "
2675 "is the ancestor of the other. Regardless of the I<cpu_exclusive> setting, "
2676 "if one cpuset is the ancestor of another, and if both of these cpusets have "
2677 "nonempty I<cpus>, then their I<cpus> must overlap, because the I<cpus> of "
2678 "any cpuset are always a subset of the I<cpus> of its parent cpuset."
2682 #: build/C/man7/cpuset.7:236
2687 #. ==================== mem_exclusive ====================
2689 #: build/C/man7/cpuset.7:244
2691 "List of memory nodes on which processes in this cpuset are allowed to "
2692 "allocate memory. See B<List Format> below for a description of the format "
2697 #: build/C/man7/cpuset.7:244
2699 msgid "I<mem_exclusive>"
2703 #: build/C/man7/cpuset.7:252
2705 "Flag (0 or 1). If set (1), the cpuset has exclusive use of its memory nodes "
2706 "(no sibling or cousin may overlap). Also if set (1), the cpuset is a "
2707 "B<Hardwall> cpuset (see below.) By default this is off (0). Newly created "
2708 "cpusets also initially default this to off (0)."
2711 #. ==================== mem_hardwall ====================
2713 #: build/C/man7/cpuset.7:260
2715 "Regardless of the I<mem_exclusive> setting, if one cpuset is the ancestor of "
2716 "another, then their memory nodes must overlap, because the memory nodes of "
2717 "any cpuset are always a subset of the memory nodes of that cpuset's parent "
2722 #: build/C/man7/cpuset.7:260
2724 msgid "I<mem_hardwall> (since Linux 2.6.26)"
2727 #. ==================== memory_migrate ====================
2729 #: build/C/man7/cpuset.7:271
2731 "Flag (0 or 1). If set (1), the cpuset is a B<Hardwall> cpuset (see below.) "
2732 "Unlike B<mem_exclusive>, there is no constraint on whether cpusets marked "
2733 "B<mem_hardwall> may have overlapping memory nodes with sibling or cousin "
2734 "cpusets. By default this is off (0). Newly created cpusets also initially "
2735 "default this to off (0)."
2739 #: build/C/man7/cpuset.7:271
2741 msgid "I<memory_migrate> (since Linux 2.6.16)"
2744 #. ==================== memory_pressure ====================
2746 #: build/C/man7/cpuset.7:278
2748 "Flag (0 or 1). If set (1), then memory migration is enabled. By default "
2749 "this is off (0). See the B<Memory Migration> section, below."
2753 #: build/C/man7/cpuset.7:278
2755 msgid "I<memory_pressure> (since Linux 2.6.16)"
2758 #. ================= memory_pressure_enabled =================
2760 #: build/C/man7/cpuset.7:291
2762 "A measure of how much memory pressure the processes in this cpuset are "
2763 "causing. See the B<Memory Pressure> section, below. Unless "
2764 "I<memory_pressure_enabled> is enabled, always has value zero (0). This file "
2765 "is read-only. See the B<WARNINGS> section, below."
2769 #: build/C/man7/cpuset.7:291
2771 msgid "I<memory_pressure_enabled> (since Linux 2.6.16)"
2774 #. ================== memory_spread_page ==================
2776 #: build/C/man7/cpuset.7:303
2778 "Flag (0 or 1). This file is only present in the root cpuset, normally "
2779 "I</dev/cpuset>. If set (1), the I<memory_pressure> calculations are enabled "
2780 "for all cpusets in the system. By default this is off (0). See the "
2781 "B<Memory Pressure> section, below."
2785 #: build/C/man7/cpuset.7:303
2787 msgid "I<memory_spread_page> (since Linux 2.6.17)"
2790 #. ================== memory_spread_slab ==================
2792 #: build/C/man7/cpuset.7:313
2794 "Flag (0 or 1). If set (1), pages in the kernel page cache (file-system "
2795 "buffers) are uniformly spread across the cpuset. By default this is off (0) "
2796 "in the top cpuset, and inherited from the parent cpuset in newly created "
2797 "cpusets. See the B<Memory Spread> section, below."
2801 #: build/C/man7/cpuset.7:313
2803 msgid "I<memory_spread_slab> (since Linux 2.6.17)"
2806 #. ================== sched_load_balance ==================
2808 #: build/C/man7/cpuset.7:324
2810 "Flag (0 or 1). If set (1), the kernel slab caches for file I/O (directory "
2811 "and inode structures) are uniformly spread across the cpuset. By default "
2812 "this is off (0) in the top cpuset, and inherited from the parent cpuset in "
2813 "newly created cpusets. See the B<Memory Spread> section, below."
2817 #: build/C/man7/cpuset.7:324
2819 msgid "I<sched_load_balance> (since Linux 2.6.24)"
2822 #. ================== sched_relax_domain_level ==================
2824 #: build/C/man7/cpuset.7:338
2826 "Flag (0 or 1). If set (1, the default) the kernel will automatically load "
2827 "balance processes in that cpuset over the allowed CPUs in that cpuset. If "
2828 "cleared (0) the kernel will avoid load balancing processes in this cpuset, "
2829 "I<unless> some other cpuset with overlapping CPUs has its "
2830 "I<sched_load_balance> flag set. See B<Scheduler Load Balancing>, below, for "
2835 #: build/C/man7/cpuset.7:338
2837 msgid "I<sched_relax_domain_level> (since Linux 2.6.26)"
2840 #. ================== proc cpuset ==================
2842 #: build/C/man7/cpuset.7:358
2844 "Integer, between -1 and a small positive value. The "
2845 "I<sched_relax_domain_level> controls the width of the range of CPUs over "
2846 "which the kernel scheduler performs immediate rebalancing of runnable tasks "
2847 "across CPUs. If I<sched_load_balance> is disabled, then the setting of "
2848 "I<sched_relax_domain_level> does not matter, as no such load balancing is "
2849 "done. If I<sched_load_balance> is enabled, then the higher the value of the "
2850 "I<sched_relax_domain_level>, the wider the range of CPUs over which "
2851 "immediate load balancing is attempted. See B<Scheduler Relax Domain Level>, "
2852 "below, for further details."
2855 #. ================== proc status ==================
2857 #: build/C/man7/cpuset.7:366
2859 "In addition to the above pseudo-files in each directory below "
2860 "I</dev/cpuset>, each process has a pseudo-file, "
2861 "I</proc/E<lt>pidE<gt>/cpuset>, that displays the path of the process's "
2862 "cpuset directory relative to the root of the cpuset file system."
2866 #: build/C/man7/cpuset.7:377
2868 "Also the I</proc/E<lt>pidE<gt>/status> file for each process has four added "
2869 "lines, displaying the process's I<Cpus_allowed> (on which CPUs it may be "
2870 "scheduled) and I<Mems_allowed> (on which memory nodes it may obtain memory), "
2871 "in the two formats B<Mask Format> and B<List Format> (see below) as shown "
2872 "in the following example:"
2876 #: build/C/man7/cpuset.7:384
2879 "Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff\n"
2880 "Cpus_allowed_list: 0-127\n"
2881 "Mems_allowed: ffffffff,ffffffff\n"
2882 "Mems_allowed_list: 0-63\n"
2885 #. ================== EXTENDED CAPABILITIES ==================
2887 #: build/C/man7/cpuset.7:390
2889 "The \"allowed\" fields were added in Linux 2.6.24; the \"allowed_list\" "
2890 "fields were added in Linux 2.6.26."
2894 #: build/C/man7/cpuset.7:390
2896 msgid "EXTENDED CAPABILITIES"
2899 #. ================== Exclusive Cpusets ==================
2901 #: build/C/man7/cpuset.7:398
2903 "In addition to controlling which I<cpus> and I<mems> a process is allowed to "
2904 "use, cpusets provide the following extended capabilities."
2908 #: build/C/man7/cpuset.7:398
2910 msgid "Exclusive Cpusets"
2914 #: build/C/man7/cpuset.7:405
2916 "If a cpuset is marked I<cpu_exclusive> or I<mem_exclusive>, no other cpuset, "
2917 "other than a direct ancestor or descendant, may share any of the same CPUs "
2921 #. ================== Hardwall ==================
2923 #: build/C/man7/cpuset.7:431
2925 "A cpuset that is I<mem_exclusive> restricts kernel allocations for buffer "
2926 "cache pages and other internal kernel data pages commonly shared by the "
2927 "kernel across multiple users. All cpusets, whether I<mem_exclusive> or not, "
2928 "restrict allocations of memory for user space. This enables configuring a "
2929 "system so that several independent jobs can share common kernel data, while "
2930 "isolating each job's user allocation in its own cpuset. To do this, "
2931 "construct a large I<mem_exclusive> cpuset to hold all the jobs, and "
2932 "construct child, non-I<mem_exclusive> cpusets for each individual job. Only "
2933 "a small amount of kernel memory, such as requests from interrupt handlers, "
2934 "is allowed to be placed on memory nodes outside even a I<mem_exclusive> "
2939 #: build/C/man7/cpuset.7:431
2945 #: build/C/man7/cpuset.7:446
2947 "A cpuset that has I<mem_exclusive> or I<mem_hardwall> set is a I<hardwall> "
2948 "cpuset. A I<hardwall> cpuset restricts kernel allocations for page, buffer, "
2949 "and other data commonly shared by the kernel across multiple users. All "
2950 "cpusets, whether I<hardwall> or not, restrict allocations of memory for user "
2955 #: build/C/man7/cpuset.7:457
2957 "This enables configuring a system so that several independent jobs can share "
2958 "common kernel data, such as file system pages, while isolating each job's "
2959 "user allocation in its own cpuset. To do this, construct a large "
2960 "I<hardwall> cpuset to hold all the jobs, and construct child cpusets for "
2961 "each individual job which are not I<hardwall> cpusets."
2964 #. ================== Notify On Release ==================
2966 #: build/C/man7/cpuset.7:463
2968 "Only a small amount of kernel memory, such as requests from interrupt "
2969 "handlers, is allowed to be taken outside even a I<hardwall> cpuset."
2973 #: build/C/man7/cpuset.7:463
2975 msgid "Notify On Release"
2979 #: build/C/man7/cpuset.7:475
2981 "If the I<notify_on_release> flag is enabled (1) in a cpuset, then whenever "
2982 "the last process in the cpuset leaves (exits or attaches to some other "
2983 "cpuset) and the last child cpuset of that cpuset is removed, the kernel "
2984 "will run the command I</sbin/cpuset_release_agent>, supplying the pathname "
2985 "(relative to the mount point of the cpuset file system) of the abandoned "
2986 "cpuset. This enables automatic removal of abandoned cpusets."
2990 #: build/C/man7/cpuset.7:483
2992 "The default value of I<notify_on_release> in the root cpuset at system boot "
2993 "is disabled (0). The default value of other cpusets at creation is the "
2994 "current value of their parent's I<notify_on_release> setting."
2998 #: build/C/man7/cpuset.7:491
3000 "The command I</sbin/cpuset_release_agent> is invoked, with the name "
3001 "(I</dev/cpuset> relative path) of the to-be-released cpuset in I<argv[1]>."
3005 #: build/C/man7/cpuset.7:495
3007 "The usual contents of the command I</sbin/cpuset_release_agent> is simply "
3012 #: build/C/man7/cpuset.7:500
3016 "rmdir /dev/cpuset/$1\n"
3019 #. ================== Memory Pressure ==================
3021 #: build/C/man7/cpuset.7:508
3023 "As with other flag values below, this flag can be changed by writing an "
3024 "ASCII number 0 or 1 (with optional trailing newline) into the file, to "
3025 "clear or set the flag, respectively."
3029 #: build/C/man7/cpuset.7:508
3031 msgid "Memory Pressure"
3035 #: build/C/man7/cpuset.7:514
3037 "The I<memory_pressure> of a cpuset provides a simple per-cpuset running "
3038 "average of the rate that the processes in a cpuset are attempting to free up "
3039 "in-use memory on the nodes of the cpuset to satisfy additional memory "
3044 #: build/C/man7/cpuset.7:518
3046 "This enables batch managers that are monitoring jobs running in dedicated "
3047 "cpusets to efficiently detect what level of memory pressure that job is "
3052 #: build/C/man7/cpuset.7:525
3054 "This is useful both on tightly managed systems running a wide mix of "
3055 "submitted jobs, which may choose to terminate or reprioritize jobs that are "
3056 "trying to use more memory than allowed on the nodes assigned them, and with "
3057 "tightly coupled, long-running, massively parallel scientific computing jobs "
3058 "that will dramatically fail to meet required performance goals if they start "
3059 "to use more memory than allowed to them."
3063 #: build/C/man7/cpuset.7:530
3065 "This mechanism provides a very economical way for the batch manager to "
3066 "monitor a cpuset for signs of memory pressure. It's up to the batch manager "
3067 "or other user code to decide what action to take if it detects signs of "
3072 #: build/C/man7/cpuset.7:537
3074 "Unless memory pressure calculation is enabled by setting the pseudo-file "
3075 "I</dev/cpuset/memory_pressure_enabled>, it is not computed for any cpuset, "
3076 "and reads from any I<memory_pressure> always return zero, as represented by "
3077 "the ASCII string \"0\\en\". See the B<WARNINGS> section, below."
3081 #: build/C/man7/cpuset.7:539
3082 msgid "A per-cpuset, running average is employed for the following reasons:"
3086 #: build/C/man7/cpuset.7:544
3088 "Because this meter is per-cpuset rather than per-process or per virtual "
3089 "memory region, the system load imposed by a batch scheduler monitoring this "
3090 "metric is sharply reduced on large systems, because a scan of the tasklist "
3091 "can be avoided on each set of queries."
3095 #: build/C/man7/cpuset.7:549
3097 "Because this meter is a running average rather than an accumulating counter, "
3098 "a batch scheduler can detect memory pressure with a single read, instead of "
3099 "having to read and accumulate results for a period of time."
3103 #: build/C/man7/cpuset.7:555
3105 "Because this meter is per-cpuset rather than per-process, the batch "
3106 "scheduler can obtain the key information\\(emmemory pressure in a "
3107 "cpuset\\(emwith a single read, rather than having to query and accumulate "
3108 "results over all the (dynamically changing) set of processes in the cpuset."
3112 #: build/C/man7/cpuset.7:563
3114 "The I<memory_pressure> of a cpuset is calculated using a per-cpuset simple "
3115 "digital filter that is kept within the kernel. For each cpuset, this filter "
3116 "tracks the recent rate at which processes attached to that cpuset enter the "
3117 "kernel direct reclaim code."
3121 #: build/C/man7/cpuset.7:572
3123 "The kernel direct reclaim code is entered whenever a process has to satisfy "
3124 "a memory page request by first finding some other page to repurpose, due to "
3125 "lack of any readily available already free pages. Dirty file system pages "
3126 "are repurposed by first writing them to disk. Unmodified file system buffer "
3127 "pages are repurposed by simply dropping them, though if that page is needed "
3128 "again, it will have to be reread from disk."
3131 #. ================== Memory Spread ==================
3133 #: build/C/man7/cpuset.7:580
3135 "The I<memory_pressure> file provides an integer number representing the "
3136 "recent (half-life of 10 seconds) rate of entries to the direct reclaim code "
3137 "caused by any process in the cpuset, in units of reclaims attempted per "
3138 "second, times 1000."
3142 #: build/C/man7/cpuset.7:580
3144 msgid "Memory Spread"
3148 #: build/C/man7/cpuset.7:588
3150 "There are two Boolean flag files per cpuset that control where the kernel "
3151 "allocates pages for the file-system buffers and related in-kernel data "
3152 "structures. They are called I<memory_spread_page> and "
3153 "I<memory_spread_slab>."
3157 #: build/C/man7/cpuset.7:595
3159 "If the per-cpuset Boolean flag file I<memory_spread_page> is set, then the "
3160 "kernel will spread the file-system buffers (page cache) evenly over all the "
3161 "nodes that the faulting process is allowed to use, instead of preferring to "
3162 "put those pages on the node where the process is running."
3166 #: build/C/man7/cpuset.7:603
3168 "If the per-cpuset Boolean flag file I<memory_spread_slab> is set, then the "
3169 "kernel will spread some file-system-related slab caches, such as those for "
3170 "inodes and directory entries, evenly over all the nodes that the faulting "
3171 "process is allowed to use, instead of preferring to put those pages on the "
3172 "node where the process is running."
3176 #: build/C/man7/cpuset.7:608
3178 "The setting of these flags does not affect the data segment (see B<brk>(2)) "
3179 "or stack segment pages of a process."
3183 #: build/C/man7/cpuset.7:616
3185 "By default, both kinds of memory spreading are off and the kernel prefers to "
3186 "allocate memory pages on the node local to where the requesting process is "
3187 "running. If that node is not allowed by the process's NUMA memory policy or "
3188 "cpuset configuration or if there are insufficient free memory pages on that "
3189 "node, then the kernel looks for the nearest node that is allowed and has "
3190 "sufficient free memory."
3194 #: build/C/man7/cpuset.7:619
3196 "When new cpusets are created, they inherit the memory spread settings of "
3201 #: build/C/man7/cpuset.7:634
3203 "Setting memory spreading causes allocations for the affected page or slab "
3204 "caches to ignore the process's NUMA memory policy and be spread instead. "
3205 "However, the effect of these changes in memory placement caused by "
3206 "cpuset-specified memory spreading is hidden from the B<mbind>(2) or "
3207 "B<set_mempolicy>(2) calls. These two NUMA memory policy calls always "
3208 "appear to behave as if no cpuset-specified memory spreading is in effect, "
3209 "even if it is. If cpuset memory spreading is subsequently turned off, the "
3210 "NUMA memory policy most recently specified by these calls is automatically "
3215 #: build/C/man7/cpuset.7:643
3217 "Both I<memory_spread_page> and I<memory_spread_slab> are Boolean flag "
3218 "files. By default they contain \"0\", meaning that the feature is off for "
3219 "that cpuset. If a \"1\" is written to that file, that turns the named "
3224 #: build/C/man7/cpuset.7:646
3226 "Cpuset-specified memory spreading behaves similarly to what is known (in "
3227 "other contexts) as round-robin or interleave memory placement."
3231 #: build/C/man7/cpuset.7:649
3233 "Cpuset-specified memory spreading can provide substantial performance "
3234 "improvements for jobs that:"
3238 #: build/C/man7/cpuset.7:649
3244 #: build/C/man7/cpuset.7:653
3246 "need to place thread-local data on memory nodes close to the CPUs which are "
3247 "running the threads that most frequently access that data; but also"
3251 #: build/C/man7/cpuset.7:653
3257 #: build/C/man7/cpuset.7:656
3259 "need to access large file-system data sets that must to be spread across the "
3260 "several nodes in the job's cpuset in order to fit."
3263 #. ================== Memory Migration ==================
3265 #: build/C/man7/cpuset.7:663
3267 "Without this policy, the memory allocation across the nodes in the job's "
3268 "cpuset can become very uneven, especially for jobs that might have just a "
3269 "single thread initializing or reading in the data set."
3273 #: build/C/man7/cpuset.7:663
3275 msgid "Memory Migration"
3279 #: build/C/man7/cpuset.7:672
3281 "Normally, under the default setting (disabled) of I<memory_migrate>, once a "
3282 "page is allocated (given a physical page of main memory) then that page "
3283 "stays on whatever node it was allocated, so long as it remains allocated, "
3284 "even if the cpuset's memory-placement policy I<mems> subsequently changes."
3288 #: build/C/man7/cpuset.7:678
3290 "When memory migration is enabled in a cpuset, if the I<mems> setting of the "
3291 "cpuset is changed, then any memory page in use by any process in the cpuset "
3292 "that is on a memory node that is no longer allowed will be migrated to a "
3293 "memory node that is allowed."
3297 #: build/C/man7/cpuset.7:684
3299 "Furthermore, if a process is moved into a cpuset with I<memory_migrate> "
3300 "enabled, any memory pages it uses that were on memory nodes allowed in its "
3301 "previous cpuset, but which are not allowed in its new cpuset, will be "
3302 "migrated to a memory node allowed in the new cpuset."
3305 #. ================== Scheduler Load Balancing ==================
3307 #: build/C/man7/cpuset.7:692
3309 "The relative placement of a migrated page within the cpuset is preserved "
3310 "during these migration operations if possible. For example, if the page was "
3311 "on the second valid node of the prior cpuset, then the page will be placed "
3312 "on the second valid node of the new cpuset, if possible."
3316 #: build/C/man7/cpuset.7:692
3318 msgid "Scheduler Load Balancing"
3322 #: build/C/man7/cpuset.7:699
3324 "The kernel scheduler automatically load balances processes. If one CPU is "
3325 "underutilized, the kernel will look for processes on other more overloaded "
3326 "CPUs and move those processes to the underutilized CPU, within the "
3327 "constraints of such placement mechanisms as cpusets and "
3328 "B<sched_setaffinity>(2)."
3332 #: build/C/man7/cpuset.7:712
3334 "The algorithmic cost of load balancing and its impact on key shared kernel "
3335 "data structures such as the process list increases more than linearly with "
3336 "the number of CPUs being balanced. For example, it costs more to load "
3337 "balance across one large set of CPUs than it does to balance across two "
3338 "smaller sets of CPUs, each of half the size of the larger set. (The precise "
3339 "relationship between the number of CPUs being balanced and the cost of load "
3340 "balancing depends on implementation details of the kernel process scheduler, "
3341 "which is subject to change over time, as improved kernel scheduler "
3342 "algorithms are implemented.)"
3346 #: build/C/man7/cpuset.7:718
3348 "The per-cpuset flag I<sched_load_balance> provides a mechanism to suppress "
3349 "this automatic scheduler load balancing in cases where it is not needed and "
3350 "suppressing it would have worthwhile performance benefits."
3354 #: build/C/man7/cpuset.7:722
3356 "By default, load balancing is done across all CPUs, except those marked "
3357 "isolated using the kernel boot time \"isolcpus=\" argument. (See "
3358 "B<Scheduler Relax Domain Level>, below, to change this default.)"
3362 #: build/C/man7/cpuset.7:725
3364 "This default load balancing across all CPUs is not well suited to the "
3365 "following two situations:"
3369 #: build/C/man7/cpuset.7:729
3371 "On large systems, load balancing across many CPUs is expensive. If the "
3372 "system is managed using cpusets to place independent jobs on separate sets "
3373 "of CPUs, full load balancing is unnecessary."
3377 #: build/C/man7/cpuset.7:733
3379 "Systems supporting real-time on some CPUs need to minimize system overhead "
3380 "on those CPUs, including avoiding process load balancing if that is not "
3385 #: build/C/man7/cpuset.7:743
3387 "When the per-cpuset flag I<sched_load_balance> is enabled (the default "
3388 "setting), it requests load balancing across all the CPUs in that cpuset's "
3389 "allowed CPUs, ensuring that load balancing can move a process (not otherwise "
3390 "pinned, as by B<sched_setaffinity>(2)) from any CPU in that cpuset to any "
3395 #: build/C/man7/cpuset.7:752
3397 "When the per-cpuset flag I<sched_load_balance> is disabled, then the "
3398 "scheduler will avoid load balancing across the CPUs in that cpuset, "
3399 "I<except> in so far as is necessary because some overlapping cpuset has "
3400 "I<sched_load_balance> enabled."
3404 #: build/C/man7/cpuset.7:760
3406 "So, for example, if the top cpuset has the flag I<sched_load_balance> "
3407 "enabled, then the scheduler will load balance across all CPUs, and the "
3408 "setting of the I<sched_load_balance> flag in other cpusets has no effect, as "
3409 "we're already fully load balancing."
3413 #: build/C/man7/cpuset.7:765
3415 "Therefore in the above two situations, the flag I<sched_load_balance> should "
3416 "be disabled in the top cpuset, and only some of the smaller, child cpusets "
3417 "would have this flag enabled."
3421 #: build/C/man7/cpuset.7:773
3423 "When doing this, you don't usually want to leave any unpinned processes in "
3424 "the top cpuset that might use nontrivial amounts of CPU, as such processes "
3425 "may be artificially constrained to some subset of CPUs, depending on the "
3426 "particulars of this flag setting in descendant cpusets. Even if such a "
3427 "process could use spare CPU cycles in some other CPUs, the kernel scheduler "
3428 "might not consider the possibility of load balancing that process to the "
3432 #. ================== Scheduler Relax Domain Level ==================
3434 #: build/C/man7/cpuset.7:779
3436 "Of course, processes pinned to a particular CPU can be left in a cpuset that "
3437 "disables I<sched_load_balance> as those processes aren't going anywhere else "
3442 #: build/C/man7/cpuset.7:779
3444 msgid "Scheduler Relax Domain Level"
3448 #: build/C/man7/cpuset.7:800
3450 "The kernel scheduler performs immediate load balancing whenever a CPU "
3451 "becomes free or another task becomes runnable. This load balancing works to "
3452 "ensure that as many CPUs as possible are usefully employed running tasks. "
3453 "The kernel also performs periodic load balancing off the software clock "
3454 "described in I<time>(7). The setting of I<sched_relax_domain_level> only "
3455 "applies to immediate load balancing. Regardless of the "
3456 "I<sched_relax_domain_level> setting, periodic load balancing is attempted "
3457 "over all CPUs (unless disabled by turning off I<sched_load_balance>.) In "
3458 "any case, of course, tasks will only be scheduled to run on CPUs allowed by "
3459 "their cpuset, as modified by B<sched_setaffinity>(2) system calls."
3463 #: build/C/man7/cpuset.7:808
3465 "On small systems, such as those with just a few CPUs, immediate load "
3466 "balancing is useful to improve system interactivity and to minimize wasteful "
3467 "idle CPU cycles. But on large systems, attempting immediate load balancing "
3468 "across a large number of CPUs can be more costly than it is worth, depending "
3469 "on the particular performance characteristics of the job mix and the "
3474 #: build/C/man7/cpuset.7:816
3476 "The exact meaning of the small integer values of I<sched_relax_domain_level> "
3477 "will depend on internal implementation details of the kernel scheduler code "
3478 "and on the non-uniform architecture of the hardware. Both of these will "
3479 "evolve over time and vary by system architecture and kernel version."
3483 #: build/C/man7/cpuset.7:821
3485 "As of this writing, when this capability was introduced in Linux 2.6.26, on "
3486 "certain popular architectures, the positive values of "
3487 "I<sched_relax_domain_level> have the following meanings."
3491 #: build/C/man7/cpuset.7:823
3497 #: build/C/man7/cpuset.7:826
3499 "Perform immediate load balancing across Hyper-Thread siblings on the same "
3504 #: build/C/man7/cpuset.7:826
3510 #: build/C/man7/cpuset.7:828
3511 msgid "Perform immediate load balancing across other cores in the same package."
3515 #: build/C/man7/cpuset.7:828
3521 #: build/C/man7/cpuset.7:831
3523 "Perform immediate load balancing across other CPUs on the same node or "
3528 #: build/C/man7/cpuset.7:831
3534 #: build/C/man7/cpuset.7:834
3536 "Perform immediate load balancing across over several (implementation detail) "
3537 "nodes [On NUMA systems]."
3541 #: build/C/man7/cpuset.7:834
3547 #: build/C/man7/cpuset.7:837
3549 "Perform immediate load balancing across over all CPUs in system [On NUMA "
3554 #: build/C/man7/cpuset.7:846
3556 "The I<sched_relax_domain_level> value of zero (0) always means don't perform "
3557 "immediate load balancing, hence that load balancing is only done "
3558 "periodically, not immediately when a CPU becomes available or another task "
3563 #: build/C/man7/cpuset.7:854
3565 "The I<sched_relax_domain_level> value of minus one (-1) always means use "
3566 "the system default value. The system default value can vary by architecture "
3567 "and kernel version. This system default value can be changed by kernel "
3568 "boot-time \"relax_domain_level=\" argument."
3572 #: build/C/man7/cpuset.7:862
3574 "In the case of multiple overlapping cpusets which have conflicting "
3575 "I<sched_relax_domain_level> values, then the highest such value applies to "
3576 "all CPUs in any of the overlapping cpusets. In such cases, the value "
3577 "B<minus one (-1)> is the lowest value, overridden by any other value, and "
3578 "the value B<zero (0)> is the next lowest value."
3582 #: build/C/man7/cpuset.7:862
3587 #. ================== Mask Format ==================
3589 #: build/C/man7/cpuset.7:866
3590 msgid "The following formats are used to represent sets of CPUs and memory nodes."
3594 #: build/C/man7/cpuset.7:866
3600 #: build/C/man7/cpuset.7:871
3602 "The B<Mask Format> is used to represent CPU and memory-node bitmasks in the "
3603 "I</proc/E<lt>pidE<gt>/status> file."
3607 #: build/C/man7/cpuset.7:879
3609 "This format displays each 32-bit word in hexadecimal (using ASCII characters "
3610 "\"0\" - \"9\" and \"a\" - \"f\"); words are filled with leading zeros, if "
3611 "required. For masks longer than one word, a comma separator is used between "
3612 "words. Words are displayed in big-endian order, which has the most "
3613 "significant bit first. The hex digits within a word are also in big-endian "
3618 #: build/C/man7/cpuset.7:882
3620 "The number of 32-bit words displayed is the minimum number needed to display "
3621 "all bits of the bitmask, based on the size of the bitmask."
3625 #: build/C/man7/cpuset.7:884
3626 msgid "Examples of the B<Mask Format>:"
3630 #: build/C/man7/cpuset.7:892
3633 "00000001 # just bit 0 set\n"
3634 "40000000,00000000,00000000 # just bit 94 set\n"
3635 "00000001,00000000,00000000 # just bit 64 set\n"
3636 "000000ff,00000000 # bits 32-39 set\n"
3637 "00000000,000E3862 # 1,5,6,11-13,17-19 set\n"
3641 #: build/C/man7/cpuset.7:896
3642 msgid "A mask with bits 0, 1, 2, 4, 8, 16, 32, and 64 set displays as:"
3646 #: build/C/man7/cpuset.7:900
3648 msgid "00000001,00000001,00010117\n"
3651 #. ================== List Format ==================
3653 #: build/C/man7/cpuset.7:907
3655 "The first \"1\" is for bit 64, the second for bit 32, the third for bit 16, "
3656 "the fourth for bit 8, the fifth for bit 4, and the \"7\" is for bits 2, 1, "
3661 #: build/C/man7/cpuset.7:907
3667 #: build/C/man7/cpuset.7:914
3669 "The B<List Format> for I<cpus> and I<mems> is a comma-separated list of CPU "
3670 "or memory-node numbers and ranges of numbers, in ASCII decimal."
3674 #: build/C/man7/cpuset.7:916
3675 msgid "Examples of the B<List Format>:"
3679 #: build/C/man7/cpuset.7:921
3682 "0-4,9 # bits 0, 1, 2, 3, 4, and 9 set\n"
3683 "0-2,7,12-14 # bits 0, 1, 2, 7, 12, 13, and 14 set\n"
3686 #. ================== RULES ==================
3688 #: build/C/man7/cpuset.7:924
3694 #: build/C/man7/cpuset.7:926
3695 msgid "The following rules apply to each cpuset:"
3699 #: build/C/man7/cpuset.7:929
3701 "Its CPUs and memory nodes must be a (possibly equal) subset of its "
3706 #: build/C/man7/cpuset.7:933
3707 msgid "It can only be marked I<cpu_exclusive> if its parent is."
3711 #: build/C/man7/cpuset.7:937
3712 msgid "It can only be marked I<mem_exclusive> if its parent is."
3716 #: build/C/man7/cpuset.7:941
3717 msgid "If it is I<cpu_exclusive>, its CPUs may not overlap any sibling."
3720 #. ================== PERMISSIONS ==================
3722 #: build/C/man7/cpuset.7:946
3723 msgid "If it is I<memory_exclusive>, its memory nodes may not overlap any sibling."
3727 #: build/C/man7/cpuset.7:946
3733 #: build/C/man7/cpuset.7:951
3735 "The permissions of a cpuset are determined by the permissions of the "
3736 "directories and pseudo-files in the cpuset file system, normally mounted at "
3741 #: build/C/man7/cpuset.7:960
3743 "For instance, a process can put itself in some other cpuset (than its "
3744 "current one) if it can write the I<tasks> file for that cpuset. This "
3745 "requires execute permission on the encompassing directories and write "
3746 "permission on the I<tasks> file."
3750 #: build/C/man7/cpuset.7:967
3752 "An additional constraint is applied to requests to place some other process "
3753 "in a cpuset. One process may not attach another to a cpuset unless it would "
3754 "have permission to send that process a signal (see B<kill>(2))."
3758 #: build/C/man7/cpuset.7:978
3760 "A process may create a child cpuset if it can access and write the parent "
3761 "cpuset directory. It can modify the CPUs or memory nodes in a cpuset if it "
3762 "can access that cpuset's directory (execute permissions on the each of the "
3763 "parent directories) and write the corresponding I<cpus> or I<mems> file."
3767 #: build/C/man7/cpuset.7:999
3769 "There is one minor difference between the manner in which these permissions "
3770 "are evaluated and the manner in which normal file-system operation "
3771 "permissions are evaluated. The kernel interprets relative pathnames "
3772 "starting at a process's current working directory. Even if one is operating "
3773 "on a cpuset file, relative pathnames are interpreted relative to the "
3774 "process's current working directory, not relative to the process's current "
3775 "cpuset. The only ways that cpuset paths relative to a process's current "
3776 "cpuset can be used are if either the process's current working directory is "
3777 "its cpuset (it first did a B<cd> or B<chdir>(2) to its cpuset directory "
3778 "beneath I</dev/cpuset>, which is a bit unusual) or if some user code "
3779 "converts the relative cpuset path to a full file-system path."
3782 #. ================== WARNINGS ==================
3784 #: build/C/man7/cpuset.7:1014
3786 "In theory, this means that user code should specify cpusets using absolute "
3787 "pathnames, which requires knowing the mount point of the cpuset file system "
3788 "(usually, but not necessarily, I</dev/cpuset>). In practice, all user level "
3789 "code that this author is aware of simply assumes that if the cpuset file "
3790 "system is mounted, then it is mounted at I</dev/cpuset>. Furthermore, it is "
3791 "common practice for carefully written user code to verify the presence of "
3792 "the pseudo-file I</dev/cpuset/tasks> in order to verify that the cpuset "
3793 "pseudo-file system is currently mounted."
3797 #: build/C/man7/cpuset.7:1014
3803 #: build/C/man7/cpuset.7:1015
3805 msgid "Enabling memory_pressure"
3809 #: build/C/man7/cpuset.7:1024
3811 "By default, the per-cpuset file I<memory_pressure> always contains zero "
3812 "(0). Unless this feature is enabled by writing \"1\" to the pseudo-file "
3813 "I</dev/cpuset/memory_pressure_enabled>, the kernel does not compute "
3814 "per-cpuset I<memory_pressure>."
3818 #: build/C/man7/cpuset.7:1024
3820 msgid "Using the echo command"
3823 #. Gack! csh(1)'s echo does this
3825 #: build/C/man7/cpuset.7:1035
3827 "When using the B<echo> command at the shell prompt to change the values of "
3828 "cpuset files, beware that the built-in B<echo> command in some shells does "
3829 "not display an error message if the B<write>(2) system call fails. For "
3830 "example, if the command:"
3834 #: build/C/man7/cpuset.7:1039
3836 msgid "echo 19 E<gt> mems\n"
3840 #: build/C/man7/cpuset.7:1052
3842 "failed because memory node 19 was not allowed (perhaps the current system "
3843 "does not have a memory node 19), then the B<echo> command might not display "
3844 "any error. It is better to use the B</bin/echo> external command to change "
3845 "cpuset file settings, as this command will display B<write>(2) errors, as "
3850 #: build/C/man7/cpuset.7:1057
3853 "/bin/echo 19 E<gt> mems\n"
3854 "/bin/echo: write error: Invalid argument\n"
3857 #. ================== EXCEPTIONS ==================
3859 #: build/C/man7/cpuset.7:1060
3865 #: build/C/man7/cpuset.7:1061
3867 msgid "Memory placement"
3871 #: build/C/man7/cpuset.7:1064
3873 "Not all allocations of system memory are constrained by cpusets, for the "
3874 "following reasons."
3878 #: build/C/man7/cpuset.7:1079
3880 "If hot-plug functionality is used to remove all the CPUs that are currently "
3881 "assigned to a cpuset, then the kernel will automatically update the "
3882 "I<cpus_allowed> of all processes attached to CPUs in that cpuset to allow "
3883 "all CPUs. When memory hot-plug functionality for removing memory nodes is "
3884 "available, a similar exception is expected to apply there as well. In "
3885 "general, the kernel prefers to violate cpuset placement, rather than "
3886 "starving a process that has had all its allowed CPUs or memory nodes taken "
3887 "offline. User code should reconfigure cpusets to only refer to online CPUs "
3888 "and memory nodes when using hot-plug to add or remove such resources."
3892 #: build/C/man7/cpuset.7:1087
3894 "A few kernel-critical, internal memory-allocation requests, marked "
3895 "GFP_ATOMIC, must be satisfied immediately. The kernel may drop some request "
3896 "or malfunction if one of these allocations fail. If such a request cannot "
3897 "be satisfied within the current process's cpuset, then we relax the cpuset, "
3898 "and look for memory anywhere we can find it. It's better to violate the "
3899 "cpuset than stress the kernel."
3903 #: build/C/man7/cpuset.7:1091
3905 "Allocations of memory requested by kernel drivers while processing an "
3906 "interrupt lack any relevant process context, and are not confined by "
3911 #: build/C/man7/cpuset.7:1091
3913 msgid "Renaming cpusets"
3916 #. ================== ERRORS ==================
3918 #: build/C/man7/cpuset.7:1099
3920 "You can use the B<rename>(2) system call to rename cpusets. Only simple "
3921 "renaming is supported; that is, changing the name of a cpuset directory is "
3922 "permitted, but moving a directory into a different directory is not "
3927 #: build/C/man7/cpuset.7:1103
3929 "The Linux kernel implementation of cpusets sets I<errno> to specify the "
3930 "reason for a failed system call affecting cpusets."
3934 #: build/C/man7/cpuset.7:1108
3936 "The possible I<errno> settings and their meaning when set on a failed cpuset "
3937 "call are as listed below."
3941 #: build/C/man7/cpuset.7:1108
3947 #: build/C/man7/cpuset.7:1115
3949 "Attempted a B<write>(2) on a special cpuset file with a length larger than "
3950 "some kernel-determined upper limit on the length of such writes."
3954 #: build/C/man7/cpuset.7:1122
3956 "Attempted to B<write>(2) the process ID (PID) of a process to a cpuset "
3957 "I<tasks> file when one lacks permission to move that process."
3961 #: build/C/man7/cpuset.7:1128
3963 "Attempted to add, using B<write>(2), a CPU or memory node to a cpuset, when "
3964 "that CPU or memory node was not already in its parent."
3968 #: build/C/man7/cpuset.7:1136
3970 "Attempted to set, using B<write>(2), I<cpu_exclusive> or I<mem_exclusive> on "
3971 "a cpuset whose parent lacks the same setting."
3975 #: build/C/man7/cpuset.7:1143
3976 msgid "Attempted to B<write>(2) a I<memory_pressure> file."
3980 #: build/C/man7/cpuset.7:1146
3981 msgid "Attempted to create a file in a cpuset directory."
3985 #: build/C/man7/cpuset.7:1146 build/C/man7/cpuset.7:1151 build/C/man7/cpuset.7:1156
3991 #: build/C/man7/cpuset.7:1151
3992 msgid "Attempted to remove, using B<rmdir>(2), a cpuset with attached processes."
3996 #: build/C/man7/cpuset.7:1156
3997 msgid "Attempted to remove, using B<rmdir>(2), a cpuset with child cpusets."
4001 #: build/C/man7/cpuset.7:1161
4003 "Attempted to remove a CPU or memory node from a cpuset that is also in a "
4004 "child of that cpuset."
4008 #: build/C/man7/cpuset.7:1161 build/C/man7/cpuset.7:1166
4014 #: build/C/man7/cpuset.7:1166
4015 msgid "Attempted to create, using B<mkdir>(2), a cpuset that already exists."
4019 #: build/C/man7/cpuset.7:1171
4020 msgid "Attempted to B<rename>(2) a cpuset to a name that already exists."
4024 #: build/C/man7/cpuset.7:1179
4026 "Attempted to B<read>(2) or B<write>(2) a cpuset file using a buffer that "
4027 "is outside the writing processes accessible address space."
4031 #: build/C/man7/cpuset.7:1188
4033 "Attempted to change a cpuset, using B<write>(2), in a way that would violate "
4034 "a I<cpu_exclusive> or I<mem_exclusive> attribute of that cpuset or any of "
4039 #: build/C/man7/cpuset.7:1197
4041 "Attempted to B<write>(2) an empty I<cpus> or I<mems> list to a cpuset which "
4042 "has attached processes or child cpusets."
4046 #: build/C/man7/cpuset.7:1207
4048 "Attempted to B<write>(2) a I<cpus> or I<mems> list which included a range "
4049 "with the second number smaller than the first number."
4053 #: build/C/man7/cpuset.7:1216
4055 "Attempted to B<write>(2) a I<cpus> or I<mems> list which included an "
4056 "invalid character in the string."
4060 #: build/C/man7/cpuset.7:1223
4062 "Attempted to B<write>(2) a list to a I<cpus> file that did not include any "
4067 #: build/C/man7/cpuset.7:1230
4069 "Attempted to B<write>(2) a list to a I<mems> file that did not include any "
4070 "online memory nodes."
4074 #: build/C/man7/cpuset.7:1237
4076 "Attempted to B<write>(2) a list to a I<mems> file that included a node that "
4081 #: build/C/man7/cpuset.7:1245
4083 "Attempted to B<write>(2) a string to a cpuset I<tasks> file that does not "
4084 "begin with an ASCII decimal integer."
4088 #: build/C/man7/cpuset.7:1250
4089 msgid "Attempted to B<rename>(2) a cpuset into a different directory."
4093 #: build/C/man7/cpuset.7:1257
4095 "Attempted to B<read>(2) a I</proc/E<lt>pidE<gt>/cpuset> file for a cpuset "
4096 "path that is longer than the kernel page size."
4100 #: build/C/man7/cpuset.7:1262
4102 "Attempted to create, using B<mkdir>(2), a cpuset whose base directory name "
4103 "is longer than 255 characters."
4107 #: build/C/man7/cpuset.7:1269
4109 "Attempted to create, using B<mkdir>(2), a cpuset whose full pathname, "
4110 "including the mount point (typically \"/dev/cpuset/\") prefix, is longer "
4111 "than 4095 characters."
4115 #: build/C/man7/cpuset.7:1269
4121 #: build/C/man7/cpuset.7:1274
4123 "The cpuset was removed by another process at the same time as a B<write>(2) "
4124 "was attempted on one of the pseudo-files in the cpuset directory."
4128 #: build/C/man7/cpuset.7:1279
4130 "Attempted to create, using B<mkdir>(2), a cpuset in a parent cpuset that "
4135 #: build/C/man7/cpuset.7:1286
4137 "Attempted to B<access>(2) or B<open>(2) a nonexistent file in a cpuset "
4142 #: build/C/man7/cpuset.7:1291
4144 "Insufficient memory is available within the kernel; can occur on a variety "
4145 "of system calls affecting cpusets, but only if the system is extremely short "
4150 #: build/C/man7/cpuset.7:1291 build/C/man7/cpuset.7:1303
4156 #: build/C/man7/cpuset.7:1303
4158 "Attempted to B<write>(2) the process ID (PID) of a process to a cpuset "
4159 "I<tasks> file when the cpuset had an empty I<cpus> or empty I<mems> setting."
4163 #: build/C/man7/cpuset.7:1313
4165 "Attempted to B<write>(2) an empty I<cpus> or I<mems> setting to a cpuset "
4166 "that has tasks attached."
4170 #: build/C/man7/cpuset.7:1318
4171 msgid "Attempted to B<rename>(2) a nonexistent cpuset."
4175 #: build/C/man7/cpuset.7:1321
4176 msgid "Attempted to remove a file from a cpuset directory."
4180 #: build/C/man7/cpuset.7:1321
4186 #: build/C/man7/cpuset.7:1329
4188 "Specified a I<cpus> or I<mems> list to the kernel which included a number "
4189 "too large for the kernel to set in its bitmasks."
4192 #. ================== VERSIONS ==================
4194 #: build/C/man7/cpuset.7:1337
4196 "Attempted to B<write>(2) the process ID (PID) of a nonexistent process to a "
4197 "cpuset I<tasks> file."
4200 #. ================== NOTES ==================
4202 #: build/C/man7/cpuset.7:1340
4203 msgid "Cpusets appeared in version 2.6.12 of the Linux kernel."
4206 #. ================== BUGS ==================
4208 #: build/C/man7/cpuset.7:1351
4210 "Despite its name, the I<pid> parameter is actually a thread ID, and each "
4211 "thread in a threaded group can be attached to a different cpuset. The value "
4212 "returned from a call to B<gettid>(2) can be passed in the argument I<pid>."
4216 #: build/C/man7/cpuset.7:1351 build/C/man2/getrlimit.2:576 build/C/man2/ioprio_set.2:308 build/C/man2/setfsgid.2:102 build/C/man2/setfsuid.2:102
4221 #. ================== EXAMPLE ==================
4223 #: build/C/man7/cpuset.7:1364
4225 "I<memory_pressure> cpuset files can be opened for writing, creation, or "
4226 "truncation, but then the B<write>(2) fails with I<errno> set to B<EACCES>, "
4227 "and the creation and truncation options on B<open>(2) have no effect."
4231 #: build/C/man7/cpuset.7:1364 build/C/man2/getrlimit.2:520
4237 #: build/C/man7/cpuset.7:1367
4239 "The following examples demonstrate querying and setting cpuset options using "
4244 #: build/C/man7/cpuset.7:1367
4246 msgid "Creating and attaching to a cpuset."
4250 #: build/C/man7/cpuset.7:1370
4252 "To create a new cpuset and attach the current command shell to it, the steps "
4257 #: build/C/man7/cpuset.7:1372 build/C/man7/cpuset.7:1411
4263 #: build/C/man7/cpuset.7:1374
4264 msgid "mkdir /dev/cpuset (if not already done)"
4268 #: build/C/man7/cpuset.7:1374 build/C/man7/cpuset.7:1417
4274 #: build/C/man7/cpuset.7:1376
4275 msgid "mount -t cpuset none /dev/cpuset (if not already done)"
4279 #: build/C/man7/cpuset.7:1376 build/C/man7/cpuset.7:1420
4285 #: build/C/man7/cpuset.7:1379
4286 msgid "Create the new cpuset using B<mkdir>(1)."
4290 #: build/C/man7/cpuset.7:1379 build/C/man7/cpuset.7:1423
4296 #: build/C/man7/cpuset.7:1381
4297 msgid "Assign CPUs and memory nodes to the new cpuset."
4301 #: build/C/man7/cpuset.7:1381 build/C/man7/cpuset.7:1428
4307 #: build/C/man7/cpuset.7:1383
4308 msgid "Attach the shell to the new cpuset."
4312 #: build/C/man7/cpuset.7:1388
4314 "For example, the following sequence of commands will set up a cpuset named "
4315 "\"Charlie\", containing just CPUs 2 and 3, and memory node 1, and then "
4316 "attach the current shell to that cpuset."
4320 #: build/C/man7/cpuset.7:1402
4323 "$B< mkdir /dev/cpuset>\n"
4324 "$B< mount -t cpuset cpuset /dev/cpuset>\n"
4325 "$B< cd /dev/cpuset>\n"
4326 "$B< mkdir Charlie>\n"
4328 "$B< /bin/echo 2-3 E<gt> cpus>\n"
4329 "$B< /bin/echo 1 E<gt> mems>\n"
4330 "$B< /bin/echo $$ E<gt> tasks>\n"
4331 "# The current shell is now running in cpuset Charlie\n"
4332 "# The next line should display '/Charlie'\n"
4333 "$B< cat /proc/self/cpuset>\n"
4337 #: build/C/man7/cpuset.7:1404
4339 msgid "Migrating a job to different memory nodes."
4343 #: build/C/man7/cpuset.7:1409
4345 "To migrate a job (the set of processes attached to a cpuset) to different "
4346 "CPUs and memory nodes in the system, including moving the memory pages "
4347 "currently allocated to that job, perform the following steps."
4351 #: build/C/man7/cpuset.7:1417
4353 "Let's say we want to move the job in cpuset I<alpha> (CPUs 4-7 and memory "
4354 "nodes 2-3) to a new cpuset I<beta> (CPUs 16-19 and memory nodes 8-9)."
4358 #: build/C/man7/cpuset.7:1420
4359 msgid "First create the new cpuset I<beta>."
4363 #: build/C/man7/cpuset.7:1423
4364 msgid "Then allow CPUs 16-19 and memory nodes 8-9 in I<beta>."
4368 #: build/C/man7/cpuset.7:1428
4369 msgid "Then enable I<memory_migration> in I<beta>."
4373 #: build/C/man7/cpuset.7:1433
4374 msgid "Then move each process from I<alpha> to I<beta>."
4378 #: build/C/man7/cpuset.7:1436
4379 msgid "The following sequence of commands accomplishes this."
4383 #: build/C/man7/cpuset.7:1446
4386 "$B< cd /dev/cpuset>\n"
4389 "$B< /bin/echo 16-19 E<gt> cpus>\n"
4390 "$B< /bin/echo 8-9 E<gt> mems>\n"
4391 "$B< /bin/echo 1 E<gt> memory_migrate>\n"
4392 "$B< while read i; do /bin/echo $i; done E<lt> ../alpha/tasks E<gt> tasks>\n"
4396 #: build/C/man7/cpuset.7:1455
4398 "The above should move any processes in I<alpha> to I<beta>, and any memory "
4399 "held by these processes on memory nodes 2-3 to memory nodes 8-9, "
4404 #: build/C/man7/cpuset.7:1457
4405 msgid "Notice that the last step of the above sequence did not do:"
4409 #: build/C/man7/cpuset.7:1461
4411 msgid "$B< cp ../alpha/tasks tasks>\n"
4415 #: build/C/man7/cpuset.7:1472
4417 "The I<while> loop, rather than the seemingly easier use of the B<cp>(1) "
4418 "command, was necessary because only one process PID at a time may be written "
4419 "to the I<tasks> file."
4423 #: build/C/man7/cpuset.7:1480
4425 "The same effect (writing one PID at a time) as the I<while> loop can be "
4426 "accomplished more efficiently, in fewer keystrokes and in syntax that works "
4427 "on any shell, but alas more obscurely, by using the B<-u> (unbuffered) "
4428 "option of B<sed>(1):"
4432 #: build/C/man7/cpuset.7:1484
4434 msgid "$B< sed -un p E<lt> ../alpha/tasks E<gt> tasks>\n"
4438 #: build/C/man7/cpuset.7:1501
4440 "B<taskset>(1), B<get_mempolicy>(2), B<getcpu>(2), B<mbind>(2), "
4441 "B<sched_getaffinity>(2), B<sched_setaffinity>(2), B<sched_setscheduler>(2), "
4442 "B<set_mempolicy>(2), B<CPU_SET>(3), B<proc>(5), B<numa>(7), "
4443 "B<migratepages>(8), B<numactl>(8)"
4447 #: build/C/man7/cpuset.7:1504
4448 msgid "The kernel source file I<Documentation/cpusets.txt>."
4452 #: build/C/man7/credentials.7:25
4458 #: build/C/man7/credentials.7:25
4464 #: build/C/man7/credentials.7:28
4465 msgid "credentials - process identifiers"
4469 #: build/C/man7/credentials.7:29
4471 msgid "Process ID (PID)"
4475 #: build/C/man7/credentials.7:39
4477 "Each process has a unique nonnegative integer identifier that is assigned "
4478 "when the process is created using B<fork>(2). A process can obtain its PID "
4479 "using B<getpid>(2). A PID is represented using the type I<pid_t> (defined "
4480 "in I<E<lt>sys/types.hE<gt>>)."
4483 #. .BR sched_rr_get_interval (2),
4484 #. .BR sched_getaffinity (2),
4485 #. .BR sched_setaffinity (2),
4486 #. .BR sched_getparam (2),
4487 #. .BR sched_setparam (2),
4488 #. .BR sched_setscheduler (2),
4489 #. .BR sched_getscheduler (2),
4494 #: build/C/man7/credentials.7:60
4496 "PIDs are used in a range of system calls to identify the process affected by "
4497 "the call, for example: B<kill>(2), B<ptrace>(2), B<setpriority>(2) "
4498 "B<setpgid>(2), B<setsid>(2), B<sigqueue>(3), and B<waitpid>(2)."
4502 #: build/C/man7/credentials.7:63
4503 msgid "A process's PID is preserved across an B<execve>(2)."
4507 #: build/C/man7/credentials.7:63
4509 msgid "Parent Process ID (PPID)"
4513 #: build/C/man7/credentials.7:71
4515 "A process's parent process ID identifies the process that created this "
4516 "process using B<fork>(2). A process can obtain its PPID using "
4517 "B<getppid>(2). A PPID is represented using the type I<pid_t>."
4521 #: build/C/man7/credentials.7:74
4522 msgid "A process's PPID is preserved across an B<execve>(2)."
4526 #: build/C/man7/credentials.7:74
4528 msgid "Process Group ID and Session ID"
4532 #: build/C/man7/credentials.7:82
4534 "Each process has a session ID and a process group ID, both represented using "
4535 "the type I<pid_t>. A process can obtain its session ID using B<getsid>(2), "
4536 "and its process group ID using B<getpgrp>(2)."
4540 #: build/C/man7/credentials.7:88
4542 "A child created by B<fork>(2) inherits its parent's session ID and process "
4543 "group ID. A process's session ID and process group ID are preserved across "
4548 #: build/C/man7/credentials.7:101
4550 "Sessions and process groups are abstractions devised to support shell job "
4551 "control. A process group (sometimes called a \"job\") is a collection of "
4552 "processes that share the same process group ID; the shell creates a new "
4553 "process group for the process(es) used to execute single command or pipeline "
4554 "(e.g., the two processes created to execute the command \"ls\\ |\\ wc\" are "
4555 "placed in the same process group). A process's group membership can be set "
4556 "using B<setpgid>(2). The process whose process ID is the same as its "
4557 "process group ID is the I<process group leader> for that group."
4561 #: build/C/man7/credentials.7:113
4563 "A session is a collection of processes that share the same session ID. All "
4564 "of the members of a process group also have the same session ID (i.e., all "
4565 "of the members of a process group always belong to the same session, so that "
4566 "sessions and process groups form a strict two-level hierarchy of processes.) "
4567 "A new session is created when a process calls B<setsid>(2), which creates a "
4568 "new session whose session ID is the same as the PID of the process that "
4569 "called B<setsid>(2). The creator of the session is called the I<session "
4574 #: build/C/man7/credentials.7:113
4576 msgid "User and Group Identifiers"
4580 #: build/C/man7/credentials.7:121
4582 "Each process has various associated user and groups IDs. These IDs are "
4583 "integers, respectively represented using the types I<uid_t> and I<gid_t> "
4584 "(defined in I<E<lt>sys/types.hE<gt>>)."
4588 #: build/C/man7/credentials.7:123
4589 msgid "On Linux, each process has the following user and group identifiers:"
4593 #: build/C/man7/credentials.7:129
4595 "Real user ID and real group ID. These IDs determine who owns the process. "
4596 "A process can obtain its real user (group) ID using B<getuid>(2) "
4601 #: build/C/man7/credentials.7:141
4603 "Effective user ID and effective group ID. These IDs are used by the kernel "
4604 "to determine the permissions that the process will have when accessing "
4605 "shared resources such as message queues, shared memory, and semaphores. On "
4606 "most UNIX systems, these IDs also determine the permissions when accessing "
4607 "files. However, Linux uses the file system IDs described below for this "
4608 "task. A process can obtain its effective user (group) ID using "
4609 "B<geteuid>(2) (B<getegid>(2))."
4613 #: build/C/man7/credentials.7:163
4615 "Saved set-user-ID and saved set-group-ID. These IDs are used in set-user-ID "
4616 "and set-group-ID programs to save a copy of the corresponding effective IDs "
4617 "that were set when the program was executed (see B<execve>(2)). A "
4618 "set-user-ID program can assume and drop privileges by switching its "
4619 "effective user ID back and forth between the values in its real user ID and "
4620 "saved set-user-ID. This switching is done via calls to B<seteuid>(2), "
4621 "B<setreuid>(2), or B<setresuid>(2). A set-group-ID program performs the "
4622 "analogous tasks using B<setegid>(2), B<setregid>(2), or B<setresgid>(2). A "
4623 "process can obtain its saved set-user-ID (set-group-ID) using "
4624 "B<getresuid>(2) (B<getresgid>(2))."
4628 #: build/C/man7/credentials.7:180
4630 "File system user ID and file system group ID (Linux-specific). These IDs, "
4631 "in conjunction with the supplementary group IDs described below, are used to "
4632 "determine permissions for accessing files; see B<path_resolution>(7) for "
4633 "details. Whenever a process's effective user (group) ID is changed, the "
4634 "kernel also automatically changes the file system user (group) ID to the "
4635 "same value. Consequently, the file system IDs normally have the same values "
4636 "as the corresponding effective ID, and the semantics for file-permission "
4637 "checks are thus the same on Linux as on other UNIX systems. The file system "
4638 "IDs can be made to differ from the effective IDs by calling B<setfsuid>(2) "
4639 "and B<setfsgid>(2)."
4642 #. Since kernel 2.6.4, the limit is visible via the read-only file
4643 #. /proc/sys/kernel/ngroups_max.
4644 #. As at 2.6.22-rc2, this file is still read-only.
4646 #: build/C/man7/credentials.7:199
4648 "Supplementary group IDs. This is a set of additional group IDs that are "
4649 "used for permission checks when accessing files and other shared resources. "
4650 "On Linux kernels before 2.6.4, a process can be a member of up to 32 "
4651 "supplementary groups; since kernel 2.6.4, a process can be a member of up to "
4652 "65536 supplementary groups. The call I<sysconf(_SC_NGROUPS_MAX)> can be "
4653 "used to determine the number of supplementary groups of which a process may "
4654 "be a member. A process can obtain its set of supplementary group IDs using "
4655 "B<getgroups>(2), and can modify the set using B<setgroups>(2)."
4659 #: build/C/man7/credentials.7:209
4661 "A child process created by B<fork>(2) inherits copies of its parent's user "
4662 "and groups IDs. During an B<execve>(2), a process's real user and group ID "
4663 "and supplementary group IDs are preserved; the effective and saved set IDs "
4664 "may be changed, as described in B<execve>(2)."
4668 #: build/C/man7/credentials.7:212
4670 "Aside from the purposes noted above, a process's user IDs are also employed "
4671 "in a number of other contexts:"
4675 #: build/C/man7/credentials.7:215
4676 msgid "when determining the permissions for sending signals\\(emsee B<kill>(2);"
4680 #: build/C/man7/credentials.7:225
4682 "when determining the permissions for setting process-scheduling parameters "
4683 "(nice value, real time scheduling policy and priority, CPU affinity, I/O "
4684 "priority) using B<setpriority>(2), B<sched_setaffinity>(2), "
4685 "B<sched_setscheduler>(2), B<sched_setparam>(2), and B<ioprio_set>(2);"
4689 #: build/C/man7/credentials.7:228
4690 msgid "when checking resource limits; see B<getrlimit>(2);"
4694 #: build/C/man7/credentials.7:232
4696 "when checking the limit on the number of inotify instances that the process "
4697 "may create; see B<inotify>(7)."
4701 #: build/C/man7/credentials.7:238
4703 "Process IDs, parent process IDs, process group IDs, and session IDs are "
4704 "specified in POSIX.1-2001. The real, effective, and saved set user and "
4705 "groups IDs, and the supplementary group IDs, are specified in POSIX.1-2001. "
4706 "The file system user and group IDs are a Linux extension."
4710 #: build/C/man7/credentials.7:250
4712 "The POSIX threads specification requires that credentials are shared by all "
4713 "of the threads in a process. However, at the kernel level, Linux maintains "
4714 "separate user and group credentials for each thread. The NPTL threading "
4715 "implementation does some work to ensure that any change to user or group "
4716 "credentials (e.g., calls to B<setuid>(2), B<setresuid>(2), etc.) is carried "
4717 "through to all of the POSIX threads in a process."
4721 #: build/C/man7/credentials.7:281
4723 "B<bash>(1), B<csh>(1), B<ps>(1), B<access>(2), B<execve>(2), "
4724 "B<faccessat>(2), B<fork>(2), B<getpgrp>(2), B<getpid>(2), B<getppid>(2), "
4725 "B<getsid>(2), B<kill>(2), B<killpg>(2), B<setegid>(2), B<seteuid>(2), "
4726 "B<setfsgid>(2), B<setfsuid>(2), B<setgid>(2), B<setgroups>(2), "
4727 "B<setresgid>(2), B<setresuid>(2), B<setuid>(2), B<waitpid>(2), "
4728 "B<euidaccess>(3), B<initgroups>(3), B<tcgetpgrp>(3), B<tcsetpgrp>(3), "
4729 "B<capabilities>(7), B<path_resolution>(7), B<unix>(7)"
4733 #: build/C/man2/getgid.2:25
4739 #: build/C/man2/getgid.2:25 build/C/man2/getgroups.2:31 build/C/man2/getresuid.2:27 build/C/man2/getuid.2:26 build/C/man2/setfsgid.2:29 build/C/man2/setfsuid.2:29 build/C/man2/setgid.2:27 build/C/man2/setresuid.2:26 build/C/man2/setreuid.2:43 build/C/man2/setuid.2:28
4745 #: build/C/man2/getgid.2:28
4746 msgid "getgid, getegid - get group identity"
4750 #: build/C/man2/getgid.2:30 build/C/man2/getgroups.2:38 build/C/man2/getpid.2:30 build/C/man2/getresuid.2:34 build/C/man2/getsid.2:30 build/C/man2/getuid.2:31 build/C/man2/seteuid.2:34 build/C/man2/setgid.2:34 build/C/man2/setpgid.2:51 build/C/man2/setresuid.2:33 build/C/man2/setreuid.2:50 build/C/man2/setsid.2:35 build/C/man2/setuid.2:35
4751 msgid "B<#include E<lt>unistd.hE<gt>>"
4755 #: build/C/man2/getgid.2:32 build/C/man2/getgroups.2:36 build/C/man2/getpid.2:28 build/C/man2/getuid.2:33 build/C/man2/seteuid.2:32 build/C/man2/setgid.2:32 build/C/man2/setreuid.2:48 build/C/man2/setuid.2:33
4756 msgid "B<#include E<lt>sys/types.hE<gt>>"
4760 #: build/C/man2/getgid.2:34
4761 msgid "B<gid_t getgid(void);>"
4765 #: build/C/man2/getgid.2:36
4766 msgid "B<gid_t getegid(void);>"
4770 #: build/C/man2/getgid.2:39
4771 msgid "B<getgid>() returns the real group ID of the calling process."
4775 #: build/C/man2/getgid.2:42
4776 msgid "B<getegid>() returns the effective group ID of the calling process."
4780 #: build/C/man2/getgid.2:44 build/C/man2/getpid.2:44 build/C/man2/getuid.2:45
4781 msgid "These functions are always successful."
4785 #: build/C/man2/getgid.2:46 build/C/man2/getuid.2:47
4786 msgid "POSIX.1-2001, 4.3BSD."
4790 #: build/C/man2/getgid.2:62
4792 "The original Linux B<getgid>() and B<getegid>() system calls supported "
4793 "only 16-bit group IDs. Subsequently, Linux 2.4 added B<getgid32>() and "
4794 "B<getegid32>(), supporting 32-bit IDs. The glibc B<getgid>() and "
4795 "B<getegid>() wrapper functions transparently deal with the variations "
4796 "across kernel versions."
4800 #: build/C/man2/getgid.2:67
4801 msgid "B<getresgid>(2), B<setgid>(2), B<setregid>(2), B<credentials>(7)"
4805 #: build/C/man2/getgroups.2:31
4811 #: build/C/man2/getgroups.2:34
4812 msgid "getgroups, setgroups - get/set list of supplementary group IDs"
4816 #: build/C/man2/getgroups.2:40
4817 msgid "B<int getgroups(int >I<size>B<, gid_t >I<list>B<[]);>"
4821 #: build/C/man2/getgroups.2:42
4822 msgid "B<#include E<lt>grp.hE<gt>>"
4826 #: build/C/man2/getgroups.2:44
4827 msgid "B<int setgroups(size_t >I<size>B<, const gid_t *>I<list>B<);>"
4831 #: build/C/man2/getgroups.2:52
4832 msgid "B<setgroups>(): _BSD_SOURCE"
4836 #: build/C/man2/getgroups.2:70
4838 "B<getgroups>() returns the supplementary group IDs of the calling process "
4839 "in I<list>. The argument I<size> should be set to the maximum number of "
4840 "items that can be stored in the buffer pointed to by I<list>. If the "
4841 "calling process is a member of more than I<size> supplementary groups, then "
4842 "an error results. It is unspecified whether the effective group ID of the "
4843 "calling process is included in the returned list. (Thus, an application "
4844 "should also call B<getegid>(2) and add or remove the resulting value.)"
4848 #: build/C/man2/getgroups.2:81
4850 "If I<size> is zero, I<list> is not modified, but the total number of "
4851 "supplementary group IDs for the process is returned. This allows the caller "
4852 "to determine the size of a dynamically allocated I<list> to be used in a "
4853 "further call to B<getgroups>()."
4857 #: build/C/man2/getgroups.2:92
4859 "B<setgroups>() sets the supplementary group IDs for the calling process. "
4860 "Appropriate privileges (Linux: the B<CAP_SETGID> capability) are required. "
4861 "The I<size> argument specifies the number of supplementary group IDs in the "
4862 "buffer pointed to by I<list>."
4866 #: build/C/man2/getgroups.2:99
4868 "On success, B<getgroups>() returns the number of supplementary group IDs. "
4869 "On error, -1 is returned, and I<errno> is set appropriately."
4873 #: build/C/man2/getgroups.2:106
4875 "On success, B<setgroups>() returns 0. On error, -1 is returned, and "
4876 "I<errno> is set appropriately."
4880 #: build/C/man2/getgroups.2:111
4881 msgid "I<list> has an invalid address."
4885 #: build/C/man2/getgroups.2:114
4886 msgid "B<getgroups>() can additionally fail with the following error:"
4890 #: build/C/man2/getgroups.2:118
4891 msgid "I<size> is less than the number of supplementary group IDs, but is not zero."
4895 #: build/C/man2/getgroups.2:121
4896 msgid "B<setgroups>() can additionally fail with the following errors:"
4900 #: build/C/man2/getgroups.2:127
4902 "I<size> is greater than B<NGROUPS_MAX> (32 before Linux 2.6.4; 65536 since "
4907 #: build/C/man2/getgroups.2:133
4908 msgid "The calling process has insufficient privilege."
4912 #: build/C/man2/getgroups.2:141
4914 "SVr4, 4.3BSD. The B<getgroups>() function is in POSIX.1-2001. Since "
4915 "B<setgroups>() requires privilege, it is not covered by POSIX.1-2001."
4919 #: build/C/man2/getgroups.2:149
4921 "A process can have up to B<NGROUPS_MAX> supplementary group IDs in addition "
4922 "to the effective group ID. The set of supplementary group IDs is inherited "
4923 "from the parent process, and preserved across an B<execve>(2)."
4927 #: build/C/man2/getgroups.2:152
4929 "The maximum number of supplementary group IDs can be found using "
4934 #: build/C/man2/getgroups.2:156
4937 " long ngroups_max;\n"
4938 " ngroups_max = sysconf(_SC_NGROUPS_MAX);\n"
4942 #: build/C/man2/getgroups.2:161
4944 "The maximum return value of B<getgroups>() cannot be larger than one more "
4949 #: build/C/man2/getgroups.2:171
4951 "The original Linux B<getgroups>() system call supported only 16-bit group "
4952 "IDs. Subsequently, Linux 2.4 added B<getgroups32>(), supporting 32-bit "
4953 "IDs. The glibc B<getgroups>() wrapper function transparently deals with "
4954 "the variation across kernel versions."
4958 #: build/C/man2/getgroups.2:178
4960 "B<getgid>(2), B<setgid>(2), B<getgrouplist>(3), B<initgroups>(3), "
4961 "B<capabilities>(7), B<credentials>(7)"
4965 #: build/C/man2/getpid.2:23
4971 #: build/C/man2/getpid.2:23
4977 #: build/C/man2/getpid.2:26
4978 msgid "getpid, getppid - get process identification"
4982 #: build/C/man2/getpid.2:32
4983 msgid "B<pid_t getpid(void);>"
4987 #: build/C/man2/getpid.2:34
4988 msgid "B<pid_t getppid(void);>"
4992 #: build/C/man2/getpid.2:39
4994 "B<getpid>() returns the process ID of the calling process. (This is often "
4995 "used by routines that generate unique temporary filenames.)"
4999 #: build/C/man2/getpid.2:42
5000 msgid "B<getppid>() returns the process ID of the parent of the calling process."
5004 #: build/C/man2/getpid.2:46
5005 msgid "POSIX.1-2001, 4.3BSD, SVr4."
5008 #. The following program demonstrates this "feature":
5010 #. #define _GNU_SOURCE
5011 #. #include <sys/syscall.h>
5012 #. #include <sys/wait.h>
5013 #. #include <stdio.h>
5014 #. #include <stdlib.h>
5015 #. #include <unistd.h>
5018 #. main(int argc, char *argv[])
5020 #. /* The following statement fills the getpid() cache */
5022 #. printf("parent PID = %ld
5023 #. ", (long) getpid());
5025 #. if (syscall(SYS_fork) == 0) {
5026 #. if (getpid() != syscall(SYS_getpid))
5027 #. printf("child getpid() mismatch: getpid()=%ld; "
5028 #. "syscall(SYS_getpid)=%ld
5030 #. (long) getpid(), (long) syscall(SYS_getpid));
5031 #. exit(EXIT_SUCCESS);
5036 #: build/C/man2/getpid.2:98
5038 "Since glibc version 2.3.4, the glibc wrapper function for B<getpid>() "
5039 "caches PIDs, so as to avoid additional system calls when a process calls "
5040 "B<getpid>() repeatedly. Normally this caching is invisible, but its "
5041 "correct operation relies on support in the wrapper functions for B<fork>(2), "
5042 "B<vfork>(2), and B<clone>(2): if an application bypasses the glibc wrappers "
5043 "for these system calls by using B<syscall>(2), then a call to B<getpid>() "
5044 "in the child will return the wrong value (to be precise: it will return the "
5045 "PID of the parent process). See also B<clone>(2) for discussion of a case "
5046 "where B<getpid>() may return the wrong value even when invoking B<clone>(2) "
5047 "via the glibc wrapper function."
5051 #: build/C/man2/getpid.2:108
5053 "B<clone>(2), B<fork>(2), B<kill>(2), B<exec>(3), B<mkstemp>(3), "
5054 "B<tempnam>(3), B<tmpfile>(3), B<tmpnam>(3), B<credentials>(7)"
5058 #: build/C/man2/getpriority.2:46
5064 #: build/C/man2/getpriority.2:46
5070 #: build/C/man2/getpriority.2:49
5071 msgid "getpriority, setpriority - get/set program scheduling priority"
5075 #: build/C/man2/getpriority.2:51 build/C/man2/getrlimit.2:69 build/C/man2/getrusage.2:44
5076 msgid "B<#include E<lt>sys/time.hE<gt>>"
5080 #: build/C/man2/getpriority.2:53 build/C/man2/getrlimit.2:71 build/C/man2/getrusage.2:46
5081 msgid "B<#include E<lt>sys/resource.hE<gt>>"
5085 #: build/C/man2/getpriority.2:55
5086 msgid "B<int getpriority(int >I<which>B<, int >I<who>B<);>"
5090 #: build/C/man2/getpriority.2:57
5091 msgid "B<int setpriority(int >I<which>B<, int >I<who>B<, int >I<prio>B<);>"
5095 #: build/C/man2/getpriority.2:68
5097 "The scheduling priority of the process, process group, or user, as indicated "
5098 "by I<which> and I<who> is obtained with the B<getpriority>() call and set "
5099 "with the B<setpriority>() call."
5103 #: build/C/man2/getpriority.2:95
5105 "The value I<which> is one of B<PRIO_PROCESS>, B<PRIO_PGRP>, or B<PRIO_USER>, "
5106 "and I<who> is interpreted relative to I<which> (a process identifier for "
5107 "B<PRIO_PROCESS>, process group identifier for B<PRIO_PGRP>, and a user ID "
5108 "for B<PRIO_USER>). A zero value for I<who> denotes (respectively) the "
5109 "calling process, the process group of the calling process, or the real user "
5110 "ID of the calling process. I<Prio> is a value in the range -20 to 19 (but "
5111 "see the Notes below). The default priority is 0; lower priorities cause "
5112 "more favorable scheduling."
5116 #: build/C/man2/getpriority.2:105
5118 "The B<getpriority>() call returns the highest priority (lowest numerical "
5119 "value) enjoyed by any of the specified processes. The B<setpriority>() "
5120 "call sets the priorities of all of the specified processes to the specified "
5121 "value. Only the superuser may lower priorities."
5125 #: build/C/man2/getpriority.2:118
5127 "Since B<getpriority>() can legitimately return the value -1, it is "
5128 "necessary to clear the external variable I<errno> prior to the call, then "
5129 "check it afterward to determine if -1 is an error or a legitimate value. "
5130 "The B<setpriority>() call returns 0 if there is no error, or -1 if there "
5135 #: build/C/man2/getpriority.2:127
5136 msgid "I<which> was not one of B<PRIO_PROCESS>, B<PRIO_PGRP>, or B<PRIO_USER>."
5140 #: build/C/man2/getpriority.2:134
5141 msgid "No process was located using the I<which> and I<who> values specified."
5145 #: build/C/man2/getpriority.2:138
5146 msgid "In addition to the errors indicated above, B<setpriority>() may fail if:"
5150 #: build/C/man2/getpriority.2:150
5152 "The caller attempted to lower a process priority, but did not have the "
5153 "required privilege (on Linux: did not have the B<CAP_SYS_NICE> capability). "
5154 "Since Linux 2.6.12, this error only occurs if the caller attempts to set a "
5155 "process priority outside the range of the B<RLIMIT_NICE> soft resource limit "
5156 "of the target process; see B<getrlimit>(2) for details."
5160 #: build/C/man2/getpriority.2:158
5162 "A process was located, but its effective user ID did not match either the "
5163 "effective or the real user ID of the caller, and was not privileged (on "
5164 "Linux: did not have the B<CAP_SYS_NICE> capability). But see NOTES below."
5168 #: build/C/man2/getpriority.2:161
5169 msgid "SVr4, 4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
5173 #: build/C/man2/getpriority.2:167
5175 "A child created by B<fork>(2) inherits its parent's nice value. The nice "
5176 "value is preserved across B<execve>(2)."
5180 #: build/C/man2/getpriority.2:178
5182 "The degree to which their relative nice value affects the scheduling of "
5183 "processes varies across UNIX systems, and, on Linux, across kernel "
5184 "versions. Starting with kernel 2.6.23, Linux adopted an algorithm that "
5185 "causes relative differences in nice values to have a much stronger effect. "
5186 "This causes very low nice values (+19) to truly provide little CPU to a "
5187 "process whenever there is any other higher priority load on the system, and "
5188 "makes high nice values (-20) deliver most of the CPU to applications that "
5189 "require it (e.g., some audio applications)."
5193 #: build/C/man2/getpriority.2:193
5195 "The details on the condition for B<EPERM> depend on the system. The above "
5196 "description is what POSIX.1-2001 says, and seems to be followed on all "
5197 "System V-like systems. Linux kernels before 2.6.12 required the real or "
5198 "effective user ID of the caller to match the real user of the process I<who> "
5199 "(instead of its effective user ID). Linux 2.6.12 and later require the "
5200 "effective user ID of the caller to match the real or effective user ID of "
5201 "the process I<who>. All BSD-like systems (SunOS 4.1.3, Ultrix 4.2, 4.3BSD, "
5202 "FreeBSD 4.3, OpenBSD-2.5, ...) behave in the same manner as Linux 2.6.12 and "
5207 #: build/C/man2/getpriority.2:209
5209 "The actual priority range varies between kernel versions. Linux before "
5210 "1.3.36 had -infinity..15. Since kernel 1.3.43 Linux has the range -20..19. "
5211 "Within the kernel, nice values are actually represented using the "
5212 "corresponding range 40..1 (since negative numbers are error codes) and these "
5213 "are the values employed by the B<setpriority>() and B<getpriority>() "
5214 "system calls. The glibc wrapper functions for these system calls handle the "
5215 "translations between the user-land and kernel representations of the nice "
5216 "value according to the formula I<unice\\ =\\ 20\\ -\\ knice>."
5220 #: build/C/man2/getpriority.2:211
5221 msgid "On some systems, the range of nice values is -20..20."
5225 #: build/C/man2/getpriority.2:223
5227 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
5228 "portability. (Indeed, I<E<lt>sys/resource.hE<gt>> defines the I<rusage> "
5229 "structure with fields of type I<struct timeval> defined in "
5230 "I<E<lt>sys/time.hE<gt>>.)"
5234 #: build/C/man2/getpriority.2:228
5235 msgid "B<nice>(1), B<renice>(1), B<fork>(2), B<capabilities>(7)"
5239 #: build/C/man2/getpriority.2:231
5241 "I<Documentation/scheduler/sched-nice-design.txt> in the kernel source tree "
5242 "(since Linux 2.6.23)."
5246 #: build/C/man2/getresuid.2:27
5252 #: build/C/man2/getresuid.2:30
5253 msgid "getresuid, getresgid - get real, effective and saved user/group IDs"
5257 #: build/C/man2/getresuid.2:32 build/C/man2/setresuid.2:31
5258 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
5262 #: build/C/man2/getresuid.2:36
5263 msgid "B<int getresuid(uid_t *>I<ruid>B<, uid_t *>I<euid>B<, uid_t *>I<suid>B<);>"
5267 #: build/C/man2/getresuid.2:38
5268 msgid "B<int getresgid(gid_t *>I<rgid>B<, gid_t *>I<egid>B<, gid_t *>I<sgid>B<);>"
5272 #: build/C/man2/getresuid.2:49
5274 "B<getresuid>() returns the real UID, the effective UID, and the saved "
5275 "set-user-ID of the calling process, in the arguments I<ruid>, I<euid>, and "
5276 "I<suid>, respectively. B<getresgid>() performs the analogous task for the "
5277 "process's group IDs."
5281 #: build/C/man2/getresuid.2:59
5283 "One of the arguments specified an address outside the calling program's "
5288 #: build/C/man2/getresuid.2:61
5289 msgid "These system calls appeared on Linux starting with kernel 2.1.44."
5293 #: build/C/man2/getresuid.2:66
5295 "The prototypes are given by glibc since version 2.3.2, provided "
5296 "B<_GNU_SOURCE> is defined."
5300 #: build/C/man2/getresuid.2:69 build/C/man2/setresuid.2:86
5301 msgid "These calls are nonstandard; they also appear on HP-UX and some of the BSDs."
5305 #: build/C/man2/getresuid.2:85
5307 "The original Linux B<getresuid>() and B<getresgid>() system calls "
5308 "supported only 16-bit user and group IDs. Subsequently, Linux 2.4 added "
5309 "B<getresuid32>() and B<getresgid32>(), supporting 32-bit IDs. The glibc "
5310 "B<getresuid>() and B<getresgid>() wrapper functions transparently deal "
5311 "with the variations across kernel versions."
5315 #: build/C/man2/getresuid.2:91
5317 "B<getuid>(2), B<setresuid>(2), B<setreuid>(2), B<setuid>(2), "
5322 #: build/C/man2/getrlimit.2:64
5328 #: build/C/man2/getrlimit.2:64
5334 #: build/C/man2/getrlimit.2:67
5335 msgid "getrlimit, setrlimit, prlimit - get/set resource limits"
5339 #: build/C/man2/getrlimit.2:73
5340 msgid "B<int getrlimit(int >I<resource>B<, struct rlimit *>I<rlim>B<);>"
5344 #: build/C/man2/getrlimit.2:75
5345 msgid "B<int setrlimit(int >I<resource>B<, const struct rlimit *>I<rlim>B<);>"
5349 #: build/C/man2/getrlimit.2:78
5351 "B<int prlimit(pid_t >I<pid>B<, int >I<resource>B<, const struct rlimit "
5352 "*>I<new_limit>B<,>"
5356 #: build/C/man2/getrlimit.2:80
5357 msgid "B< struct rlimit *>I<old_limit>B<);>"
5361 #: build/C/man2/getrlimit.2:88
5362 msgid "B<prlimit>(): _GNU_SOURCE && _FILE_OFFSET_BITS == 64"
5366 #: build/C/man2/getrlimit.2:97
5368 "The B<getrlimit>() and B<setrlimit>() system calls get and set resource "
5369 "limits respectively. Each resource has an associated soft and hard limit, "
5370 "as defined by the I<rlimit> structure:"
5374 #: build/C/man2/getrlimit.2:104
5378 " rlim_t rlim_cur; /* Soft limit */\n"
5379 " rlim_t rlim_max; /* Hard limit (ceiling for rlim_cur) */\n"
5384 #: build/C/man2/getrlimit.2:115
5386 "The soft limit is the value that the kernel enforces for the corresponding "
5387 "resource. The hard limit acts as a ceiling for the soft limit: an "
5388 "unprivileged process may only set its soft limit to a value in the range "
5389 "from 0 up to the hard limit, and (irreversibly) lower its hard limit. A "
5390 "privileged process (under Linux: one with the B<CAP_SYS_RESOURCE> "
5391 "capability) may make arbitrary changes to either limit value."
5395 #: build/C/man2/getrlimit.2:122
5397 "The value B<RLIM_INFINITY> denotes no limit on a resource (both in the "
5398 "structure returned by B<getrlimit>() and in the structure passed to "
5403 #: build/C/man2/getrlimit.2:126
5404 msgid "The I<resource> argument must be one of:"
5408 #: build/C/man2/getrlimit.2:126
5410 msgid "B<RLIMIT_AS>"
5413 #. since 2.0.27 / 2.1.12
5415 #: build/C/man2/getrlimit.2:146
5417 "The maximum size of the process's virtual memory (address space) in bytes. "
5418 "This limit affects calls to B<brk>(2), B<mmap>(2) and B<mremap>(2), which "
5419 "fail with the error B<ENOMEM> upon exceeding this limit. Also automatic "
5420 "stack expansion will fail (and generate a B<SIGSEGV> that kills the process "
5421 "if no alternate stack has been made available via B<sigaltstack>(2)). Since "
5422 "the value is a I<long>, on machines with a 32-bit I<long> either this limit "
5423 "is at most 2 GiB, or this resource is unlimited."
5427 #: build/C/man2/getrlimit.2:146
5429 msgid "B<RLIMIT_CORE>"
5433 #: build/C/man2/getrlimit.2:153
5435 "Maximum size of I<core> file. When 0 no core dump files are created. When "
5436 "nonzero, larger dumps are truncated to this size."
5440 #: build/C/man2/getrlimit.2:153
5442 msgid "B<RLIMIT_CPU>"
5446 #: build/C/man2/getrlimit.2:173
5448 "CPU time limit in seconds. When the process reaches the soft limit, it is "
5449 "sent a B<SIGXCPU> signal. The default action for this signal is to "
5450 "terminate the process. However, the signal can be caught, and the handler "
5451 "can return control to the main program. If the process continues to consume "
5452 "CPU time, it will be sent B<SIGXCPU> once per second until the hard limit is "
5453 "reached, at which time it is sent B<SIGKILL>. (This latter point describes "
5454 "Linux behavior. Implementations vary in how they treat processes which "
5455 "continue to consume CPU time after reaching the soft limit. Portable "
5456 "applications that need to catch this signal should perform an orderly "
5457 "termination upon first receipt of B<SIGXCPU>.)"
5461 #: build/C/man2/getrlimit.2:173
5463 msgid "B<RLIMIT_DATA>"
5467 #: build/C/man2/getrlimit.2:184
5469 "The maximum size of the process's data segment (initialized data, "
5470 "uninitialized data, and heap). This limit affects calls to B<brk>(2) and "
5471 "B<sbrk>(2), which fail with the error B<ENOMEM> upon encountering the soft "
5472 "limit of this resource."
5476 #: build/C/man2/getrlimit.2:184
5478 msgid "B<RLIMIT_FSIZE>"
5482 #: build/C/man2/getrlimit.2:196
5484 "The maximum size of files that the process may create. Attempts to extend a "
5485 "file beyond this limit result in delivery of a B<SIGXFSZ> signal. By "
5486 "default, this signal terminates a process, but a process can catch this "
5487 "signal instead, in which case the relevant system call (e.g., B<write>(2), "
5488 "B<truncate>(2)) fails with the error B<EFBIG>."
5492 #: build/C/man2/getrlimit.2:196
5494 msgid "B<RLIMIT_LOCKS> (Early Linux 2.4 only)"
5497 #. to be precise: Linux 2.4.0-test9; no longer in 2.4.25 / 2.5.65
5499 #: build/C/man2/getrlimit.2:204
5501 "A limit on the combined number of B<flock>(2) locks and B<fcntl>(2) leases "
5502 "that this process may establish."
5506 #: build/C/man2/getrlimit.2:204
5508 msgid "B<RLIMIT_MEMLOCK>"
5512 #: build/C/man2/getrlimit.2:242
5514 "The maximum number of bytes of memory that may be locked into RAM. In "
5515 "effect this limit is rounded down to the nearest multiple of the system page "
5516 "size. This limit affects B<mlock>(2) and B<mlockall>(2) and the "
5517 "B<mmap>(2) B<MAP_LOCKED> operation. Since Linux 2.6.9 it also affects the "
5518 "B<shmctl>(2) B<SHM_LOCK> operation, where it sets a maximum on the total "
5519 "bytes in shared memory segments (see B<shmget>(2)) that may be locked by "
5520 "the real user ID of the calling process. The B<shmctl>(2) B<SHM_LOCK> "
5521 "locks are accounted for separately from the per-process memory locks "
5522 "established by B<mlock>(2), B<mlockall>(2), and B<mmap>(2) B<MAP_LOCKED>; a "
5523 "process can lock bytes up to this limit in each of these two categories. In "
5524 "Linux kernels before 2.6.9, this limit controlled the amount of memory that "
5525 "could be locked by a privileged process. Since Linux 2.6.9, no limits are "
5526 "placed on the amount of memory that a privileged process may lock, and this "
5527 "limit instead governs the amount of memory that an unprivileged process may "
5532 #: build/C/man2/getrlimit.2:242
5534 msgid "B<RLIMIT_MSGQUEUE> (Since Linux 2.6.8)"
5538 #: build/C/man2/getrlimit.2:250
5540 "Specifies the limit on the number of bytes that can be allocated for POSIX "
5541 "message queues for the real user ID of the calling process. This limit is "
5542 "enforced for B<mq_open>(3). Each message queue that the user creates counts "
5543 "(until it is removed) against this limit according to the formula:"
5547 #: build/C/man2/getrlimit.2:254
5550 " bytes = attr.mq_maxmsg * sizeof(struct msg_msg *) +\n"
5551 " attr.mq_maxmsg * attr.mq_msgsize\n"
5555 #: build/C/man2/getrlimit.2:262
5557 "where I<attr> is the I<mq_attr> structure specified as the fourth argument "
5562 #: build/C/man2/getrlimit.2:268
5564 "The first addend in the formula, which includes I<sizeof(struct msg_msg *)> "
5565 "(4 bytes on Linux/i386), ensures that the user cannot create an unlimited "
5566 "number of zero-length messages (such messages nevertheless each consume some "
5567 "system memory for bookkeeping overhead)."
5571 #: build/C/man2/getrlimit.2:268
5573 msgid "B<RLIMIT_NICE> (since Linux 2.6.12, but see BUGS below)"
5577 #: build/C/man2/getrlimit.2:281
5579 "Specifies a ceiling to which the process's nice value can be raised using "
5580 "B<setpriority>(2) or B<nice>(2). The actual ceiling for the nice value is "
5581 "calculated as I<20\\ -\\ rlim_cur>. (This strangeness occurs because "
5582 "negative numbers cannot be specified as resource limit values, since they "
5583 "typically have special meanings. For example, B<RLIM_INFINITY> typically is "
5588 #: build/C/man2/getrlimit.2:281
5590 msgid "B<RLIMIT_NOFILE>"
5594 #: build/C/man2/getrlimit.2:295
5596 "Specifies a value one greater than the maximum file descriptor number that "
5597 "can be opened by this process. Attempts (B<open>(2), B<pipe>(2), B<dup>(2), "
5598 "etc.) to exceed this limit yield the error B<EMFILE>. (Historically, this "
5599 "limit was named B<RLIMIT_OFILE> on BSD.)"
5603 #: build/C/man2/getrlimit.2:295
5605 msgid "B<RLIMIT_NPROC>"
5609 #: build/C/man2/getrlimit.2:303
5611 "The maximum number of processes (or, more precisely on Linux, threads) that "
5612 "can be created for the real user ID of the calling process. Upon "
5613 "encountering this limit, B<fork>(2) fails with the error B<EAGAIN>."
5617 #: build/C/man2/getrlimit.2:303
5619 msgid "B<RLIMIT_RSS>"
5622 #. As at kernel 2.6.12, this limit still does nothing in 2.6 though
5623 #. talk of making it do something has surfaced from time to time in LKML
5626 #: build/C/man2/getrlimit.2:315
5628 "Specifies the limit (in pages) of the process's resident set (the number of "
5629 "virtual pages resident in RAM). This limit only has effect in Linux 2.4.x, "
5630 "x E<lt> 30, and there only affects calls to B<madvise>(2) specifying "
5635 #: build/C/man2/getrlimit.2:315
5637 msgid "B<RLIMIT_RTPRIO> (Since Linux 2.6.12, but see BUGS)"
5641 #: build/C/man2/getrlimit.2:322
5643 "Specifies a ceiling on the real-time priority that may be set for this "
5644 "process using B<sched_setscheduler>(2) and B<sched_setparam>(2)."
5648 #: build/C/man2/getrlimit.2:322
5650 msgid "B<RLIMIT_RTTIME> (Since Linux 2.6.25)"
5654 #: build/C/man2/getrlimit.2:334
5656 "Specifies a limit (in microseconds) on the amount of CPU time that a "
5657 "process scheduled under a real-time scheduling policy may consume without "
5658 "making a blocking system call. For the purpose of this limit, each time a "
5659 "process makes a blocking system call, the count of its consumed CPU time is "
5660 "reset to zero. The CPU time count is not reset if the process continues "
5661 "trying to use the CPU but is preempted, its time slice expires, or it calls "
5662 "B<sched_yield>(2)."
5666 #: build/C/man2/getrlimit.2:345
5668 "Upon reaching the soft limit, the process is sent a B<SIGXCPU> signal. If "
5669 "the process catches or ignores this signal and continues consuming CPU time, "
5670 "then B<SIGXCPU> will be generated once each second until the hard limit is "
5671 "reached, at which point the process is sent a B<SIGKILL> signal."
5675 #: build/C/man2/getrlimit.2:348
5677 "The intended use of this limit is to stop a runaway real-time process from "
5678 "locking up the system."
5682 #: build/C/man2/getrlimit.2:348
5684 msgid "B<RLIMIT_SIGPENDING> (Since Linux 2.6.8)"
5687 #. This replaces the /proc/sys/kernel/rtsig-max system-wide limit
5688 #. that was present in kernels <= 2.6.7. MTK Dec 04
5690 #: build/C/man2/getrlimit.2:362
5692 "Specifies the limit on the number of signals that may be queued for the real "
5693 "user ID of the calling process. Both standard and real-time signals are "
5694 "counted for the purpose of checking this limit. However, the limit is only "
5695 "enforced for B<sigqueue>(3); it is always possible to use B<kill>(2) to "
5696 "queue one instance of any of the signals that are not already queued to the "
5701 #: build/C/man2/getrlimit.2:362
5703 msgid "B<RLIMIT_STACK>"
5707 #: build/C/man2/getrlimit.2:370
5709 "The maximum size of the process stack, in bytes. Upon reaching this limit, "
5710 "a B<SIGSEGV> signal is generated. To handle this signal, a process must "
5711 "employ an alternate signal stack (B<sigaltstack>(2))."
5715 #: build/C/man2/getrlimit.2:375
5717 "Since Linux 2.6.23, this limit also determines the amount of space used for "
5718 "the process's command-line arguments and environment variables; for details, "
5723 #: build/C/man2/getrlimit.2:375
5728 #. commit c022a0acad534fd5f5d5f17280f6d4d135e74e81
5729 #. Author: Jiri Slaby <jslaby@suse.cz>
5730 #. Date: Tue May 4 18:03:50 2010 +0200
5732 #: build/C/man2/getrlimit.2:386
5734 "The Linux-specific B<prlimit>() system call combines and extends the "
5735 "functionality of B<setrlimit>() and B<getrlimit>(). It can be used to both "
5736 "set and get the resource limits of an arbitrary process."
5740 #: build/C/man2/getrlimit.2:393
5742 "The I<resource> argument has the same meaning as for B<setrlimit>() and "
5747 #: build/C/man2/getrlimit.2:411
5749 "If the I<new_limit> argument is a not NULL, then the I<rlimit> structure to "
5750 "which it points is used to set new values for the soft and hard limits for "
5751 "I<resource>. If the I<old_limit> argument is a not NULL, then a successful "
5752 "call to B<prlimit>() places the previous soft and hard limits for "
5753 "I<resource> in the I<rlimit> structure pointed to by I<old_limit>."
5756 #. FIXME this permission check is strange
5757 #. Asked about this on LKML, 7 Nov 2010
5758 #. "Inconsistent credential checking in prlimit() syscall"
5760 #: build/C/man2/getrlimit.2:430
5762 "The I<pid> argument specifies the ID of the process on which the call is to "
5763 "operate. If I<pid> is 0, then the call applies to the calling process. To "
5764 "set or get the resources of a process other than itself, the caller must "
5765 "have the B<CAP_SYS_RESOURCE> capability, or the real, effective, and saved "
5766 "set user IDs of the target process must match the real user ID of the caller "
5767 "I<and> the real, effective, and saved set group IDs of the target process "
5768 "must match the real group ID of the caller."
5772 #: build/C/man2/getrlimit.2:435
5774 "On success, these system calls return 0. On error, -1 is returned, and "
5775 "I<errno> is set appropriately."
5779 #: build/C/man2/getrlimit.2:440
5781 "A pointer argument points to a location outside the accessible address "
5786 #: build/C/man2/getrlimit.2:452
5788 "The value specified in I<resource> is not valid; or, for B<setrlimit>() or "
5789 "B<prlimit>(): I<rlim-E<gt>rlim_cur> was greater than I<rlim-E<gt>rlim_max>."
5793 #: build/C/man2/getrlimit.2:464
5795 "An unprivileged process tried to raise the hard limit; the "
5796 "B<CAP_SYS_RESOURCE> capability is required to do this. Or, the caller tried "
5797 "to increase the hard B<RLIMIT_NOFILE> limit above the current kernel maximum "
5798 "(B<NR_OPEN>). Or, the calling process did not have permission to set limits "
5799 "for the process specified by I<pid>."
5803 #: build/C/man2/getrlimit.2:468
5804 msgid "Could not find a process with the ID specified in I<pid>."
5808 #: build/C/man2/getrlimit.2:473
5810 "The B<prlimit>() system call is available since Linux 2.6.36. Library "
5811 "support is available since glibc 2.13."
5815 #: build/C/man2/getrlimit.2:477
5816 msgid "B<getrlimit>(), B<setrlimit>(): SVr4, 4.3BSD, POSIX.1-2001."
5820 #: build/C/man2/getrlimit.2:480
5821 msgid "B<prlimit>(): Linux-specific."
5825 #: build/C/man2/getrlimit.2:496
5827 "B<RLIMIT_MEMLOCK> and B<RLIMIT_NPROC> derive from BSD and are not specified "
5828 "in POSIX.1-2001; they are present on the BSDs and Linux, but on few other "
5829 "implementations. B<RLIMIT_RSS> derives from BSD and is not specified in "
5830 "POSIX.1-2001; it is nevertheless present on most implementations. "
5831 "B<RLIMIT_MSGQUEUE>, B<RLIMIT_NICE>, B<RLIMIT_RTPRIO>, B<RLIMIT_RTTIME>, and "
5832 "B<RLIMIT_SIGPENDING> are Linux-specific."
5836 #: build/C/man2/getrlimit.2:502
5838 "A child process created via B<fork>(2) inherits its parent's resource "
5839 "limits. Resource limits are preserved across B<execve>(2)."
5843 #: build/C/man2/getrlimit.2:511
5845 "One can set the resource limits of the shell using the built-in I<ulimit> "
5846 "command (I<limit> in B<csh>(1)). The shell's resource limits are inherited "
5847 "by the processes that it creates to execute commands."
5851 #: build/C/man2/getrlimit.2:520
5853 "Ancient systems provided a B<vlimit>() function with a similar purpose to "
5854 "B<setrlimit>(). For backward compatibility, glibc also provides "
5855 "B<vlimit>(). All new applications should be written using B<setrlimit>()."
5859 #: build/C/man2/getrlimit.2:523
5860 msgid "The program below demonstrates the use of B<prlimit>()."
5864 #: build/C/man2/getrlimit.2:532
5867 "#define _GNU_SOURCE\n"
5868 "#define _FILE_OFFSET_BITS 64\n"
5869 "#include E<lt>stdio.hE<gt>\n"
5870 "#include E<lt>time.hE<gt>\n"
5871 "#include E<lt>stdlib.hE<gt>\n"
5872 "#include E<lt>unistd.hE<gt>\n"
5873 "#include E<lt>sys/resource.hE<gt>\n"
5877 #: build/C/man2/getrlimit.2:535
5880 "#define errExit(msg) \tdo { perror(msg); exit(EXIT_FAILURE); \\e\n"
5885 #: build/C/man2/getrlimit.2:542
5889 "main(int argc, char *argv[])\n"
5891 " struct rlimit old, new;\n"
5892 " struct rlimit *newp;\n"
5897 #: build/C/man2/getrlimit.2:548
5900 " if (!(argc == 2 || argc == 4)) {\n"
5901 " fprintf(stderr, \"Usage: %s E<lt>pidE<gt> [E<lt>new-soft-limitE<gt> "
5903 " \"E<lt>new-hard-limitE<gt>]\\en\", argv[0]);\n"
5904 " exit(EXIT_FAILURE);\n"
5909 #: build/C/man2/getrlimit.2:550
5911 msgid " pid = atoi(argv[1]); /* PID of target process */\n"
5915 #: build/C/man2/getrlimit.2:557
5919 " if (argc == 4) {\n"
5920 " new.rlim_cur = atoi(argv[2]);\n"
5921 " new.rlim_max = atoi(argv[3]);\n"
5927 #: build/C/man2/getrlimit.2:560
5930 " /* Set CPU time limit of target process; retrieve and display\n"
5931 " previous limit */\n"
5935 #: build/C/man2/getrlimit.2:565
5938 " if (prlimit(pid, RLIMIT_CPU, newp, &old) == -1)\n"
5939 " errExit(\"prlimit-1\");\n"
5940 " printf(\"Previous limits: soft=%lld; hard=%lld\\en\",\n"
5941 " (long long) old.rlim_cur, (long long) old.rlim_max);\n"
5945 #: build/C/man2/getrlimit.2:567
5947 msgid " /* Retrieve and display new CPU time limit */\n"
5951 #: build/C/man2/getrlimit.2:572
5954 " if (prlimit(pid, RLIMIT_CPU, NULL, &old) == -1)\n"
5955 " errExit(\"prlimit-2\");\n"
5956 " printf(\"New limits: soft=%lld; hard=%lld\\en\",\n"
5957 " (long long) old.rlim_cur, (long long) old.rlim_max);\n"
5961 #: build/C/man2/getrlimit.2:575
5964 " exit(EXIT_FAILURE);\n"
5968 #. FIXME prlimit() does not suffer
5969 #. https://bugzilla.kernel.org/show_bug.cgi?id=5042
5970 #. http://sources.redhat.com/bugzilla/show_bug.cgi?id=12201
5972 #: build/C/man2/getrlimit.2:588
5974 "In older Linux kernels, the B<SIGXCPU> and B<SIGKILL> signals delivered when "
5975 "a process encountered the soft and hard B<RLIMIT_CPU> limits were delivered "
5976 "one (CPU) second later than they should have been. This was fixed in kernel "
5980 #. see http://marc.theaimsgroup.com/?l=linux-kernel&m=114008066530167&w=2
5982 #: build/C/man2/getrlimit.2:596
5984 "In 2.6.x kernels before 2.6.17, a B<RLIMIT_CPU> limit of 0 is wrongly "
5985 "treated as \"no limit\" (like B<RLIM_INFINITY>). Since Linux 2.6.17, "
5986 "setting a limit of 0 does have an effect, but is actually treated as a limit "
5991 #: build/C/man2/getrlimit.2:600
5993 "A kernel bug means that B<RLIMIT_RTPRIO> does not work in kernel 2.6.12; the "
5994 "problem is fixed in kernel 2.6.13."
5997 #. see http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2
5999 #: build/C/man2/getrlimit.2:611
6001 "In kernel 2.6.12, there was an off-by-one mismatch between the priority "
6002 "ranges returned by B<getpriority>(2) and B<RLIMIT_NICE>. This had the "
6003 "effect that the actual ceiling for the nice value was calculated as I<19\\ "
6004 "-\\ rlim_cur>. This was fixed in kernel 2.6.13."
6008 #: build/C/man2/getrlimit.2:620
6010 "Kernels before 2.4.22 did not diagnose the error B<EINVAL> for "
6011 "B<setrlimit>() when I<rlim-E<gt>rlim_cur> was greater than "
6012 "I<rlim-E<gt>rlim_max>."
6016 #: build/C/man2/getrlimit.2:637
6018 "B<dup>(2), B<fcntl>(2), B<fork>(2), B<getrusage>(2), B<mlock>(2), "
6019 "B<mmap>(2), B<open>(2), B<quotactl>(2), B<sbrk>(2), B<shmctl>(2), "
6020 "B<malloc>(3), B<sigqueue>(3), B<ulimit>(3), B<core>(5), B<capabilities>(7), "
6025 #: build/C/man2/getrusage.2:39
6031 #: build/C/man2/getrusage.2:39 build/C/man2/getsid.2:25 build/C/man2/setpgid.2:46
6037 #: build/C/man2/getrusage.2:42
6038 msgid "getrusage - get resource usage"
6042 #: build/C/man2/getrusage.2:48
6043 msgid "B<int getrusage(int >I<who>B<, struct rusage *>I<usage>B<);>"
6047 #: build/C/man2/getrusage.2:54
6049 "B<getrusage>() returns resource usage measures for I<who>, which can be one "
6054 #: build/C/man2/getrusage.2:54
6056 msgid "B<RUSAGE_SELF>"
6060 #: build/C/man2/getrusage.2:58
6062 "Return resource usage statistics for the calling process, which is the sum "
6063 "of resources used by all threads in the process."
6067 #: build/C/man2/getrusage.2:58
6069 msgid "B<RUSAGE_CHILDREN>"
6073 #: build/C/man2/getrusage.2:65
6075 "Return resource usage statistics for all children of the calling process "
6076 "that have terminated and been waited for. These statistics will include the "
6077 "resources used by grandchildren, and further removed descendants, if all of "
6078 "the intervening descendants waited on their terminated children."
6082 #: build/C/man2/getrusage.2:65
6084 msgid "B<RUSAGE_THREAD> (since Linux 2.6.26)"
6088 #: build/C/man2/getrusage.2:68
6089 msgid "Return resource usage statistics for the calling thread."
6093 #: build/C/man2/getrusage.2:72
6095 "The resource usages are returned in the structure pointed to by I<usage>, "
6096 "which has the following form:"
6100 #: build/C/man2/getrusage.2:93
6104 " struct timeval ru_utime; /* user CPU time used */\n"
6105 " struct timeval ru_stime; /* system CPU time used */\n"
6106 " long ru_maxrss; /* maximum resident set size */\n"
6107 " long ru_ixrss; /* integral shared memory size */\n"
6108 " long ru_idrss; /* integral unshared data size */\n"
6109 " long ru_isrss; /* integral unshared stack size */\n"
6110 " long ru_minflt; /* page reclaims (soft page faults) */\n"
6111 " long ru_majflt; /* page faults (hard page faults) */\n"
6112 " long ru_nswap; /* swaps */\n"
6113 " long ru_inblock; /* block input operations */\n"
6114 " long ru_oublock; /* block output operations */\n"
6115 " long ru_msgsnd; /* IPC messages sent */\n"
6116 " long ru_msgrcv; /* IPC messages received */\n"
6117 " long ru_nsignals; /* signals received */\n"
6118 " long ru_nvcsw; /* voluntary context switches */\n"
6119 " long ru_nivcsw; /* involuntary context switches */\n"
6124 #: build/C/man2/getrusage.2:101
6126 "Not all fields are completed; unmaintained fields are set to zero by the "
6127 "kernel. (The unmaintained fields are provided for compatibility with other "
6128 "systems, and because they may one day be supported on Linux.) The fields "
6129 "are interpreted as follows:"
6133 #: build/C/man2/getrusage.2:101
6139 #: build/C/man2/getrusage.2:107
6141 "This is the total amount of time spent executing in user mode, expressed in "
6142 "a I<timeval> structure (seconds plus microseconds)."
6146 #: build/C/man2/getrusage.2:107
6152 #: build/C/man2/getrusage.2:113
6154 "This is the total amount of time spent executing in kernel mode, expressed "
6155 "in a I<timeval> structure (seconds plus microseconds)."
6159 #: build/C/man2/getrusage.2:113
6161 msgid "I<ru_maxrss> (since Linux 2.6.32)"
6165 #: build/C/man2/getrusage.2:119
6167 "This is the maximum resident set size used (in kilobytes). For "
6168 "B<RUSAGE_CHILDREN>, this is the resident set size of the largest child, not "
6169 "the maximum resident set size of the process tree."
6173 #: build/C/man2/getrusage.2:119
6175 msgid "I<ru_ixrss> (unmaintained)"
6178 #. On some systems, this field records the number of signals received.
6180 #: build/C/man2/getrusage.2:125 build/C/man2/getrusage.2:130 build/C/man2/getrusage.2:135 build/C/man2/getrusage.2:147 build/C/man2/getrusage.2:159 build/C/man2/getrusage.2:165 build/C/man2/getrusage.2:169
6181 msgid "This field is currently unused on Linux."
6185 #: build/C/man2/getrusage.2:125
6187 msgid "I<ru_idrss> (unmaintained)"
6191 #: build/C/man2/getrusage.2:130
6193 msgid "I<ru_isrss> (unmaintained)"
6197 #: build/C/man2/getrusage.2:135
6199 msgid "I<ru_minflt>"
6203 #: build/C/man2/getrusage.2:140
6205 "The number of page faults serviced without any I/O activity; here I/O "
6206 "activity is avoided by ``reclaiming'' a page frame from the list of pages "
6207 "awaiting reallocation."
6211 #: build/C/man2/getrusage.2:140
6213 msgid "I<ru_majflt>"
6217 #: build/C/man2/getrusage.2:143
6218 msgid "The number of page faults serviced that required I/O activity."
6222 #: build/C/man2/getrusage.2:143
6224 msgid "I<ru_nswap> (unmaintained)"
6228 #: build/C/man2/getrusage.2:147
6230 msgid "I<ru_inblock> (since Linux 2.6.22)"
6234 #: build/C/man2/getrusage.2:150
6235 msgid "The number of times the file system had to perform input."
6239 #: build/C/man2/getrusage.2:150
6241 msgid "I<ru_oublock> (since Linux 2.6.22)"
6245 #: build/C/man2/getrusage.2:153
6246 msgid "The number of times the file system had to perform output."
6250 #: build/C/man2/getrusage.2:153
6252 msgid "I<ru_msgsnd> (unmaintained)"
6256 #: build/C/man2/getrusage.2:159
6258 msgid "I<ru_msgrcv> (unmaintained)"
6262 #: build/C/man2/getrusage.2:165
6264 msgid "I<ru_nsignals> (unmaintained)"
6268 #: build/C/man2/getrusage.2:169
6270 msgid "I<ru_nvcsw> (since Linux 2.6)"
6274 #: build/C/man2/getrusage.2:174
6276 "The number of times a context switch resulted due to a process voluntarily "
6277 "giving up the processor before its time slice was completed (usually to "
6278 "await availability of a resource)."
6282 #: build/C/man2/getrusage.2:174
6284 msgid "I<ru_nivcsw> (since Linux 2.6)"
6288 #: build/C/man2/getrusage.2:179
6290 "The number of times a context switch resulted due to a higher priority "
6291 "process becoming runnable or because the current process exceeded its time "
6296 #: build/C/man2/getrusage.2:190
6297 msgid "I<usage> points outside the accessible address space."
6301 #: build/C/man2/getrusage.2:194
6302 msgid "I<who> is invalid."
6306 #: build/C/man2/getrusage.2:202
6308 "SVr4, 4.3BSD. POSIX.1-2001 specifies B<getrusage>(), but only specifies the "
6309 "fields I<ru_utime> and I<ru_stime>."
6313 #: build/C/man2/getrusage.2:205
6314 msgid "B<RUSAGE_THREAD> is Linux-specific."
6318 #: build/C/man2/getrusage.2:208
6319 msgid "Resource usage metrics are preserved across an B<execve>(2)."
6323 #: build/C/man2/getrusage.2:216
6325 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
6326 "portability. (Indeed, I<struct timeval> is defined in "
6327 "I<E<lt>sys/time.hE<gt>>.)"
6330 #. See the description of getrusage() in XSH.
6331 #. A similar statement was also in SUSv2.
6333 #: build/C/man2/getrusage.2:228
6335 "In Linux kernel versions before 2.6.9, if the disposition of B<SIGCHLD> is "
6336 "set to B<SIG_IGN> then the resource usages of child processes are "
6337 "automatically included in the value returned by B<RUSAGE_CHILDREN>, although "
6338 "POSIX.1-2001 explicitly prohibits this. This nonconformance is rectified in "
6339 "Linux 2.6.9 and later."
6343 #: build/C/man2/getrusage.2:231
6345 "The structure definition shown at the start of this page was taken from "
6350 #: build/C/man2/getrusage.2:240
6352 "Ancient systems provided a B<vtimes>() function with a similar purpose to "
6353 "B<getrusage>(). For backward compatibility, glibc also provides "
6354 "B<vtimes>(). All new applications should be written using B<getrusage>()."
6358 #: build/C/man2/getrusage.2:245
6359 msgid "See also the description of I</proc/PID/stat> in B<proc>(5)."
6363 #: build/C/man2/getrusage.2:252
6365 "B<clock_gettime>(2), B<getrlimit>(2), B<times>(2), B<wait>(2), B<wait4>(2), "
6370 #: build/C/man2/getsid.2:25
6376 #: build/C/man2/getsid.2:28
6377 msgid "getsid - get session ID"
6381 #: build/C/man2/getsid.2:32
6382 msgid "B<pid_t getsid(pid_t>I< pid>B<);>"
6386 #: build/C/man2/getsid.2:41
6387 msgid "B<getsid>():"
6391 #: build/C/man2/getsid.2:44 build/C/man2/setpgid.2:77
6392 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
6396 #: build/C/man2/getsid.2:46 build/C/man2/setpgid.2:79
6397 msgid "|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
6401 #: build/C/man2/getsid.2:57
6403 "I<getsid(0)> returns the session ID of the calling process. I<getsid(p)> "
6404 "returns the session ID of the process with process ID I<p>. (The session ID "
6405 "of a process is the process group ID of the session leader.)"
6409 #: build/C/man2/getsid.2:62
6411 "On success, a session ID is returned. On error, I<(pid_t)\\ -1> will be "
6412 "returned, and I<errno> is set appropriately."
6416 #: build/C/man2/getsid.2:69
6418 "A process with process ID I<p> exists, but it is not in the same session as "
6419 "the calling process, and the implementation considers this an error."
6423 #: build/C/man2/getsid.2:74
6424 msgid "No process with process ID I<p> was found."
6427 #. Linux has this system call since Linux 1.3.44.
6428 #. There is libc support since libc 5.2.19.
6430 #: build/C/man2/getsid.2:78
6431 msgid "This system call is available on Linux since version 2.0."
6435 #: build/C/man2/getsid.2:80 build/C/man2/setgid.2:76 build/C/man2/setsid.2:66
6436 msgid "SVr4, POSIX.1-2001."
6440 #: build/C/man2/getsid.2:83
6441 msgid "Linux does not return B<EPERM>."
6445 #: build/C/man2/getsid.2:87
6446 msgid "B<getpgid>(2), B<setsid>(2), B<credentials>(7)"
6450 #: build/C/man2/getuid.2:26
6456 #: build/C/man2/getuid.2:29
6457 msgid "getuid, geteuid - get user identity"
6461 #: build/C/man2/getuid.2:35
6462 msgid "B<uid_t getuid(void);>"
6466 #: build/C/man2/getuid.2:37
6467 msgid "B<uid_t geteuid(void);>"
6471 #: build/C/man2/getuid.2:40
6472 msgid "B<getuid>() returns the real user ID of the calling process."
6476 #: build/C/man2/getuid.2:43
6477 msgid "B<geteuid>() returns the effective user ID of the calling process."
6481 #: build/C/man2/getuid.2:48
6487 #: build/C/man2/getuid.2:57
6489 "In UNIX V6 the B<getuid>() call returned I<(euid E<lt>E<lt> 8) + uid>. "
6490 "UNIX V7 introduced separate calls B<getuid>() and B<geteuid>()."
6494 #: build/C/man2/getuid.2:73
6496 "The original Linux B<getuid>() and B<geteuid>() system calls supported "
6497 "only 16-bit user IDs. Subsequently, Linux 2.4 added B<getuid32>() and "
6498 "B<geteuid32>(), supporting 32-bit IDs. The glibc B<getuid>() and "
6499 "B<geteuid>() wrapper functions transparently deal with the variations "
6500 "across kernel versions."
6504 #: build/C/man2/getuid.2:78
6505 msgid "B<getresuid>(2), B<setreuid>(2), B<setuid>(2), B<credentials>(7)"
6509 #: build/C/man2/iopl.2:33
6515 #: build/C/man2/iopl.2:33
6521 #: build/C/man2/iopl.2:36
6522 msgid "iopl - change I/O privilege level"
6526 #: build/C/man2/iopl.2:38
6527 msgid "B<#include E<lt>sys/io.hE<gt>>"
6531 #: build/C/man2/iopl.2:40
6532 msgid "B<int iopl(int >I<level>B<);>"
6536 #: build/C/man2/iopl.2:44
6538 "B<iopl>() changes the I/O privilege level of the calling process, as "
6539 "specified in I<level>."
6543 #: build/C/man2/iopl.2:50
6545 "This call is necessary to allow 8514-compatible X servers to run under "
6546 "Linux. Since these X servers require access to all 65536 I/O ports, the "
6547 "B<ioperm>(2) call is not sufficient."
6551 #: build/C/man2/iopl.2:54
6553 "In addition to granting unrestricted I/O port access, running at a higher "
6554 "I/O privilege level also allows the process to disable interrupts. This "
6555 "will probably crash the system, and is not recommended."
6559 #: build/C/man2/iopl.2:59
6560 msgid "Permissions are inherited by B<fork>(2) and B<execve>(2)."
6564 #: build/C/man2/iopl.2:61
6565 msgid "The I/O privilege level for a normal process is 0."
6569 #: build/C/man2/iopl.2:65
6571 "This call is mostly for the i386 architecture. On many other architectures "
6572 "it does not exist or will always return an error."
6576 #: build/C/man2/iopl.2:75
6577 msgid "I<level> is greater than 3."
6581 #: build/C/man2/iopl.2:78
6582 msgid "This call is unimplemented."
6586 #: build/C/man2/iopl.2:85
6588 "The calling process has insufficient privilege to call B<iopl>(); the "
6589 "B<CAP_SYS_RAWIO> capability is required."
6593 #: build/C/man2/iopl.2:89
6595 "B<iopl>() is Linux-specific and should not be used in processes intended to "
6600 #: build/C/man2/iopl.2:98
6602 "Libc5 treats it as a system call and has a prototype in "
6603 "I<E<lt>unistd.hE<gt>>. Glibc1 does not have a prototype. Glibc2 has a "
6604 "prototype both in I<E<lt>sys/io.hE<gt>> and in I<E<lt>sys/perm.hE<gt>>. "
6605 "Avoid the latter, it is available on i386 only."
6609 #: build/C/man2/iopl.2:101
6610 msgid "B<ioperm>(2), B<capabilities>(7)"
6614 #: build/C/man2/ioprio_set.2:25
6620 #: build/C/man2/ioprio_set.2:25
6626 #: build/C/man2/ioprio_set.2:28
6627 msgid "ioprio_get, ioprio_set - get/set I/O scheduling class and priority"
6631 #: build/C/man2/ioprio_set.2:32
6634 "B<int ioprio_get(int >I<which>B<, int >I<who>B<);>\n"
6635 "B<int ioprio_set(int >I<which>B<, int >I<who>B<, int >I<ioprio>B<);>\n"
6639 #: build/C/man2/ioprio_set.2:40
6641 "The B<ioprio_get>() and B<ioprio_set>() system calls respectively get and "
6642 "set the I/O scheduling class and priority of one or more processes."
6646 #: build/C/man2/ioprio_set.2:52
6648 "The I<which> and I<who> arguments identify the process(es) on which the "
6649 "system calls operate. The I<which> argument determines how I<who> is "
6650 "interpreted, and has one of the following values:"
6654 #: build/C/man2/ioprio_set.2:52
6656 msgid "B<IOPRIO_WHO_PROCESS>"
6660 #: build/C/man2/ioprio_set.2:56
6661 msgid "I<who> is a process ID identifying a single process."
6665 #: build/C/man2/ioprio_set.2:56
6667 msgid "B<IOPRIO_WHO_PGRP>"
6671 #: build/C/man2/ioprio_set.2:60
6672 msgid "I<who> is a process group ID identifying all the members of a process group."
6676 #: build/C/man2/ioprio_set.2:60
6678 msgid "B<IOPRIO_WHO_USER>"
6682 #: build/C/man2/ioprio_set.2:65
6684 "I<who> is a user ID identifying all of the processes that have a matching "
6689 #: build/C/man2/ioprio_set.2:88
6691 "If I<which> is specified as B<IOPRIO_WHO_PGRP> or B<IOPRIO_WHO_USER> when "
6692 "calling B<ioprio_get>(), and more than one process matches I<who>, then the "
6693 "returned priority will be the highest one found among all of the matching "
6694 "processes. One priority is said to be higher than another one if it belongs "
6695 "to a higher priority class (B<IOPRIO_CLASS_RT> is the highest priority "
6696 "class; B<IOPRIO_CLASS_IDLE> is the lowest) or if it belongs to the same "
6697 "priority class as the other process but has a higher priority level (a lower "
6698 "priority number means a higher priority level)."
6702 #: build/C/man2/ioprio_set.2:98
6704 "The I<ioprio> argument given to B<ioprio_set>() is a bit mask that "
6705 "specifies both the scheduling class and the priority to be assigned to the "
6706 "target process(es). The following macros are used for assembling and "
6707 "dissecting I<ioprio> values:"
6711 #: build/C/man2/ioprio_set.2:98
6713 msgid "B<IOPRIO_PRIO_VALUE(>I<class>B<, >I<data>B<)>"
6717 #: build/C/man2/ioprio_set.2:107
6719 "Given a scheduling I<class> and priority (I<data>), this macro combines the "
6720 "two values to produce an I<ioprio> value, which is returned as the result of "
6725 #: build/C/man2/ioprio_set.2:107
6727 msgid "B<IOPRIO_PRIO_CLASS(>I<mask>B<)>"
6731 #: build/C/man2/ioprio_set.2:119
6733 "Given I<mask> (an I<ioprio> value), this macro returns its I/O class "
6734 "component, that is, one of the values B<IOPRIO_CLASS_RT>, "
6735 "B<IOPRIO_CLASS_BE>, or B<IOPRIO_CLASS_IDLE>."
6739 #: build/C/man2/ioprio_set.2:119
6741 msgid "B<IOPRIO_PRIO_DATA(>I<mask>B<)>"
6745 #: build/C/man2/ioprio_set.2:128
6747 "Given I<mask> (an I<ioprio> value), this macro returns its priority "
6748 "(I<data>) component."
6752 #: build/C/man2/ioprio_set.2:131
6754 "See the NOTES section for more information on scheduling classes and "
6759 #: build/C/man2/ioprio_set.2:139
6761 "I/O priorities are supported for reads and for synchronous (B<O_DIRECT>, "
6762 "B<O_SYNC>) writes. I/O priorities are not supported for asynchronous "
6763 "writes because they are issued outside the context of the program dirtying "
6764 "the memory, and thus program-specific priorities do not apply."
6768 #: build/C/man2/ioprio_set.2:152
6770 "On success, B<ioprio_get>() returns the I<ioprio> value of the process with "
6771 "highest I/O priority of any of the processes that match the criteria "
6772 "specified in I<which> and I<who>. On error, -1 is returned, and I<errno> is "
6773 "set to indicate the error."
6777 #: build/C/man2/ioprio_set.2:159
6779 "On success, B<ioprio_set>() returns 0. On error, -1 is returned, and "
6780 "I<errno> is set to indicate the error."
6784 #: build/C/man2/ioprio_set.2:169
6786 "Invalid value for I<which> or I<ioprio>. Refer to the NOTES section for "
6787 "available scheduler classes and priority levels for I<ioprio>."
6791 #: build/C/man2/ioprio_set.2:177
6793 "The calling process does not have the privilege needed to assign this "
6794 "I<ioprio> to the specified process(es). See the NOTES section for more "
6795 "information on required privileges for B<ioprio_set>()."
6799 #: build/C/man2/ioprio_set.2:183
6801 "No process(es) could be found that matched the specification in I<which> and "
6806 #: build/C/man2/ioprio_set.2:186
6807 msgid "These system calls have been available on Linux since kernel 2.6.13."
6811 #: build/C/man2/ioprio_set.2:191
6813 "Glibc does not provide wrapper for these system calls; call them using "
6818 #: build/C/man2/ioprio_set.2:196
6820 "These system calls only have an effect when used in conjunction with an I/O "
6821 "scheduler that supports I/O priorities. As at kernel 2.6.17 the only such "
6822 "scheduler is the Completely Fair Queuing (CFQ) I/O scheduler."
6826 #: build/C/man2/ioprio_set.2:196
6828 msgid "Selecting an I/O Scheduler"
6832 #: build/C/man2/ioprio_set.2:200
6834 "I/O Schedulers are selected on a per-device basis via the special file "
6835 "I</sys/block/E<lt>deviceE<gt>/queue/scheduler>."
6839 #: build/C/man2/ioprio_set.2:206
6841 "One can view the current I/O scheduler via the I</sys> file system. For "
6842 "example, the following command displays a list of all schedulers currently "
6843 "loaded in the kernel:"
6847 #: build/C/man2/ioprio_set.2:211
6850 "$B< cat /sys/block/hda/queue/scheduler>\n"
6851 "noop anticipatory deadline [cfq]\n"
6855 #: build/C/man2/ioprio_set.2:225
6857 "The scheduler surrounded by brackets is the one actually in use for the "
6858 "device (I<hda> in the example). Setting another scheduler is done by "
6859 "writing the name of the new scheduler to this file. For example, the "
6860 "following command will set the scheduler for the I<hda> device to I<cfq>:"
6864 #: build/C/man2/ioprio_set.2:231
6869 "#B< echo cfq E<gt> /sys/block/hda/queue/scheduler>\n"
6873 #: build/C/man2/ioprio_set.2:233
6875 msgid "The Completely Fair Queuing (CFQ) I/O Scheduler"
6879 #: build/C/man2/ioprio_set.2:239
6881 "Since v3 (aka CFQ Time Sliced) CFQ implements I/O nice levels similar to "
6882 "those of CPU scheduling. These nice levels are grouped in three scheduling "
6883 "classes each one containing one or more priority levels:"
6887 #: build/C/man2/ioprio_set.2:239
6889 msgid "B<IOPRIO_CLASS_RT> (1)"
6893 #: build/C/man2/ioprio_set.2:254
6895 "This is the real-time I/O class. This scheduling class is given higher "
6896 "priority than any other class: processes from this class are given first "
6897 "access to the disk every time. Thus this I/O class needs to be used with "
6898 "some care: one I/O real-time process can starve the entire system. Within "
6899 "the real-time class, there are 8 levels of class data (priority) that "
6900 "determine exactly how much time this process needs the disk for on each "
6901 "service. The highest real-time priority level is 0; the lowest is 7. In "
6902 "the future this might change to be more directly mappable to performance, by "
6903 "passing in a desired data rate instead."
6907 #: build/C/man2/ioprio_set.2:254
6909 msgid "B<IOPRIO_CLASS_BE> (2)"
6913 #: build/C/man2/ioprio_set.2:267
6915 "This is the best-effort scheduling class, which is the default for any "
6916 "process that hasn't set a specific I/O priority. The class data (priority) "
6917 "determines how much I/O bandwidth the process will get. Best-effort "
6918 "priority levels are analogous to CPU nice values (see B<getpriority>(2)). "
6919 "The priority level determines a priority relative to other processes in the "
6920 "best-effort scheduling class. Priority levels range from 0 (highest) to 7 "
6925 #: build/C/man2/ioprio_set.2:267
6927 msgid "B<IOPRIO_CLASS_IDLE> (3)"
6931 #: build/C/man2/ioprio_set.2:276
6933 "This is the idle scheduling class. Processes running at this level only get "
6934 "I/O time when no-one else needs the disk. The idle class has no class "
6935 "data. Attention is required when assigning this priority class to a "
6936 "process, since it may become starved if higher priority processes are "
6937 "constantly accessing the disk."
6941 #: build/C/man2/ioprio_set.2:280
6943 "Refer to I<Documentation/block/ioprio.txt> for more information on the CFQ "
6944 "I/O Scheduler and an example program."
6948 #: build/C/man2/ioprio_set.2:280
6950 msgid "Required permissions to set I/O priorities"
6954 #: build/C/man2/ioprio_set.2:283
6956 "Permission to change a process's priority is granted or denied based on two "
6961 #: build/C/man2/ioprio_set.2:283
6963 msgid "B<Process ownership>"
6967 #: build/C/man2/ioprio_set.2:291
6969 "An unprivileged process may only set the I/O priority of a process whose "
6970 "real UID matches the real or effective UID of the calling process. A "
6971 "process which has the B<CAP_SYS_NICE> capability can change the priority of "
6976 #: build/C/man2/ioprio_set.2:291
6978 msgid "B<What is the desired priority>"
6982 #: build/C/man2/ioprio_set.2:303
6984 "Attempts to set very high priorities (B<IOPRIO_CLASS_RT>) require the "
6985 "B<CAP_SYS_ADMIN> capability. Kernel versions up to 2.6.24 also required "
6986 "B<CAP_SYS_ADMIN> to set a very low priority (B<IOPRIO_CLASS_IDLE>), but "
6987 "since Linux 2.6.25, this is no longer required."
6991 #: build/C/man2/ioprio_set.2:308
6993 "A call to B<ioprio_set>() must follow both rules, or the call will fail "
6994 "with the error B<EPERM>."
6997 #. 6 May 07: Bug report raised:
6998 #. http://sources.redhat.com/bugzilla/show_bug.cgi?id=4464
6999 #. Ulrich Drepper replied that he wasn't going to add these
7002 #: build/C/man2/ioprio_set.2:317
7004 "Glibc does not yet provide a suitable header file defining the function "
7005 "prototypes and macros described on this page. Suitable definitions can be "
7006 "found in I<linux/ioprio.h>."
7010 #: build/C/man2/ioprio_set.2:321
7011 msgid "B<getpriority>(2), B<open>(2), B<capabilities>(7)"
7015 #: build/C/man2/ioprio_set.2:323
7016 msgid "Documentation/block/ioprio.txt in the kernel source tree."
7020 #: build/C/man2/ipc.2:26
7026 #: build/C/man2/ipc.2:26
7032 #: build/C/man2/ipc.2:29
7033 msgid "ipc - System V IPC system calls"
7037 #: build/C/man2/ipc.2:34
7040 "B<int ipc(unsigned int >I<call>B<, int >I<first>B<, int >I<second>B<, int "
7042 "B< void *>I<ptr>B<, long >I<fifth>B<);>\n"
7046 #: build/C/man2/ipc.2:42
7048 "B<ipc>() is a common kernel entry point for the System V IPC calls for "
7049 "messages, semaphores, and shared memory. I<call> determines which IPC "
7050 "function to invoke; the other arguments are passed through to the "
7055 #: build/C/man2/ipc.2:46
7057 "User programs should call the appropriate functions by their usual names. "
7058 "Only standard library implementors and kernel hackers need to know about "
7063 #: build/C/man2/ipc.2:50
7065 "B<ipc>() is Linux-specific, and should not be used in programs intended to "
7070 #: build/C/man2/ipc.2:58
7072 "On a few architectures, for example ia64, there is no B<ipc>() system call; "
7073 "instead B<msgctl>(2), B<semctl>(2), B<shmctl>(2), and so on really are "
7074 "implemented as separate system calls."
7078 #: build/C/man2/ipc.2:71
7080 "B<msgctl>(2), B<msgget>(2), B<msgrcv>(2), B<msgsnd>(2), B<semctl>(2), "
7081 "B<semget>(2), B<semop>(2), B<semtimedop>(2), B<shmat>(2), B<shmctl>(2), "
7082 "B<shmdt>(2), B<shmget>(2)"
7086 #: build/C/man2/seteuid.2:27
7092 #: build/C/man2/seteuid.2:27
7098 #: build/C/man2/seteuid.2:30
7099 msgid "seteuid, setegid - set effective user or group ID"
7103 #: build/C/man2/seteuid.2:36
7104 msgid "B<int seteuid(uid_t >I<euid>B<);>"
7108 #: build/C/man2/seteuid.2:38
7109 msgid "B<int setegid(gid_t >I<egid>B<);>"
7113 #: build/C/man2/seteuid.2:47
7114 msgid "B<seteuid>(), B<setegid>():"
7118 #: build/C/man2/seteuid.2:49
7120 "_BSD_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ "
7125 #: build/C/man2/seteuid.2:56
7127 "B<seteuid>() sets the effective user ID of the calling process. "
7128 "Unprivileged user processes may only set the effective user ID to the real "
7129 "user ID, the effective user ID or the saved set-user-ID."
7134 #. equals \-1, nothing is changed.
7135 #. (This is an artifact of the implementation in glibc of seteuid()
7136 #. using setresuid(2).)
7138 #: build/C/man2/seteuid.2:65
7140 "Precisely the same holds for B<setegid>() with \"group\" instead of "
7145 #: build/C/man2/seteuid.2:89
7147 "The calling process is not privileged (Linux: does not have the "
7148 "B<CAP_SETUID> capability in the case of B<seteuid>(), or the B<CAP_SETGID> "
7149 "capability in the case of B<setegid>()) and I<euid> (respectively, I<egid>) "
7150 "is not the real user (group) ID, the effective user (group) ID, or the saved "
7151 "set-user-ID (saved set-group-ID)."
7155 #: build/C/man2/seteuid.2:91
7156 msgid "4.3BSD, POSIX.1-2001."
7160 #: build/C/man2/seteuid.2:97
7162 "Setting the effective user (group) ID to the saved set-user-ID (saved "
7163 "set-group-ID) is possible since Linux 1.1.37 (1.1.38). On an arbitrary "
7164 "system one should check B<_POSIX_SAVED_IDS>."
7168 #: build/C/man2/seteuid.2:108
7170 "Under libc4, libc5 and glibc 2.0 B<seteuid(>I<euid>B<)> is equivalent to "
7171 "B<setreuid(-1,>I< euid>B<)> and hence may change the saved set-user-ID. "
7172 "Under glibc 2.1 and later it is equivalent to B<setresuid(-1,>I< euid>B<, "
7173 "-1)> and hence does not change the saved set-user-ID. Similar remarks hold "
7178 #: build/C/man2/seteuid.2:117
7180 "According to POSIX.1, B<seteuid>() (B<setegid>()) need not permit I<euid> "
7181 "(I<egid>) to be the same value as the current effective user (group) ID, "
7182 "and some implementations do not permit this."
7186 #: build/C/man2/seteuid.2:124
7188 "B<geteuid>(2), B<setresuid>(2), B<setreuid>(2), B<setuid>(2), "
7189 "B<capabilities>(7), B<credentials>(7)"
7193 #: build/C/man2/setfsgid.2:29
7199 #: build/C/man2/setfsgid.2:32
7200 msgid "setfsgid - set group identity used for file system checks"
7204 #: build/C/man2/setfsgid.2:35 build/C/man2/setfsuid.2:35
7205 msgid "B<#include E<lt>unistd.hE<gt>> /* glibc uses E<lt>sys/fsuid.hE<gt> */"
7209 #: build/C/man2/setfsgid.2:37
7210 msgid "B<int setfsgid(uid_t >I<fsgid>B<);>"
7214 #: build/C/man2/setfsgid.2:49
7216 "The system call B<setfsgid>() sets the group ID that the Linux kernel uses "
7217 "to check for all accesses to the file system. Normally, the value of "
7218 "I<fsgid> will shadow the value of the effective group ID. In fact, whenever "
7219 "the effective group ID is changed, I<fsgid> will also be changed to the new "
7220 "value of the effective group ID."
7224 #: build/C/man2/setfsgid.2:60
7226 "Explicit calls to B<setfsuid>(2) and B<setfsgid>() are usually only used "
7227 "by programs such as the Linux NFS server that need to change what user and "
7228 "group ID is used for file access without a corresponding change in the real "
7229 "and effective user and group IDs. A change in the normal user IDs for a "
7230 "program such as the NFS server is a security hole that can expose it to "
7231 "unwanted signals. (But see below.)"
7235 #: build/C/man2/setfsgid.2:67
7237 "B<setfsgid>() will only succeed if the caller is the superuser or if "
7238 "I<fsgid> matches either the real group ID, effective group ID, saved "
7239 "set-group-ID, or the current value of I<fsgid>."
7243 #: build/C/man2/setfsgid.2:74
7245 "On success, the previous value of I<fsgid> is returned. On error, the "
7246 "current value of I<fsgid> is returned."
7249 #. This system call is present since Linux 1.1.44
7250 #. and in libc since libc 4.7.6.
7252 #: build/C/man2/setfsgid.2:78 build/C/man2/setfsuid.2:78
7253 msgid "This system call is present in Linux since version 1.2."
7257 #: build/C/man2/setfsgid.2:82
7259 "B<setfsgid>() is Linux-specific and should not be used in programs intended "
7264 #: build/C/man2/setfsgid.2:88
7266 "When glibc determines that the argument is not a valid group ID, it will "
7267 "return -1 and set I<errno> to B<EINVAL> without attempting the system call."
7271 #: build/C/man2/setfsgid.2:92 build/C/man2/setfsuid.2:92
7273 "Note that at the time this system call was introduced, a process could send "
7274 "a signal to a process with the same effective user ID. Today signal "
7275 "permission handling is slightly different."
7279 #: build/C/man2/setfsgid.2:102
7281 "The original Linux B<setfsgid>() system call supported only 16-bit group "
7282 "IDs. Subsequently, Linux 2.4 added B<setfsgid32>() supporting 32-bit IDs. "
7283 "The glibc B<setfsgid>() wrapper function transparently deals with the "
7284 "variation across kernel versions."
7288 #: build/C/man2/setfsgid.2:110
7290 "No error messages of any kind are returned to the caller. At the very "
7291 "least, B<EPERM> should be returned when the call fails (because the caller "
7292 "lacks the B<CAP_SETGID> capability)."
7296 #: build/C/man2/setfsgid.2:115
7297 msgid "B<kill>(2), B<setfsuid>(2), B<capabilities>(7), B<credentials>(7)"
7301 #: build/C/man2/setfsuid.2:29
7307 #: build/C/man2/setfsuid.2:32
7308 msgid "setfsuid - set user identity used for file system checks"
7312 #: build/C/man2/setfsuid.2:37
7313 msgid "B<int setfsuid(uid_t >I<fsuid>B<);>"
7317 #: build/C/man2/setfsuid.2:49
7319 "The system call B<setfsuid>() sets the user ID that the Linux kernel uses "
7320 "to check for all accesses to the file system. Normally, the value of "
7321 "I<fsuid> will shadow the value of the effective user ID. In fact, whenever "
7322 "the effective user ID is changed, I<fsuid> will also be changed to the new "
7323 "value of the effective user ID."
7327 #: build/C/man2/setfsuid.2:60
7329 "Explicit calls to B<setfsuid>() and B<setfsgid>(2) are usually only used "
7330 "by programs such as the Linux NFS server that need to change what user and "
7331 "group ID is used for file access without a corresponding change in the real "
7332 "and effective user and group IDs. A change in the normal user IDs for a "
7333 "program such as the NFS server is a security hole that can expose it to "
7334 "unwanted signals. (But see below.)"
7338 #: build/C/man2/setfsuid.2:67
7340 "B<setfsuid>() will only succeed if the caller is the superuser or if "
7341 "I<fsuid> matches either the real user ID, effective user ID, saved "
7342 "set-user-ID, or the current value of I<fsuid>."
7346 #: build/C/man2/setfsuid.2:74
7348 "On success, the previous value of I<fsuid> is returned. On error, the "
7349 "current value of I<fsuid> is returned."
7353 #: build/C/man2/setfsuid.2:82
7355 "B<setfsuid>() is Linux-specific and should not be used in programs intended "
7360 #: build/C/man2/setfsuid.2:88
7362 "When glibc determines that the argument is not a valid user ID, it will "
7363 "return -1 and set I<errno> to B<EINVAL> without attempting the system call."
7367 #: build/C/man2/setfsuid.2:102
7369 "The original Linux B<setfsuid>() system call supported only 16-bit user "
7370 "IDs. Subsequently, Linux 2.4 added B<setfsuid32>() supporting 32-bit IDs. "
7371 "The glibc B<setfsuid>() wrapper function transparently deals with the "
7372 "variation across kernel versions."
7376 #: build/C/man2/setfsuid.2:110
7378 "No error messages of any kind are returned to the caller. At the very "
7379 "least, B<EPERM> should be returned when the call fails (because the caller "
7380 "lacks the B<CAP_SETUID> capability)."
7384 #: build/C/man2/setfsuid.2:115
7385 msgid "B<kill>(2), B<setfsgid>(2), B<capabilities>(7), B<credentials>(7)"
7389 #: build/C/man2/setgid.2:27
7395 #: build/C/man2/setgid.2:30
7396 msgid "setgid - set group identity"
7400 #: build/C/man2/setgid.2:36
7401 msgid "B<int setgid(gid_t >I<gid>B<);>"
7405 #: build/C/man2/setgid.2:41
7407 "B<setgid>() sets the effective group ID of the calling process. If the "
7408 "caller is the superuser, the real GID and saved set-group-ID are also set."
7412 #: build/C/man2/setgid.2:51
7414 "Under Linux, B<setgid>() is implemented like the POSIX version with the "
7415 "B<_POSIX_SAVED_IDS> feature. This allows a set-group-ID program that is not "
7416 "set-user-ID-root to drop all of its group privileges, do some un-privileged "
7417 "work, and then reengage the original effective group ID in a secure manner."
7421 #: build/C/man2/setgid.2:64
7423 "The calling process is not privileged (does not have the B<CAP_SETGID> "
7424 "capability), and I<gid> does not match the real group ID or saved "
7425 "set-group-ID of the calling process."
7429 #: build/C/man2/setgid.2:74
7431 "The original Linux B<setgid>() system call supported only 16-bit group "
7432 "IDs. Subsequently, Linux 2.4 added B<setgid32>() supporting 32-bit IDs. "
7433 "The glibc B<setgid>() wrapper function transparently deals with the "
7434 "variation across kernel versions."
7438 #: build/C/man2/setgid.2:82
7440 "B<getgid>(2), B<setegid>(2), B<setregid>(2), B<capabilities>(7), "
7445 #: build/C/man2/setpgid.2:46
7451 #: build/C/man2/setpgid.2:49
7452 msgid "setpgid, getpgid, setpgrp, getpgrp - set/get process group"
7456 #: build/C/man2/setpgid.2:53
7457 msgid "B<int setpgid(pid_t >I<pid>B<, pid_t >I<pgid>B<);>"
7461 #: build/C/man2/setpgid.2:55
7462 msgid "B<pid_t getpgid(pid_t >I<pid>B<);>"
7466 #: build/C/man2/setpgid.2:57
7467 msgid "B<pid_t getpgrp(void);> /* POSIX.1 version */"
7471 #: build/C/man2/setpgid.2:60
7473 "B<pid_t getpgrp(pid_t >I<pid>B<);\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ > /* BSD "
7478 #: build/C/man2/setpgid.2:62
7479 msgid "B<int setpgrp(void);> /* System V version */"
7483 #: build/C/man2/setpgid.2:65
7484 msgid "B<int setpgrp(pid_t >I<pid>B<, pid_t >I<pgid>B<);\\ > /* BSD version */"
7488 #: build/C/man2/setpgid.2:74
7489 msgid "B<getpgid>():"
7493 #: build/C/man2/setpgid.2:82
7494 msgid "B<setpgrp>() (POSIX.1):"
7498 #: build/C/man2/setpgid.2:85
7501 " _SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 ||\n"
7502 " _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED\n"
7506 #: build/C/man2/setpgid.2:89
7507 msgid "B<setpgrp>()\\ (BSD), B<getpgrp>()\\ (BSD):"
7511 #: build/C/man2/setpgid.2:93
7515 " !\\ (_POSIX_SOURCE || _POSIX_C_SOURCE || _XOPEN_SOURCE ||\n"
7516 " _XOPEN_SOURCE_EXTENDED || _GNU_SOURCE || _SVID_SOURCE)\n"
7520 #: build/C/man2/setpgid.2:105
7522 "All of these interfaces are available on Linux, and are used for getting and "
7523 "setting the process group ID (PGID) of a process. The preferred, "
7524 "POSIX.1-specified ways of doing this are: B<getpgrp>(void), for retrieving "
7525 "the calling process's PGID; and B<setpgid>(), for setting a process's PGID."
7529 #: build/C/man2/setpgid.2:130
7531 "B<setpgid>() sets the PGID of the process specified by I<pid> to I<pgid>. "
7532 "If I<pid> is zero, then the process ID of the calling process is used. If "
7533 "I<pgid> is zero, then the PGID of the process specified by I<pid> is made "
7534 "the same as its process ID. If B<setpgid>() is used to move a process from "
7535 "one process group to another (as is done by some shells when creating "
7536 "pipelines), both process groups must be part of the same session (see "
7537 "B<setsid>(2) and B<credentials>(7)). In this case, the I<pgid> specifies "
7538 "an existing process group to be joined and the session ID of that group must "
7539 "match the session ID of the joining process."
7543 #: build/C/man2/setpgid.2:135
7545 "The POSIX.1 version of B<getpgrp>(), which takes no arguments, returns the "
7546 "PGID of the calling process."
7550 #: build/C/man2/setpgid.2:146
7552 "B<getpgid>() returns the PGID of the process specified by I<pid>. If "
7553 "I<pid> is zero, the process ID of the calling process is used. (Retrieving "
7554 "the PGID of a process other than the caller is rarely necessary, and the "
7555 "POSIX.1 B<getpgrp>() is preferred for that task.)"
7559 #: build/C/man2/setpgid.2:151
7561 "The System V-style B<setpgrp>(), which takes no arguments, is equivalent to "
7562 "I<setpgid(0,\\ 0)>."
7565 #. The true BSD setpgrp() system call differs in allowing the PGID
7566 #. to be set to arbitrary values, rather than being restricted to
7567 #. PGIDs in the same session.
7569 #: build/C/man2/setpgid.2:163
7571 "The BSD-specific B<setpgrp>() call, which takes arguments I<pid> and "
7572 "I<pgid>, is equivalent to I<setpgid(pid, pgid)>."
7576 #: build/C/man2/setpgid.2:170
7578 "The BSD-specific B<getpgrp>() call, which takes a single I<pid> argument, "
7579 "is equivalent to I<getpgid(pid)>."
7583 #: build/C/man2/setpgid.2:179
7585 "On success, B<setpgid>() and B<setpgrp>() return zero. On error, -1 is "
7586 "returned, and I<errno> is set appropriately."
7590 #: build/C/man2/setpgid.2:183
7591 msgid "The POSIX.1 B<getpgrp>() always returns the PGID of the caller."
7595 #: build/C/man2/setpgid.2:191
7597 "B<getpgid>(), and the BSD-specific B<getpgrp>() return a process group on "
7598 "success. On error, -1 is returned, and I<errno> is set appropriately."
7602 #: build/C/man2/setpgid.2:200
7604 "An attempt was made to change the process group ID of one of the children of "
7605 "the calling process and the child had already performed an B<execve>(2) "
7606 "(B<setpgid>(), B<setpgrp>())."
7610 #: build/C/man2/setpgid.2:206
7611 msgid "I<pgid> is less than 0 (B<setpgid>(), B<setpgrp>())."
7615 #: build/C/man2/setpgid.2:215
7617 "An attempt was made to move a process into a process group in a different "
7618 "session, or to change the process group ID of one of the children of the "
7619 "calling process and the child was in a different session, or to change the "
7620 "process group ID of a session leader (B<setpgid>(), B<setpgrp>())."
7624 #: build/C/man2/setpgid.2:225
7626 "For B<getpgid>(): I<pid> does not match any process. For B<setpgid>(): "
7627 "I<pid> is not the calling process and not a child of the calling process."
7631 #: build/C/man2/setpgid.2:231
7633 "B<setpgid>() and the version of B<getpgrp>() with no arguments conform to "
7638 #: build/C/man2/setpgid.2:240
7640 "POSIX.1-2001 also specifies B<getpgid>() and the version of B<setpgrp>() "
7641 "that takes no arguments. (POSIX.1-2008 marks this B<setpgrp>() "
7642 "specification as obsolete.)"
7646 #: build/C/man2/setpgid.2:247
7648 "The version of B<getpgrp>() with one argument and the version of "
7649 "B<setpgrp>() that takes two arguments derive from 4.2BSD, and are not "
7650 "specified by POSIX.1."
7654 #: build/C/man2/setpgid.2:253
7656 "A child created via B<fork>(2) inherits its parent's process group ID. The "
7657 "PGID is preserved across an B<execve>(2)."
7661 #: build/C/man2/setpgid.2:256
7663 "Each process group is a member of a session and each process is a member of "
7664 "the session of which its process group is a member."
7668 #: build/C/man2/setpgid.2:283
7670 "A session can have a controlling terminal. At any time, one (and only one) "
7671 "of the process groups in the session can be the foreground process group for "
7672 "the terminal; the remaining process groups are in the background. If a "
7673 "signal is generated from the terminal (e.g., typing the interrupt key to "
7674 "generate B<SIGINT>), that signal is sent to the foreground process group. "
7675 "(See B<termios>(3) for a description of the characters that generate "
7676 "signals.) Only the foreground process group may B<read>(2) from the "
7677 "terminal; if a background process group tries to B<read>(2) from the "
7678 "terminal, then the group is sent a B<SIGTSTP> signal, which suspends it. "
7679 "The B<tcgetpgrp>(3) and B<tcsetpgrp>(3) functions are used to get/set the "
7680 "foreground process group of the controlling terminal."
7684 #: build/C/man2/setpgid.2:291
7686 "The B<setpgid>() and B<getpgrp>() calls are used by programs such as "
7687 "B<bash>(1) to create process groups in order to implement shell job "
7692 #: build/C/man2/setpgid.2:301
7694 "If a session has a controlling terminal, and the B<CLOCAL> flag for that "
7695 "terminal is not set, and a terminal hangup occurs, then the session leader "
7696 "is sent a B<SIGHUP>. If the session leader exits, then a B<SIGHUP> signal "
7697 "will also be sent to each process in the foreground process group of the "
7698 "controlling terminal."
7701 #. exit.3 refers to the following text:
7703 #: build/C/man2/setpgid.2:315
7705 "If the exit of the process causes a process group to become orphaned, and if "
7706 "any member of the newly orphaned process group is stopped, then a B<SIGHUP> "
7707 "signal followed by a B<SIGCONT> signal will be sent to each process in the "
7708 "newly orphaned process group. An orphaned process group is one in which the "
7709 "parent of every member of process group is either itself also a member of "
7710 "the process group or is a member of a process group in a different session "
7711 "(see also B<credentials>(7))."
7715 #: build/C/man2/setpgid.2:322
7717 "B<getuid>(2), B<setsid>(2), B<tcgetpgrp>(3), B<tcsetpgrp>(3), B<termios>(3), "
7722 #: build/C/man2/setresuid.2:26
7728 #: build/C/man2/setresuid.2:29
7729 msgid "setresuid, setresgid - set real, effective and saved user or group ID"
7733 #: build/C/man2/setresuid.2:35
7734 msgid "B<int setresuid(uid_t >I<ruid>B<, uid_t >I<euid>B<, uid_t >I<suid>B<);>"
7738 #: build/C/man2/setresuid.2:37
7739 msgid "B<int setresgid(gid_t >I<rgid>B<, gid_t >I<egid>B<, gid_t >I<sgid>B<);>"
7743 #: build/C/man2/setresuid.2:41
7745 "B<setresuid>() sets the real user ID, the effective user ID, and the saved "
7746 "set-user-ID of the calling process."
7750 #: build/C/man2/setresuid.2:47
7752 "Unprivileged user processes may change the real UID, effective UID, and "
7753 "saved set-user-ID, each to one of: the current real UID, the current "
7754 "effective UID or the current saved set-user-ID."
7758 #: build/C/man2/setresuid.2:51
7760 "Privileged processes (on Linux, those having the B<CAP_SETUID> capability) "
7761 "may set the real UID, effective UID, and saved set-user-ID to arbitrary "
7766 #: build/C/man2/setresuid.2:53
7767 msgid "If one of the arguments equals -1, the corresponding value is not changed."
7771 #: build/C/man2/setresuid.2:57
7773 "Regardless of what changes are made to the real UID, effective UID, and "
7774 "saved set-user-ID, the file system UID is always set to the same value as "
7775 "the (possibly new) effective UID."
7779 #: build/C/man2/setresuid.2:64
7781 "Completely analogously, B<setresgid>() sets the real GID, effective GID, "
7782 "and saved set-group-ID of the calling process (and always modifies the file "
7783 "system GID to be the same as the effective GID), with the same restrictions "
7784 "for unprivileged processes."
7788 #: build/C/man2/setresuid.2:70 build/C/man2/setuid.2:74
7794 #: build/C/man2/setresuid.2:77
7796 "I<uid> does not match the current UID and this call would bring that user ID "
7797 "over its B<RLIMIT_NPROC> resource limit."
7801 #: build/C/man2/setresuid.2:81
7803 "The calling process is not privileged (did not have the B<CAP_SETUID> "
7804 "capability) and tried to change the IDs to values that are not permitted."
7808 #: build/C/man2/setresuid.2:83
7809 msgid "These calls are available under Linux since Linux 2.1.44."
7813 #: build/C/man2/setresuid.2:90
7815 "Under HP-UX and FreeBSD, the prototype is found in I<E<lt>unistd.hE<gt>>. "
7816 "Under Linux the prototype is provided by glibc since version 2.3.2."
7820 #: build/C/man2/setresuid.2:106
7822 "The original Linux B<setresuid>() and B<setresgid>() system calls "
7823 "supported only 16-bit user and group IDs. Subsequently, Linux 2.4 added "
7824 "B<setresuid32>() and B<setresgid32>(), supporting 32-bit IDs. The glibc "
7825 "B<setresuid>() and B<setresgid>() wrapper functions transparently deal "
7826 "with the variations across kernel versions."
7830 #: build/C/man2/setresuid.2:115
7832 "B<getresuid>(2), B<getuid>(2), B<setfsgid>(2), B<setfsuid>(2), "
7833 "B<setreuid>(2), B<setuid>(2), B<capabilities>(7), B<credentials>(7)"
7837 #: build/C/man2/setreuid.2:43
7843 #: build/C/man2/setreuid.2:46
7844 msgid "setreuid, setregid - set real and/or effective user or group ID"
7848 #: build/C/man2/setreuid.2:52
7849 msgid "B<int setreuid(uid_t >I<ruid>B<, uid_t >I<euid>B<);>"
7853 #: build/C/man2/setreuid.2:54
7854 msgid "B<int setregid(gid_t >I<rgid>B<, gid_t >I<egid>B<);>"
7858 #: build/C/man2/setreuid.2:62
7859 msgid "B<setreuid>(), B<setregid>():"
7863 #: build/C/man2/setreuid.2:66
7865 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
7866 "_XOPEN_SOURCE_EXTENDED"
7870 #: build/C/man2/setreuid.2:71
7871 msgid "B<setreuid>() sets real and effective user IDs of the calling process."
7875 #: build/C/man2/setreuid.2:74
7877 "Supplying a value of -1 for either the real or effective user ID forces the "
7878 "system to leave that ID unchanged."
7882 #: build/C/man2/setreuid.2:77
7884 "Unprivileged processes may only set the effective user ID to the real user "
7885 "ID, the effective user ID, or the saved set-user-ID."
7889 #: build/C/man2/setreuid.2:80
7891 "Unprivileged users may only set the real user ID to the real user ID or the "
7892 "effective user ID."
7896 #: build/C/man2/setreuid.2:84
7898 "If the real user ID is set or the effective user ID is set to a value not "
7899 "equal to the previous real user ID, the saved set-user-ID will be set to the "
7900 "new effective user ID."
7904 #: build/C/man2/setreuid.2:89
7906 "Completely analogously, B<setregid>() sets real and effective group ID's of "
7907 "the calling process, and all of the above holds with \"group\" instead of "
7912 #: build/C/man2/setreuid.2:111
7914 "The calling process is not privileged (Linux: does not have the "
7915 "B<CAP_SETUID> capability in the case of B<setreuid>(), or the B<CAP_SETGID> "
7916 "capability in the case of B<setregid>()) and a change other than (i) "
7917 "swapping the effective user (group) ID with the real user (group) ID, or "
7918 "(ii) setting one to the value of the other or (iii) setting the effective "
7919 "user (group) ID to the value of the saved set-user-ID (saved set-group-ID) "
7924 #: build/C/man2/setreuid.2:117
7926 "POSIX.1-2001, 4.3BSD (the B<setreuid>() and B<setregid>() function calls "
7927 "first appeared in 4.2BSD)."
7931 #: build/C/man2/setreuid.2:121
7933 "Setting the effective user (group) ID to the saved set-user-ID (saved "
7934 "set-group-ID) is possible since Linux 1.1.37 (1.1.38)."
7938 #: build/C/man2/setreuid.2:138
7940 "POSIX.1 does not specify all of possible ID changes that are permitted on "
7941 "Linux for an unprivileged process. For B<setreuid>(), the effective user ID "
7942 "can be made the same as the real user ID or the save set-user-ID, and it is "
7943 "unspecified whether unprivileged processes may set the real user ID to the "
7944 "real user ID, the effective user ID, or the saved set-user-ID. For "
7945 "B<setregid>(), the real group ID can be changed to the value of the saved "
7946 "set-group-ID, and the effective group ID can be changed to the value of the "
7947 "real group ID or the saved set-group-ID. The precise details of what ID "
7948 "changes are permitted vary across implementations."
7952 #: build/C/man2/setreuid.2:141
7954 "POSIX.1 makes no specification about the effect of these calls on the saved "
7955 "set-user-ID and saved set-group-ID."
7959 #: build/C/man2/setreuid.2:157
7961 "The original Linux B<setreuid>() and B<setregid>() system calls supported "
7962 "only 16-bit user and group IDs. Subsequently, Linux 2.4 added "
7963 "B<setreuid32>() and B<setregid32>(), supporting 32-bit IDs. The glibc "
7964 "B<setreuid>() and B<setregid>() wrapper functions transparently deal with "
7965 "the variations across kernel versions."
7969 #: build/C/man2/setreuid.2:165
7971 "B<getgid>(2), B<getuid>(2), B<seteuid>(2), B<setgid>(2), B<setresuid>(2), "
7972 "B<setuid>(2), B<capabilities>(7)"
7976 #: build/C/man2/setsid.2:29
7982 #: build/C/man2/setsid.2:29
7988 #: build/C/man2/setsid.2:32
7989 msgid "setsid - creates a session and sets the process group ID"
7993 #: build/C/man2/setsid.2:37
7994 msgid "B<pid_t setsid(void);>"
7998 #: build/C/man2/setsid.2:50
8000 "B<setsid>() creates a new session if the calling process is not a process "
8001 "group leader. The calling process is the leader of the new session, the "
8002 "process group leader of the new process group, and has no controlling tty. "
8003 "The process group ID and session ID of the calling process are set to the "
8004 "PID of the calling process. The calling process will be the only process in "
8005 "this new process group and in this new session."
8009 #: build/C/man2/setsid.2:57
8011 "On success, the (new) session ID of the calling process is returned. On "
8012 "error, I<(pid_t)\\ -1> is returned, and I<errno> is set to indicate the "
8017 #: build/C/man2/setsid.2:64
8019 "The process group ID of any process equals the PID of the calling process. "
8020 "Thus, in particular, B<setsid>() fails if the calling process is already a "
8021 "process group leader."
8025 #: build/C/man2/setsid.2:72
8027 "A child created via B<fork>(2) inherits its parent's session ID. The "
8028 "session ID is preserved across an B<execve>(2)."
8032 #: build/C/man2/setsid.2:83
8034 "A process group leader is a process with process group ID equal to its PID. "
8035 "In order to be sure that B<setsid>() will succeed, B<fork>(2) and "
8036 "B<_exit>(2), and have the child do B<setsid>()."
8040 #: build/C/man2/setsid.2:89
8042 "B<getsid>(2), B<setpgid>(2), B<setpgrp>(2), B<tcgetsid>(3), "
8047 #: build/C/man2/setuid.2:28
8053 #: build/C/man2/setuid.2:31
8054 msgid "setuid - set user identity"
8058 #: build/C/man2/setuid.2:37
8059 msgid "B<int setuid(uid_t >I<uid>B<);>"
8063 #: build/C/man2/setuid.2:42
8065 "B<setuid>() sets the effective user ID of the calling process. If the "
8066 "effective UID of the caller is root, the real UID and saved set-user-ID are "
8071 #: build/C/man2/setuid.2:51
8073 "Under Linux, B<setuid>() is implemented like the POSIX version with the "
8074 "B<_POSIX_SAVED_IDS> feature. This allows a set-user-ID (other than root) "
8075 "program to drop all of its user privileges, do some un-privileged work, and "
8076 "then reengage the original effective user ID in a secure manner."
8080 #: build/C/man2/setuid.2:61
8082 "If the user is root or the program is set-user-ID-root, special care must be "
8083 "taken. The B<setuid>() function checks the effective user ID of the caller "
8084 "and if it is the superuser, all process-related user ID's are set to "
8085 "I<uid>. After this has occurred, it is impossible for the program to regain "
8090 #: build/C/man2/setuid.2:68
8092 "Thus, a set-user-ID-root program wishing to temporarily drop root "
8093 "privileges, assume the identity of an unprivileged user, and then regain "
8094 "root privileges afterward cannot use B<setuid>(). You can accomplish this "
8095 "with B<seteuid>(2)."
8099 #: build/C/man2/setuid.2:83
8101 "The I<uid> does not match the current uid and I<uid> brings process over its "
8102 "B<RLIMIT_NPROC> resource limit."
8106 #: build/C/man2/setuid.2:90
8108 "The user is not privileged (Linux: does not have the B<CAP_SETUID> "
8109 "capability) and I<uid> does not match the real UID or saved set-user-ID of "
8110 "the calling process."
8113 #. SVr4 documents an additional EINVAL error condition.
8115 #: build/C/man2/setuid.2:95
8117 "SVr4, POSIX.1-2001. Not quite compatible with the 4.4BSD call, which sets "
8118 "all of the real, saved, and effective user IDs."
8122 #: build/C/man2/setuid.2:103
8124 "Linux has the concept of the file system user ID, normally equal to the "
8125 "effective user ID. The B<setuid>() call also sets the file system user ID "
8126 "of the calling process. See B<setfsuid>(2)."
8130 #: build/C/man2/setuid.2:108
8132 "If I<uid> is different from the old effective UID, the process will be "
8133 "forbidden from leaving core dumps."
8137 #: build/C/man2/setuid.2:118
8139 "The original Linux B<setuid>() system call supported only 16-bit user IDs. "
8140 "Subsequently, Linux 2.4 added B<setuid32>() supporting 32-bit IDs. The "
8141 "glibc B<setuid>() wrapper function transparently deals with the variation "
8142 "across kernel versions."
8146 #: build/C/man2/setuid.2:125
8148 "B<getuid>(2), B<seteuid>(2), B<setfsuid>(2), B<setreuid>(2), "
8149 "B<capabilities>(7), B<credentials>(7)"
8153 #: build/C/man7/svipc.7:25
8159 #: build/C/man7/svipc.7:25
8165 #: build/C/man7/svipc.7:28
8166 msgid "svipc - System V interprocess communication mechanisms"
8170 #: build/C/man7/svipc.7:35
8173 "B<#include E<lt>sys/types.hE<gt>>\n"
8174 "B<#include E<lt>sys/ipc.hE<gt>>\n"
8175 "B<#include E<lt>sys/msg.hE<gt>>\n"
8176 "B<#include E<lt>sys/sem.hE<gt>>\n"
8177 "B<#include E<lt>sys/shm.hE<gt>>\n"
8181 #: build/C/man7/svipc.7:43
8183 "This manual page refers to the Linux implementation of the System V "
8184 "interprocess communication (IPC) mechanisms: message queues, semaphore sets, "
8185 "and shared memory segments. In the following, the word I<resource> means an "
8186 "instantiation of one among such mechanisms."
8190 #: build/C/man7/svipc.7:43
8192 msgid "Resource Access Permissions"
8196 #: build/C/man7/svipc.7:53
8198 "For each resource, the system uses a common structure of type I<struct "
8199 "ipc_perm> to store information needed in determining permissions to perform "
8200 "an IPC operation. The I<ipc_perm> structure, defined by the "
8201 "I<E<lt>sys/ipc.hE<gt>> system header file, includes the following members:"
8205 #: build/C/man7/svipc.7:63
8208 "struct ipc_perm {\n"
8209 " uid_t cuid; /* creator user ID */\n"
8210 " gid_t cgid; /* creator group ID */\n"
8211 " uid_t uid; /* owner user ID */\n"
8212 " gid_t gid; /* owner group ID */\n"
8213 " unsigned short mode; /* r/w permissions */\n"
8218 #: build/C/man7/svipc.7:73
8220 "The I<mode> member of the I<ipc_perm> structure defines, with its lower 9 "
8221 "bits, the access permissions to the resource for a process executing an IPC "
8222 "system call. The permissions are interpreted as follows:"
8226 #: build/C/man7/svipc.7:77
8229 " 0400 Read by user.\n"
8230 " 0200 Write by user.\n"
8234 #: build/C/man7/svipc.7:80
8237 " 0040 Read by group.\n"
8238 " 0020 Write by group.\n"
8242 #: build/C/man7/svipc.7:83
8245 " 0004 Read by others.\n"
8246 " 0002 Write by others.\n"
8250 #: build/C/man7/svipc.7:91
8252 "Bits 0100, 0010, and 0001 (the execute bits) are unused by the system. "
8253 "Furthermore, \"write\" effectively means \"alter\" for a semaphore set."
8257 #: build/C/man7/svipc.7:94
8258 msgid "The same system header file also defines the following symbolic constants:"
8262 #: build/C/man7/svipc.7:94
8264 msgid "B<IPC_CREAT>"
8268 #: build/C/man7/svipc.7:97
8269 msgid "Create entry if key doesn't exist."
8273 #: build/C/man7/svipc.7:97
8279 #: build/C/man7/svipc.7:100
8280 msgid "Fail if key exists."
8284 #: build/C/man7/svipc.7:100
8286 msgid "B<IPC_NOWAIT>"
8290 #: build/C/man7/svipc.7:103
8291 msgid "Error if request must wait."
8295 #: build/C/man7/svipc.7:103
8297 msgid "B<IPC_PRIVATE>"
8301 #: build/C/man7/svipc.7:106
8302 msgid "Private key."
8306 #: build/C/man7/svipc.7:106
8312 #: build/C/man7/svipc.7:109
8313 msgid "Remove resource."
8317 #: build/C/man7/svipc.7:109
8323 #: build/C/man7/svipc.7:112
8324 msgid "Set resource options."
8328 #: build/C/man7/svipc.7:112
8334 #: build/C/man7/svipc.7:115
8335 msgid "Get resource options."
8339 #: build/C/man7/svipc.7:124
8341 "Note that B<IPC_PRIVATE> is a I<key_t> type, while all the other symbolic "
8342 "constants are flag fields and can be OR'ed into an I<int> type variable."
8346 #: build/C/man7/svipc.7:124
8348 msgid "Message Queues"
8352 #: build/C/man7/svipc.7:132
8354 "A message queue is uniquely identified by a positive integer (its I<msqid>) "
8355 "and has an associated data structure of type I<struct msqid_ds>, defined in "
8356 "I<E<lt>sys/msg.hE<gt>>, containing the following members:"
8360 #: build/C/man7/svipc.7:145
8363 "struct msqid_ds {\n"
8364 " struct ipc_perm msg_perm;\n"
8365 " msgqnum_t msg_qnum; /* no of messages on queue */\n"
8366 " msglen_t msg_qbytes; /* bytes max on a queue */\n"
8367 " pid_t msg_lspid; /* PID of last msgsnd(2) call */\n"
8368 " pid_t msg_lrpid; /* PID of last msgrcv(2) call */\n"
8369 " time_t msg_stime; /* last msgsnd(2) time */\n"
8370 " time_t msg_rtime; /* last msgrcv(2) time */\n"
8371 " time_t msg_ctime; /* last change time */\n"
8376 #: build/C/man7/svipc.7:147
8382 #: build/C/man7/svipc.7:152
8384 "I<ipc_perm> structure that specifies the access permissions on the message "
8389 #: build/C/man7/svipc.7:152
8395 #: build/C/man7/svipc.7:155
8396 msgid "Number of messages currently on the message queue."
8400 #: build/C/man7/svipc.7:155
8402 msgid "I<msg_qbytes>"
8406 #: build/C/man7/svipc.7:159
8407 msgid "Maximum number of bytes of message text allowed on the message queue."
8411 #: build/C/man7/svipc.7:159
8413 msgid "I<msg_lspid>"
8417 #: build/C/man7/svipc.7:164
8418 msgid "ID of the process that performed the last B<msgsnd>(2) system call."
8422 #: build/C/man7/svipc.7:164
8424 msgid "I<msg_lrpid>"
8428 #: build/C/man7/svipc.7:169
8429 msgid "ID of the process that performed the last B<msgrcv>(2) system call."
8433 #: build/C/man7/svipc.7:169
8435 msgid "I<msg_stime>"
8439 #: build/C/man7/svipc.7:174
8440 msgid "Time of the last B<msgsnd>(2) system call."
8444 #: build/C/man7/svipc.7:174
8446 msgid "I<msg_rtime>"
8450 #: build/C/man7/svipc.7:179
8451 msgid "Time of the last B<msgrcv>(2) system call."
8455 #: build/C/man7/svipc.7:179
8457 msgid "I<msg_ctime>"
8461 #: build/C/man7/svipc.7:185
8463 "Time of the last system call that changed a member of the I<msqid_ds> "
8468 #: build/C/man7/svipc.7:185
8470 msgid "Semaphore Sets"
8474 #: build/C/man7/svipc.7:193
8476 "A semaphore set is uniquely identified by a positive integer (its I<semid>) "
8477 "and has an associated data structure of type I<struct semid_ds>, defined in "
8478 "I<E<lt>sys/sem.hE<gt>>, containing the following members:"
8482 #: build/C/man7/svipc.7:202
8485 "struct semid_ds {\n"
8486 " struct ipc_perm sem_perm;\n"
8487 " time_t sem_otime; /* last operation time */\n"
8488 " time_t sem_ctime; /* last change time */\n"
8489 " unsigned long sem_nsems; /* count of sems in set */\n"
8494 #: build/C/man7/svipc.7:204
8500 #: build/C/man7/svipc.7:209
8502 "I<ipc_perm> structure that specifies the access permissions on the semaphore "
8507 #: build/C/man7/svipc.7:209
8509 msgid "I<sem_otime>"
8513 #: build/C/man7/svipc.7:214
8514 msgid "Time of last B<semop>(2) system call."
8518 #: build/C/man7/svipc.7:214
8520 msgid "I<sem_ctime>"
8524 #: build/C/man7/svipc.7:220
8526 "Time of last B<semctl>(2) system call that changed a member of the above "
8527 "structure or of one semaphore belonging to the set."
8531 #: build/C/man7/svipc.7:220
8533 msgid "I<sem_nsems>"
8537 #: build/C/man7/svipc.7:228
8539 "Number of semaphores in the set. Each semaphore of the set is referenced by "
8540 "a nonnegative integer ranging from B<0> to I<sem_nsems-1>."
8544 #: build/C/man7/svipc.7:232
8546 "A semaphore is a data structure of type I<struct sem> containing the "
8547 "following members:"
8550 #. unsigned short semncnt; /* nr awaiting semval to increase */
8551 #. unsigned short semzcnt; /* nr awaiting semval = 0 */
8553 #: build/C/man7/svipc.7:241
8557 " int semval; /* semaphore value */\n"
8558 " int sempid; /* PID for last operation */\n"
8563 #: build/C/man7/svipc.7:243
8569 #: build/C/man7/svipc.7:246
8570 msgid "Semaphore value: a nonnegative integer."
8574 #: build/C/man7/svipc.7:246
8581 #. Number of processes suspended awaiting for
8586 #. Number of processes suspended awaiting for
8590 #: build/C/man7/svipc.7:260
8592 "ID of the last process that performed a semaphore operation on this "
8597 #: build/C/man7/svipc.7:260
8599 msgid "Shared Memory Segments"
8603 #: build/C/man7/svipc.7:268
8605 "A shared memory segment is uniquely identified by a positive integer (its "
8606 "I<shmid>) and has an associated data structure of type I<struct shmid_ds>, "
8607 "defined in I<E<lt>sys/shm.hE<gt>>, containing the following members:"
8611 #: build/C/man7/svipc.7:281
8614 "struct shmid_ds {\n"
8615 " struct ipc_perm shm_perm;\n"
8616 " size_t shm_segsz; /* size of segment */\n"
8617 " pid_t shm_cpid; /* PID of creator */\n"
8618 " pid_t shm_lpid; /* PID, last operation */\n"
8619 " shmatt_t shm_nattch; /* no. of current attaches */\n"
8620 " time_t shm_atime; /* time of last attach */\n"
8621 " time_t shm_dtime; /* time of last detach */\n"
8622 " time_t shm_ctime; /* time of last change */\n"
8627 #: build/C/man7/svipc.7:283
8633 #: build/C/man7/svipc.7:288
8635 "I<ipc_perm> structure that specifies the access permissions on the shared "
8640 #: build/C/man7/svipc.7:288
8642 msgid "I<shm_segsz>"
8646 #: build/C/man7/svipc.7:291
8647 msgid "Size in bytes of the shared memory segment."
8651 #: build/C/man7/svipc.7:291
8657 #: build/C/man7/svipc.7:294
8658 msgid "ID of the process that created the shared memory segment."
8662 #: build/C/man7/svipc.7:294
8668 #: build/C/man7/svipc.7:301
8670 "ID of the last process that executed a B<shmat>(2) or B<shmdt>(2) system "
8675 #: build/C/man7/svipc.7:301
8677 msgid "I<shm_nattch>"
8681 #: build/C/man7/svipc.7:304
8682 msgid "Number of current alive attaches for this shared memory segment."
8686 #: build/C/man7/svipc.7:304
8688 msgid "I<shm_atime>"
8692 #: build/C/man7/svipc.7:309
8693 msgid "Time of the last B<shmat>(2) system call."
8697 #: build/C/man7/svipc.7:309
8699 msgid "I<shm_dtime>"
8703 #: build/C/man7/svipc.7:314
8704 msgid "Time of the last B<shmdt>(2) system call."
8708 #: build/C/man7/svipc.7:314
8710 msgid "I<shm_ctime>"
8714 #: build/C/man7/svipc.7:320
8715 msgid "Time of the last B<shmctl>(2) system call that changed I<shmid_ds>."
8719 #: build/C/man7/svipc.7:334
8721 "B<ipc>(2), B<msgctl>(2), B<msgget>(2), B<msgrcv>(2), B<msgsnd>(2), "
8722 "B<semctl>(2), B<semget>(2), B<semop>(2), B<shmat>(2), B<shmctl>(2), "
8723 "B<shmdt>(2), B<shmget>(2), B<ftok>(3)"
8727 #: build/C/man3/ulimit.3:27
8733 #: build/C/man3/ulimit.3:27
8739 #: build/C/man3/ulimit.3:30
8740 msgid "ulimit - get and set user limits"
8744 #: build/C/man3/ulimit.3:32
8745 msgid "B<#include E<lt>ulimit.hE<gt>>"
8749 #: build/C/man3/ulimit.3:34
8750 msgid "B<long ulimit(int >I<cmd>B<, long >I<newlimit>B<);>"
8754 #: build/C/man3/ulimit.3:46
8756 "Warning: This routine is obsolete. Use B<getrlimit>(2), B<setrlimit>(2), "
8757 "and B<sysconf>(3) instead. For the shell command B<ulimit>(), see "
8762 #: build/C/man3/ulimit.3:53
8764 "The B<ulimit>() call will get or set some limit for the calling process. "
8765 "The I<cmd> argument can have one of the following values."
8769 #: build/C/man3/ulimit.3:53
8771 msgid "B<UL_GETFSIZE>"
8775 #: build/C/man3/ulimit.3:56
8776 msgid "Return the limit on the size of a file, in units of 512 bytes."
8780 #: build/C/man3/ulimit.3:56
8782 msgid "B<UL_SETFSIZE>"
8786 #: build/C/man3/ulimit.3:59
8787 msgid "Set the limit on the size of a file."
8791 #: build/C/man3/ulimit.3:59
8797 #: build/C/man3/ulimit.3:63
8799 "(Not implemented for Linux.) Return the maximum possible address of the "
8804 #: build/C/man3/ulimit.3:63
8810 #: build/C/man3/ulimit.3:67
8812 "(Implemented but no symbolic constant provided.) Return the maximum number "
8813 "of files that the calling process can open."
8817 #: build/C/man3/ulimit.3:74
8819 "On success, B<ulimit>() returns a nonnegative value. On error, -1 is "
8820 "returned, and I<errno> is set appropriately."
8824 #: build/C/man3/ulimit.3:78
8825 msgid "A unprivileged process tried to increase a limit."
8829 #: build/C/man3/ulimit.3:83
8830 msgid "SVr4, POSIX.1-2001. POSIX.1-2008 marks B<ulimit>() as obsolete."
8834 #: build/C/man3/ulimit.3:88
8835 msgid "B<bash>(1), B<getrlimit>(2), B<setrlimit>(2), B<sysconf>(3)"