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-19 23:50+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=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: build/C/man2/arch_prctl.2:24
26 #: build/C/man2/arch_prctl.2:24
32 #: build/C/man2/arch_prctl.2:24 build/C/man2/futex.2:17 build/C/man2/kexec_load.2:25 build/C/man2/lookup_dcookie.2:27 build/C/man2/modify_ldt.2:25 build/C/man2/nfsservctl.2:8 build/C/man2/outb.2:28 build/C/man2/pciconfig_read.2:5 build/C/man2/personality.2:30 build/C/man2/pivot_root.2:7 build/C/man2/ptrace.2:45 build/C/man2/quotactl.2:25 build/C/man2/sendfile.2:15 build/C/man2/set_tid_address.2:23 build/C/man2/splice.2:26 build/C/man2/tee.2:26 build/C/man2/vm86.2:26 build/C/man2/vmsplice.2:26
38 #: build/C/man2/arch_prctl.2:24 build/C/man2/futex.2:17 build/C/man2/kexec_load.2:25 build/C/man2/lookup_dcookie.2:27 build/C/man2/modify_ldt.2:25 build/C/man2/nfsservctl.2:8 build/C/man2/outb.2:28 build/C/man2/pciconfig_read.2:5 build/C/man2/personality.2:30 build/C/man2/pivot_root.2:7 build/C/man2/ptrace.2:45 build/C/man2/quotactl.2:25 build/C/man2/sendfile.2:15 build/C/man2/set_tid_address.2:23 build/C/man2/splice.2:26 build/C/man2/tee.2:26 build/C/man2/vm86.2:26 build/C/man2/vmsplice.2:26
40 msgid "Linux Programmer's Manual"
44 #: build/C/man2/arch_prctl.2:25 build/C/man2/futex.2:18 build/C/man2/kexec_load.2:26 build/C/man2/lookup_dcookie.2:28 build/C/man2/modify_ldt.2:26 build/C/man2/nfsservctl.2:9 build/C/man2/outb.2:29 build/C/man2/pciconfig_read.2:6 build/C/man2/personality.2:31 build/C/man2/pivot_root.2:8 build/C/man2/ptrace.2:46 build/C/man2/quotactl.2:26 build/C/man2/sendfile.2:16 build/C/man2/set_tid_address.2:24 build/C/man2/splice.2:27 build/C/man2/tee.2:27 build/C/man2/vm86.2:27 build/C/man2/vmsplice.2:27
50 #: build/C/man2/arch_prctl.2:27
51 msgid "arch_prctl - set architecture-specific thread state"
55 #: build/C/man2/arch_prctl.2:27 build/C/man2/futex.2:20 build/C/man2/kexec_load.2:28 build/C/man2/lookup_dcookie.2:30 build/C/man2/modify_ldt.2:28 build/C/man2/nfsservctl.2:11 build/C/man2/pciconfig_read.2:8 build/C/man2/personality.2:33 build/C/man2/pivot_root.2:10 build/C/man2/ptrace.2:48 build/C/man2/quotactl.2:28 build/C/man2/sendfile.2:18 build/C/man2/set_tid_address.2:26 build/C/man2/splice.2:29 build/C/man2/tee.2:29 build/C/man2/vm86.2:29 build/C/man2/vmsplice.2:29
61 #: build/C/man2/arch_prctl.2:30
63 msgid "B<#include E<lt>asm/prctl.hE<gt>>\n"
67 #: build/C/man2/arch_prctl.2:32
69 msgid "B<#include E<lt>sys/prctl.hE<gt>>\n"
73 #: build/C/man2/arch_prctl.2:35
76 "B<int arch_prctl(int >I<code>B<, unsigned long >I<addr>B<);>\n"
77 "B<int arch_prctl(int >I<code>B<, unsigned long *>I<addr>B<);>\n"
80 #. Return type was long before glibc 2.7
82 #: build/C/man2/arch_prctl.2:36 build/C/man2/futex.2:32 build/C/man2/kexec_load.2:35 build/C/man2/lookup_dcookie.2:32 build/C/man2/modify_ldt.2:34 build/C/man2/nfsservctl.2:18 build/C/man2/outb.2:33 build/C/man2/pciconfig_read.2:19 build/C/man2/personality.2:37 build/C/man2/pivot_root.2:12 build/C/man2/ptrace.2:55 build/C/man2/quotactl.2:36 build/C/man2/sendfile.2:43 build/C/man2/set_tid_address.2:32 build/C/man2/splice.2:39 build/C/man2/tee.2:38 build/C/man2/vm86.2:35 build/C/man2/vmsplice.2:39
88 #: build/C/man2/arch_prctl.2:51
90 "The B<arch_prctl>() function sets architecture-specific process or thread "
91 "state. I<code> selects a subfunction and passes argument I<addr> to it; "
92 "I<addr> is interpreted as either an I<unsigned long> for the \"set\" "
93 "operations, or as an I<unsigned long *>, for the \"get\" operations."
97 #: build/C/man2/arch_prctl.2:53
98 msgid "Sub functions for x86-64 are:"
102 #: build/C/man2/arch_prctl.2:53
104 msgid "B<ARCH_SET_FS>"
108 #: build/C/man2/arch_prctl.2:59
109 msgid "Set the 64-bit base for the I<FS> register to I<addr>."
113 #: build/C/man2/arch_prctl.2:59
115 msgid "B<ARCH_GET_FS>"
119 #: build/C/man2/arch_prctl.2:67
121 "Return the 64-bit base value for the I<FS> register of the current thread in "
122 "the I<unsigned long> pointed to by I<addr>."
126 #: build/C/man2/arch_prctl.2:67
128 msgid "B<ARCH_SET_GS>"
132 #: build/C/man2/arch_prctl.2:73
133 msgid "Set the 64-bit base for the I<GS> register to I<addr>."
137 #: build/C/man2/arch_prctl.2:73
139 msgid "B<ARCH_GET_GS>"
143 #: build/C/man2/arch_prctl.2:81
145 "Return the 64-bit base value for the I<GS> register of the current thread in "
146 "the I<unsigned long> pointed to by I<addr>."
150 #: build/C/man2/arch_prctl.2:81 build/C/man2/futex.2:173 build/C/man2/kexec_load.2:110 build/C/man2/lookup_dcookie.2:43 build/C/man2/modify_ldt.2:96 build/C/man2/nfsservctl.2:48 build/C/man2/pciconfig_read.2:47 build/C/man2/personality.2:55 build/C/man2/pivot_root.2:95 build/C/man2/ptrace.2:399 build/C/man2/sendfile.2:104 build/C/man2/set_tid_address.2:80 build/C/man2/splice.2:127 build/C/man2/tee.2:85 build/C/man2/vm86.2:52 build/C/man2/vmsplice.2:113
156 #: build/C/man2/arch_prctl.2:87
158 "On success, B<arch_prctl>() returns 0; on error, -1 is returned, and "
159 "I<errno> is set to indicate the error."
163 #: build/C/man2/arch_prctl.2:87 build/C/man2/futex.2:210 build/C/man2/kexec_load.2:117 build/C/man2/lookup_dcookie.2:50 build/C/man2/modify_ldt.2:106 build/C/man2/pciconfig_read.2:74 build/C/man2/personality.2:62 build/C/man2/pivot_root.2:99 build/C/man2/ptrace.2:412 build/C/man2/quotactl.2:425 build/C/man2/sendfile.2:111 build/C/man2/set_tid_address.2:83 build/C/man2/splice.2:142 build/C/man2/tee.2:100 build/C/man2/vm86.2:57 build/C/man2/vmsplice.2:122
169 #: build/C/man2/arch_prctl.2:88 build/C/man2/futex.2:222 build/C/man2/lookup_dcookie.2:51 build/C/man2/modify_ldt.2:107 build/C/man2/ptrace.2:417 build/C/man2/quotactl.2:426 build/C/man2/sendfile.2:121 build/C/man2/vm86.2:58
175 #: build/C/man2/arch_prctl.2:92
177 "I<addr> points to an unmapped address or is outside the process address "
182 #: build/C/man2/arch_prctl.2:92 build/C/man2/futex.2:227 build/C/man2/kexec_load.2:122 build/C/man2/lookup_dcookie.2:54 build/C/man2/modify_ldt.2:111 build/C/man2/pciconfig_read.2:75 build/C/man2/personality.2:63 build/C/man2/pivot_root.2:108 build/C/man2/ptrace.2:428 build/C/man2/quotactl.2:432 build/C/man2/quotactl.2:499 build/C/man2/sendfile.2:124 build/C/man2/splice.2:147 build/C/man2/tee.2:101 build/C/man2/vmsplice.2:127
188 #: build/C/man2/arch_prctl.2:96
189 msgid "I<code> is not a valid subcommand."
193 #: build/C/man2/arch_prctl.2:96 build/C/man2/kexec_load.2:129 build/C/man2/lookup_dcookie.2:65 build/C/man2/pciconfig_read.2:102 build/C/man2/pivot_root.2:114 build/C/man2/ptrace.2:437 build/C/man2/quotactl.2:454 build/C/man2/vm86.2:66
199 #. Man page written by Andi Kleen.
201 #: build/C/man2/arch_prctl.2:102
202 msgid "I<addr> is outside the process address space."
206 #: build/C/man2/arch_prctl.2:102 build/C/man2/futex.2:247 build/C/man2/kexec_load.2:138 build/C/man2/lookup_dcookie.2:78 build/C/man2/modify_ldt.2:128 build/C/man2/nfsservctl.2:53 build/C/man2/outb.2:58 build/C/man2/pciconfig_read.2:107 build/C/man2/personality.2:66 build/C/man2/pivot_root.2:122 build/C/man2/ptrace.2:453 build/C/man2/sendfile.2:144 build/C/man2/set_tid_address.2:89 build/C/man2/splice.2:169 build/C/man2/tee.2:118 build/C/man2/vm86.2:71 build/C/man2/vmsplice.2:142
208 msgid "CONFORMING TO"
212 #: build/C/man2/arch_prctl.2:106
214 "B<arch_prctl>() is a Linux/x86-64 extension and should not be used in "
215 "programs intended to be portable."
219 #: build/C/man2/arch_prctl.2:106 build/C/man2/futex.2:249 build/C/man2/kexec_load.2:140 build/C/man2/lookup_dcookie.2:81 build/C/man2/modify_ldt.2:131 build/C/man2/pivot_root.2:125 build/C/man2/ptrace.2:455 build/C/man2/sendfile.2:151 build/C/man2/splice.2:171 build/C/man2/tee.2:120 build/C/man2/vmsplice.2:144
225 #: build/C/man2/arch_prctl.2:109
227 "B<arch_prctl>() is only supported on Linux/x86-64 for 64-bit programs "
232 #: build/C/man2/arch_prctl.2:111
233 msgid "The 64-bit base changes when a new 32-bit segment selector is loaded."
237 #: build/C/man2/arch_prctl.2:114
238 msgid "B<ARCH_SET_GS> is disabled in some kernels."
242 #: build/C/man2/arch_prctl.2:129
244 "Context switches for 64-bit segment bases are rather expensive. It may be a "
245 "faster alternative to set a 32-bit base using a segment selector by setting "
246 "up an LDT with B<modify_ldt>(2) or using the B<set_thread_area>(2) system "
247 "call in kernel 2.5 or later. B<arch_prctl>() is only needed when you want "
248 "to set bases that are larger than 4GB. Memory in the first 2GB of address "
249 "space can be allocated by using B<mmap>(2) with the B<MAP_32BIT> flag."
253 #: build/C/man2/arch_prctl.2:134
255 "As of version 2.7, glibc provides no prototype for B<arch_prctl>(). You "
256 "have to declare it yourself for now. This may be fixed in future glibc "
261 #: build/C/man2/arch_prctl.2:137
262 msgid "I<FS> may be already used by the threading library."
266 #: build/C/man2/arch_prctl.2:137 build/C/man2/futex.2:263 build/C/man2/kexec_load.2:155 build/C/man2/modify_ldt.2:134 build/C/man2/outb.2:67 build/C/man2/pciconfig_read.2:109 build/C/man2/pivot_root.2:137 build/C/man2/ptrace.2:530 build/C/man2/quotactl.2:505 build/C/man2/sendfile.2:193 build/C/man2/set_tid_address.2:91 build/C/man2/splice.2:225 build/C/man2/tee.2:196 build/C/man2/vmsplice.2:153
272 #: build/C/man2/arch_prctl.2:142
273 msgid "B<mmap>(2), B<modify_ldt>(2), B<prctl>(2), B<set_thread_area>(2)"
277 #: build/C/man2/arch_prctl.2:144
278 msgid "AMD X86-64 Programmer's manual"
282 #: build/C/man2/arch_prctl.2:144 build/C/man2/futex.2:274 build/C/man2/kexec_load.2:158 build/C/man2/lookup_dcookie.2:88 build/C/man2/modify_ldt.2:136 build/C/man2/nfsservctl.2:55 build/C/man2/outb.2:70 build/C/man2/pciconfig_read.2:111 build/C/man2/personality.2:70 build/C/man2/pivot_root.2:143 build/C/man2/ptrace.2:539 build/C/man2/quotactl.2:510 build/C/man2/sendfile.2:199 build/C/man2/set_tid_address.2:94 build/C/man2/splice.2:229 build/C/man2/tee.2:199 build/C/man2/vm86.2:74 build/C/man2/vmsplice.2:156
288 #: build/C/man2/arch_prctl.2:151 build/C/man2/futex.2:281 build/C/man2/kexec_load.2:165 build/C/man2/lookup_dcookie.2:95 build/C/man2/modify_ldt.2:143 build/C/man2/nfsservctl.2:62 build/C/man2/outb.2:77 build/C/man2/pciconfig_read.2:118 build/C/man2/personality.2:77 build/C/man2/pivot_root.2:150 build/C/man2/ptrace.2:546 build/C/man2/quotactl.2:517 build/C/man2/sendfile.2:206 build/C/man2/set_tid_address.2:101 build/C/man2/splice.2:236 build/C/man2/tee.2:206 build/C/man2/vm86.2:81 build/C/man2/vmsplice.2:163
290 "This page is part of release 3.35 of the Linux I<man-pages> project. A "
291 "description of the project, and information about reporting bugs, can be "
292 "found at http://man7.org/linux/man-pages/."
296 #: build/C/man2/futex.2:17
302 #: build/C/man2/futex.2:17
308 #: build/C/man2/futex.2:20
309 msgid "futex - Fast Userspace Locking system call"
313 #: build/C/man2/futex.2:25
316 "B<#include E<lt>linux/futex.hE<gt>>\n"
317 "B<#include E<lt>sys/time.hE<gt>>\n"
321 #: build/C/man2/futex.2:28
324 "B<int futex(int *>I<uaddr>B<, int >I<op>B<, int >I<val>B<, const struct "
325 "timespec *>I<timeout>B<,>\n"
328 #. int *? void *? u32 *?
330 #: build/C/man2/futex.2:31
332 msgid "B< int *>I<uaddr2>B<, int >I<val3>B<);>\n"
336 #: build/C/man2/futex.2:48
338 "The B<futex>() system call provides a method for a program to wait for a "
339 "value at a given address to change, and a method to wake up anyone waiting "
340 "on a particular address (while the addresses for the same memory in separate "
341 "processes may not be equal, the kernel maps them internally so the same "
342 "memory mapped in different locations will correspond for B<futex>() "
343 "calls). This system call is typically used to implement the contended case "
344 "of a lock in shared memory, as described in B<futex>(7)."
348 #: build/C/man2/futex.2:55
350 "When a B<futex>(7) operation did not finish uncontended in userspace, a "
351 "call needs to be made to the kernel to arbitrate. Arbitration can either "
352 "mean putting the calling process to sleep or, conversely, waking a waiting "
357 #: build/C/man2/futex.2:62
359 "Callers of this function are expected to adhere to the semantics as set out "
360 "in B<futex>(7). As these semantics involve writing nonportable assembly "
361 "instructions, this in turn probably means that most users will in fact be "
362 "library authors and not general application developers."
366 #: build/C/man2/futex.2:70
368 "The I<uaddr> argument needs to point to an aligned integer which stores the "
369 "counter. The operation to execute is passed via the I<op> argument, along "
370 "with a value I<val>."
374 #: build/C/man2/futex.2:72
375 msgid "Five operations are currently defined:"
379 #: build/C/man2/futex.2:72 build/C/man2/futex.2:177
381 msgid "B<FUTEX_WAIT>"
385 #: build/C/man2/futex.2:90
387 "This operation atomically verifies that the futex address I<uaddr> still "
388 "contains the value I<val>, and sleeps awaiting B<FUTEX_WAKE> on this futex "
389 "address. If the I<timeout> argument is non-NULL, its contents describe the "
390 "maximum duration of the wait, which is infinite otherwise. The arguments "
391 "I<uaddr2> and I<val3> are ignored."
395 #: build/C/man2/futex.2:98
397 "For B<futex>(7), this call is executed if decrementing the count gave a "
398 "negative value (indicating contention), and will sleep until another process "
399 "releases the futex and executes the B<FUTEX_WAKE> operation."
403 #: build/C/man2/futex.2:98 build/C/man2/futex.2:194
405 msgid "B<FUTEX_WAKE>"
409 #: build/C/man2/futex.2:109
411 "This operation wakes at most I<val> processes waiting on this futex address "
412 "(i.e., inside B<FUTEX_WAIT>). The arguments I<timeout>, I<uaddr2> and "
413 "I<val3> are ignored."
417 #: build/C/man2/futex.2:115
419 "For B<futex>(7), this is executed if incrementing the count showed that "
420 "there were waiters, once the futex value has been set to 1 (indicating that "
425 #: build/C/man2/futex.2:115
427 msgid "B<FUTEX_FD> (present up to and including Linux 2.6.25)"
430 #. , suitable for .BR poll (2).
432 #: build/C/man2/futex.2:131
434 "To support asynchronous wakeups, this operation associates a file descriptor "
435 "with a futex. If another process executes a B<FUTEX_WAKE>, the process will "
436 "receive the signal number that was passed in I<val>. The calling process "
437 "must close the returned file descriptor after use. The arguments "
438 "I<timeout>, I<uaddr2> and I<val3> are ignored."
442 #: build/C/man2/futex.2:136
444 "To prevent race conditions, the caller should test if the futex has been "
445 "upped after B<FUTEX_FD> returns."
449 #: build/C/man2/futex.2:140
451 "Because it was inherently racy, B<FUTEX_FD> has been removed from Linux "
456 #: build/C/man2/futex.2:140
458 msgid "B<FUTEX_REQUEUE> (since Linux 2.5.70)"
462 #: build/C/man2/futex.2:155
464 "This operation was introduced in order to avoid a \"thundering herd\" effect "
465 "when B<FUTEX_WAKE> is used and all processes woken up need to acquire "
466 "another futex. This call wakes up I<val> processes, and requeues all other "
467 "waiters on the futex at address I<uaddr2>. The arguments I<timeout> and "
468 "I<val3> are ignored."
472 #: build/C/man2/futex.2:155
474 msgid "B<FUTEX_CMP_REQUEUE> (since Linux 2.6.7)"
478 #: build/C/man2/futex.2:173
480 "There was a race in the intended use of B<FUTEX_REQUEUE>, so "
481 "B<FUTEX_CMP_REQUEUE> was introduced. This is similar to B<FUTEX_REQUEUE>, "
482 "but first checks whether the location I<uaddr> still contains the value "
483 "I<val3>. If not, the operation fails with the error B<EAGAIN>. The "
484 "argument I<timeout> is ignored."
488 #: build/C/man2/futex.2:177
490 "Depending on which operation was executed, the returned value for a "
491 "successful call can have differing meanings."
495 #: build/C/man2/futex.2:194
497 "Returns 0 if the process was woken by a B<FUTEX_WAKE> call. In case of "
498 "timeout, the operation fails with the error B<ETIMEDOUT>. If the futex was "
499 "not equal to the expected value, the operation fails with the error "
500 "B<EWOULDBLOCK>. Signals (see B<signal>(7)) or other spurious wakeups cause "
501 "B<FUTEX_WAIT> to fail with the error B<EINTR>."
505 #: build/C/man2/futex.2:197 build/C/man2/futex.2:203 build/C/man2/futex.2:206
506 msgid "Returns the number of processes woken up."
510 #: build/C/man2/futex.2:197
516 #: build/C/man2/futex.2:200
517 msgid "Returns the new file descriptor associated with the futex."
521 #: build/C/man2/futex.2:200
523 msgid "B<FUTEX_REQUEUE>"
527 #: build/C/man2/futex.2:203
529 msgid "B<FUTEX_CMP_REQUEUE>"
533 #: build/C/man2/futex.2:210
535 "In the event of an error, all operations return -1, and set I<errno> to "
536 "indicate the error."
540 #: build/C/man2/futex.2:211 build/C/man2/quotactl.2:484
546 #: build/C/man2/futex.2:214
547 msgid "No read access to futex memory."
551 #: build/C/man2/futex.2:214 build/C/man2/sendfile.2:112
557 #: build/C/man2/futex.2:222
559 "B<FUTEX_CMP_REQUEUE> found an unexpected futex value. (This probably "
560 "indicates a race; use the safe B<FUTEX_WAKE> now.)"
564 #: build/C/man2/futex.2:227
565 msgid "Error in getting I<timeout> information from userspace."
569 #: build/C/man2/futex.2:230
570 msgid "An operation was not defined or error in page alignment."
574 #: build/C/man2/futex.2:230
580 #: build/C/man2/futex.2:233
581 msgid "The system limit on the total number of open files has been reached."
585 #: build/C/man2/futex.2:233 build/C/man2/modify_ldt.2:124 build/C/man2/pciconfig_read.2:90 build/C/man2/quotactl.2:445 build/C/man2/vm86.2:62
591 #: build/C/man2/futex.2:237
592 msgid "Invalid operation specified in I<op>."
596 #: build/C/man2/futex.2:237 build/C/man2/kexec_load.2:134 build/C/man2/lookup_dcookie.2:73 build/C/man2/pivot_root.2:119 build/C/man2/sendfile.2:138 build/C/man2/set_tid_address.2:86 build/C/man2/splice.2:165 build/C/man2/tee.2:114 build/C/man2/vmsplice.2:138
602 #: build/C/man2/futex.2:247
604 "Initial futex support was merged in Linux 2.5.7 but with different semantics "
605 "from what was described above. A 4-argument system call with the semantics "
606 "described in this page was introduced in Linux 2.5.40. In Linux 2.5.70 one "
607 "argument was added. In Linux 2.6.7 a sixth argument was added\\(emmessy, "
608 "especially on the s390 architecture."
612 #: build/C/man2/futex.2:249 build/C/man2/kexec_load.2:140 build/C/man2/set_tid_address.2:91 build/C/man2/splice.2:171 build/C/man2/tee.2:120 build/C/man2/vmsplice.2:144
613 msgid "This system call is Linux-specific."
618 #. Futexes were designed and worked on by
619 #. Hubertus Franke (IBM Thomas J. Watson Research Center),
620 #. Matthew Kirkwood, Ingo Molnar (Red Hat)
621 #. and Rusty Russell (IBM Linux Technology Center).
622 #. This page written by bert hubert.
624 #: build/C/man2/futex.2:263
626 "To reiterate, bare futexes are not intended as an easy-to-use abstraction "
627 "for end-users. (There is no wrapper function for this system call in "
628 "glibc.) Implementors are expected to be assembly literate and to have read "
629 "the sources of the futex userspace library referenced below."
633 #: build/C/man2/futex.2:265
638 #: build/C/man2/futex.2:268
640 "I<Fuss, Futexes and Furwocks: Fast Userlevel Locking in Linux> (proceedings "
641 "of the Ottawa Linux Symposium 2002), online at"
645 #: build/C/man2/futex.2:270
646 msgid "http://kernel.org/doc/ols/2002/ols2002-pages-479-495.pdf"
650 #: build/C/man2/futex.2:272
651 msgid "Futex example library, futex-*.tar.bz2 at"
655 #: build/C/man2/futex.2:274
656 msgid "ftp://ftp.nl.kernel.org/pub/linux/kernel/people/rusty/."
660 #: build/C/man2/kexec_load.2:25
666 #: build/C/man2/kexec_load.2:25
672 #: build/C/man2/kexec_load.2:28
673 msgid "kexec_load - load a new kernel for later execution"
677 #: build/C/man2/kexec_load.2:30
678 msgid "B<#include E<lt>linux/kexec.hE<gt>>"
682 #: build/C/man2/kexec_load.2:32
684 "B<long kexec_load(unsigned long >I<entry>B<, unsigned long "
685 ">I<nr_segments>B<,>"
689 #: build/C/man2/kexec_load.2:35
690 msgid "B< struct kexec_segment *>I<segments>B<, unsigned long >I<flags>B<);>"
694 #: build/C/man2/kexec_load.2:40
696 "The B<kexec_load>() system call loads a new kernel that can be executed "
697 "later by B<reboot>(2)."
701 #: build/C/man2/kexec_load.2:46
703 "The I<flags> argument is a mask whose high-order bits control the operation "
704 "of the call. The following values can be specified in I<flags>:"
708 #: build/C/man2/kexec_load.2:46
710 msgid "B<KEXEC_ON_CRASH> (since Linux 2.6.13)"
713 #. FIXME figure out how this is really used
715 #: build/C/man2/kexec_load.2:50
716 msgid "Execute the new kernel automatically on a system crash."
720 #: build/C/man2/kexec_load.2:50
722 msgid "B<KEXEC_PRESERVE_CONTEXT> (since Linux 2.7.27)"
726 #: build/C/man2/kexec_load.2:60
728 "Preserve the system hardware and software states before executing the new "
729 "kernel. This could be used for system suspend. This flag is only available "
730 "if the kernel was configured with B<CONFIG_KEXEC_JUMP>, and is only "
731 "effective if I<nr_segments> is greater than 0."
735 #: build/C/man2/kexec_load.2:80
737 "The low-order bits of I<flags> contain the architecture of the "
738 "to-be-executed kernel. Specify (OR) the constant B<KEXEC_ARCH_DEFAULT> to "
739 "use the current architecture, or one of the following architecture constants "
740 "B<KEXEC_ARCH_386>, B<KEXEC_ARCH_X86_64>, B<KEXEC_ARCH_PPC>, "
741 "B<KEXEC_ARCH_PPC64>, B<KEXEC_ARCH_IA_64>, B<KEXEC_ARCH_ARM>, "
742 "B<KEXEC_ARCH_S390>, B<KEXEC_ARCH_SH>, B<KEXEC_ARCH_MIPS>, and "
743 "B<KEXEC_ARCH_MIPS_LE>. The architecture must be executable on the CPU of "
748 #: build/C/man2/kexec_load.2:94
750 "The I<entry> argument is the physical entry address in the kernel image. "
751 "The I<nr_segments> argument is the number of segments pointed to by the "
752 "I<segments> pointer. The I<segments> argument is an array of "
753 "I<kexec_segment> structures which define the kernel layout:"
757 #: build/C/man2/kexec_load.2:103
760 "struct kexec_segment {\n"
761 " void *buf; /* Buffer in user space */\n"
762 " size_t bufsz; /* Buffer length in user space */\n"
763 " void *mem; /* Physical address of kernel */\n"
764 " size_t memsz; /* Physical address length */\n"
768 #. FIXME elaborate on the following:
770 #: build/C/man2/kexec_load.2:110
772 "The kernel image defined by I<segments> is copied from the calling process "
773 "into previously reserved memory."
777 #: build/C/man2/kexec_load.2:117
779 "On success, B<kexec_load>() returns 0. On error, -1 is returned and "
780 "I<errno> is set to indicate the error."
784 #: build/C/man2/kexec_load.2:118 build/C/man2/pivot_root.2:104 build/C/man2/ptrace.2:413 build/C/man2/quotactl.2:493
790 #: build/C/man2/kexec_load.2:122
792 "Another crash kernel is already being loaded or a crash kernel is already in "
796 #. KEXEC_SEGMENT_MAX == 16
798 #: build/C/man2/kexec_load.2:129
799 msgid "I<flags> is invalid; or I<nr_segments> is too large"
803 #: build/C/man2/kexec_load.2:134
804 msgid "The caller does not have the B<CAP_SYS_BOOT> capability."
808 #: build/C/man2/kexec_load.2:138
809 msgid "The B<kexec_load>() system call first appeared in Linux 2.6.13."
813 #: build/C/man2/kexec_load.2:145
815 "Currently, there is no glibc support for B<kexec_load>(). Call it using "
819 #. FIXME Andi submitted a patch for this.
820 #. Check if it got accepted later.
822 #: build/C/man2/kexec_load.2:152
824 "The required constants are in the kernel source file I<linux/kexec.h>, which "
825 "is not currently exported to glibc. Therefore, these constants must be "
830 #: build/C/man2/kexec_load.2:155
832 "This system call is only available if the kernel was configured with "
837 #: build/C/man2/kexec_load.2:158
838 msgid "B<reboot>(2), B<syscall>(2)"
842 #: build/C/man2/lookup_dcookie.2:27
844 msgid "LOOKUP_DCOOKIE"
848 #: build/C/man2/lookup_dcookie.2:27
854 #: build/C/man2/lookup_dcookie.2:30
855 msgid "lookup_dcookie - return a directory entry's path"
859 #: build/C/man2/lookup_dcookie.2:32
861 "B<int lookup_dcookie(u64 >I<cookie>B<, char *>I<buffer>B<, size_t "
866 #: build/C/man2/lookup_dcookie.2:38
868 "Look up the full path of the directory entry specified by the value "
869 "I<cookie>. The cookie is an opaque identifier uniquely identifying a "
870 "particular directory entry. The buffer given is filled in with the full "
871 "path of the directory entry."
875 #: build/C/man2/lookup_dcookie.2:43
877 "For B<lookup_dcookie>() to return successfully, the kernel must still hold "
878 "a cookie reference to the directory entry."
882 #: build/C/man2/lookup_dcookie.2:50
884 "On success, B<lookup_dcookie>() returns the length of the path string "
885 "copied into the buffer. On error, -1 is returned, and I<errno> is set "
890 #: build/C/man2/lookup_dcookie.2:54
891 msgid "The buffer was not valid."
895 #: build/C/man2/lookup_dcookie.2:58
897 "The kernel has no registered cookie/directory entry mappings at the time of "
898 "lookup, or the cookie does not refer to a valid directory entry."
902 #: build/C/man2/lookup_dcookie.2:58
904 msgid "B<ENAMETOOLONG>"
908 #: build/C/man2/lookup_dcookie.2:61
909 msgid "The name could not fit in the buffer."
913 #: build/C/man2/lookup_dcookie.2:61 build/C/man2/sendfile.2:134 build/C/man2/splice.2:155 build/C/man2/tee.2:111 build/C/man2/vmsplice.2:135
919 #: build/C/man2/lookup_dcookie.2:65
921 "The kernel could not allocate memory for the temporary buffer holding the "
926 #: build/C/man2/lookup_dcookie.2:70
928 "The process does not have the capability B<CAP_SYS_ADMIN> required to look "
933 #: build/C/man2/lookup_dcookie.2:70 build/C/man2/quotactl.2:472
939 #: build/C/man2/lookup_dcookie.2:73
940 msgid "The buffer was not large enough to hold the path of the directory entry."
944 #: build/C/man2/lookup_dcookie.2:78
946 "Available since Linux 2.5.43. The B<ENAMETOOLONG> error return was added in "
951 #: build/C/man2/lookup_dcookie.2:81
952 msgid "B<lookup_dcookie>() is Linux-specific."
956 #: build/C/man2/lookup_dcookie.2:85
958 "B<lookup_dcookie>() is a special-purpose system call, currently used only "
959 "by the oprofile profiler. It relies on a kernel driver to register cookies "
960 "for directory entries."
964 #: build/C/man2/lookup_dcookie.2:88
966 "The path returned may be suffixed by the string \" (deleted)\" if the "
967 "directory entry has been removed."
971 #: build/C/man2/modify_ldt.2:25
977 #: build/C/man2/modify_ldt.2:25 build/C/man2/pivot_root.2:7
983 #: build/C/man2/modify_ldt.2:28
984 msgid "modify_ldt - get or set ldt"
988 #: build/C/man2/modify_ldt.2:31
990 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
994 #: build/C/man2/modify_ldt.2:33
997 "B<int modify_ldt(int >I<func>B<, void *>I<ptr>B<, unsigned long "
998 ">I<bytecount>B<);>\n"
1002 #: build/C/man2/modify_ldt.2:39
1004 "B<modify_ldt>() reads or writes the local descriptor table (ldt) for a "
1005 "process. The ldt is a per-process memory management table used by the i386 "
1006 "processor. For more information on this table, see an Intel 386 processor "
1011 #: build/C/man2/modify_ldt.2:49
1013 "When I<func> is 0, B<modify_ldt>() reads the ldt into the memory pointed to "
1014 "by I<ptr>. The number of bytes read is the smaller of I<bytecount> and the "
1015 "actual size of the ldt."
1019 #. FIXME ? say something about func == 2 and func == 0x11?
1020 #. In Linux 2.4, func == 2 returned "the default ldt"
1021 #. In Linux 2.6, func == 2 is a nop, returning a zeroed out structure.
1022 #. Linux 2.4 and 2.6 implement an operation for func == 0x11
1024 #: build/C/man2/modify_ldt.2:67
1026 "When I<func> is 1, B<modify_ldt>() modifies one ldt entry. I<ptr> points "
1027 "to a I<user_desc> structure and I<bytecount> must equal the size of this "
1032 #: build/C/man2/modify_ldt.2:71
1033 msgid "The I<user_desc> structure is defined in I<E<lt>asm/ldt.hE<gt>> as:"
1037 #: build/C/man2/modify_ldt.2:85
1040 "struct user_desc {\n"
1041 " unsigned int entry_number;\n"
1042 " unsigned long base_addr;\n"
1043 " unsigned int limit;\n"
1044 " unsigned int seg_32bit:1;\n"
1045 " unsigned int contents:2;\n"
1046 " unsigned int read_exec_only:1;\n"
1047 " unsigned int limit_in_pages:1;\n"
1048 " unsigned int seg_not_present:1;\n"
1049 " unsigned int useable:1;\n"
1054 #. The ldt is specific for the calling process. Any attempts to change
1055 #. the ldt to include the address space of another process or the kernel
1056 #. will result in a segmentation violation when trying to access the memory
1057 #. outside of the process address space. The memory protection is enforced
1058 #. at the paging layer.
1060 #: build/C/man2/modify_ldt.2:96
1061 msgid "In Linux 2.4 and earlier, this structure was named I<modify_ldt_ldt_s>."
1065 #: build/C/man2/modify_ldt.2:106
1067 "On success, B<modify_ldt>() returns either the actual number of bytes read "
1068 "(for reading) or 0 (for writing). On failure, B<modify_ldt>() returns -1 "
1069 "and sets I<errno> to indicate the error."
1073 #: build/C/man2/modify_ldt.2:111
1074 msgid "I<ptr> points outside the address space."
1078 #: build/C/man2/modify_ldt.2:124
1080 "I<ptr> is 0, or I<func> is 1 and I<bytecount> is not equal to the size of "
1081 "the structure I<modify_ldt_ldt_s>, or I<func> is 1 and the new ldt entry has "
1086 #: build/C/man2/modify_ldt.2:128
1087 msgid "I<func> is neither 0 nor 1."
1091 #: build/C/man2/modify_ldt.2:131
1093 "This call is Linux-specific and should not be used in programs intended to "
1098 #: build/C/man2/modify_ldt.2:134 build/C/man2/pivot_root.2:128
1100 "Glibc does not provide a wrapper for this system call; call it using "
1105 #: build/C/man2/modify_ldt.2:136
1110 #: build/C/man2/nfsservctl.2:8
1116 #: build/C/man2/nfsservctl.2:8
1122 #: build/C/man2/nfsservctl.2:11
1123 msgid "nfsservctl - syscall interface to kernel nfs daemon"
1127 #: build/C/man2/nfsservctl.2:14
1129 msgid "B<#include E<lt>linux/nfsd/syscall.hE<gt>>\n"
1133 #: build/C/man2/nfsservctl.2:17
1136 "B<long nfsservctl(int >I<cmd>B<, struct nfsctl_arg *>I<argp>B<,>\n"
1137 "B< union nfsctl_res *>I<resp>B<);>\n"
1141 #: build/C/man2/nfsservctl.2:30
1145 " * These are the commands understood by nfsctl().\n"
1147 "#define NFSCTL_SVC 0 /* This is a server process. */\n"
1148 "#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */\n"
1149 "#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */\n"
1150 "#define NFSCTL_EXPORT 3 /* export a file system. */\n"
1151 "#define NFSCTL_UNEXPORT 4 /* unexport a file system. */\n"
1152 "#define NFSCTL_UGIDUPDATE 5 /* update a client's UID/GID map. */\n"
1153 "#define NFSCTL_GETFH 6 /* get an fh (used by mountd) */\n"
1157 #: build/C/man2/nfsservctl.2:42
1160 "struct nfsctl_arg {\n"
1161 " int ca_version; /* safeguard */\n"
1163 " struct nfsctl_svc u_svc;\n"
1164 " struct nfsctl_client u_client;\n"
1165 " struct nfsctl_export u_export;\n"
1166 " struct nfsctl_uidmap u_umap;\n"
1167 " struct nfsctl_fhparm u_getfh;\n"
1168 " unsigned int u_debug;\n"
1174 #: build/C/man2/nfsservctl.2:47
1177 "union nfsctl_res {\n"
1178 " struct knfs_fh cr_getfh;\n"
1179 " unsigned int cr_debug;\n"
1184 #: build/C/man2/nfsservctl.2:53 build/C/man2/pivot_root.2:99 build/C/man2/vm86.2:57
1186 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
1191 #: build/C/man2/nfsservctl.2:55
1192 msgid "This call is Linux-specific."
1196 #: build/C/man2/outb.2:28
1202 #: build/C/man2/outb.2:28
1208 #: build/C/man2/outb.2:33
1210 "outb, outw, outl, outsb, outsw, outsl, inb, inw, inl, insb, insw, insl, "
1211 "outb_p, outw_p, outl_p, inb_p, inw_p, inl_p - port I/O"
1215 #: build/C/man2/outb.2:38
1217 "This family of functions is used to do low-level port input and output. The "
1218 "out* functions do port output, the in* functions do port input; the b-suffix "
1219 "functions are byte-width and the w-suffix functions word-width; the "
1220 "_p-suffix functions pause until the I/O completes."
1223 #. , given the following information
1224 #. in addition to that given in
1227 #: build/C/man2/outb.2:44
1229 "They are primarily designed for internal kernel use, but can be used from "
1234 #: build/C/man2/outb.2:49
1236 "You compile with B<-O> or B<-O2> or similar. The functions are defined as "
1237 "inline macros, and will not be substituted in without optimization enabled, "
1238 "causing unresolved references at link time."
1242 #: build/C/man2/outb.2:58
1244 "You use B<ioperm>(2) or alternatively B<iopl>(2) to tell the kernel to "
1245 "allow the user space application to access the I/O ports in question. "
1246 "Failure to do this will cause the application to receive a segmentation "
1251 #: build/C/man2/outb.2:67
1253 "B<outb>() and friends are hardware-specific. The I<value> argument is "
1254 "passed first and the I<port> argument is passed second, which is the "
1255 "opposite order from most DOS implementations."
1259 #: build/C/man2/outb.2:70
1260 msgid "B<ioperm>(2), B<iopl>(2)"
1264 #: build/C/man2/pciconfig_read.2:5
1266 msgid "PCICONFIG_READ"
1270 #: build/C/man2/pciconfig_read.2:5
1276 #: build/C/man2/pciconfig_read.2:8
1278 "pciconfig_read, pciconfig_write, pciconfig_iobase - pci device information "
1283 #: build/C/man2/pciconfig_read.2:11
1285 msgid "B<#include E<lt>pci.hE<gt>>\n"
1289 #: build/C/man2/pciconfig_read.2:18
1292 "B<int pciconfig_read(unsigned long >I<bus>B<, unsigned long >I<dfn>B<,>\n"
1293 "B< unsigned long >I<off>B<, unsigned long >I<len>B<, void "
1295 "B<int pciconfig_write(unsigned long >I<bus>B<, unsigned long >I<dfn>B<,>\n"
1296 "B< unsigned long >I<off>B<, unsigned long >I<len>B<, void "
1298 "B<int pciconfig_iobase(long >I<which>B<, unsigned long >I<bus>B<,>\n"
1299 "B< unsigned long >I<devfn>B<);>\n"
1303 #: build/C/man2/pciconfig_read.2:24
1305 "Most of the interaction with PCI devices is already handled by the kernel "
1306 "PCI layer, and thus these calls should not normally need to be accessed from "
1311 #: build/C/man2/pciconfig_read.2:24 build/C/man2/pciconfig_read.2:48
1313 msgid "B<pciconfig_read>()"
1317 #: build/C/man2/pciconfig_read.2:33
1318 msgid "Reads to I<buf> from device I<dev> at offset I<off> value."
1322 #: build/C/man2/pciconfig_read.2:33 build/C/man2/pciconfig_read.2:54
1324 msgid "B<pciconfig_write>()"
1328 #: build/C/man2/pciconfig_read.2:42
1329 msgid "Writes from I<buf> to device I<dev> at offset I<off> value."
1333 #: build/C/man2/pciconfig_read.2:42 build/C/man2/pciconfig_read.2:60
1335 msgid "B<pciconfig_iobase>()"
1339 #: build/C/man2/pciconfig_read.2:47
1341 "You pass it a bus/devfn pair and get a physical address for either the "
1342 "memory offset (for things like prep, this is 0xc0000000), the IO base for "
1343 "PIO cycles, or the ISA holes if any."
1347 #: build/C/man2/pciconfig_read.2:54 build/C/man2/pciconfig_read.2:60
1349 "On success zero is returned. On error, -1 is returned and I<errno> is set "
1354 #: build/C/man2/pciconfig_read.2:74
1356 "Returns information on locations of various I/O regions in physical memory "
1357 "according to the I<which> value. Values for I<which> are: "
1358 "B<IOBASE_BRIDGE_NUMBER>, B<IOBASE_MEMORY>, B<IOBASE_IO>, B<IOBASE_ISA_IO>, "
1359 "B<IOBASE_ISA_MEM>."
1363 #: build/C/man2/pciconfig_read.2:81
1364 msgid "I<len> value is invalid. This does not apply to B<pciconfig_iobase>()."
1368 #: build/C/man2/pciconfig_read.2:81 build/C/man2/ptrace.2:431 build/C/man2/sendfile.2:130
1374 #: build/C/man2/pciconfig_read.2:84
1379 #: build/C/man2/pciconfig_read.2:84
1385 #: build/C/man2/pciconfig_read.2:90
1387 "For B<pciconfig_iobase>(), \"hose\" value is NULL. For the other calls, "
1388 "could not find a slot."
1392 #: build/C/man2/pciconfig_read.2:95
1393 msgid "The system has not implemented these calls (B<CONFIG_PCI> not defined)."
1397 #: build/C/man2/pciconfig_read.2:95
1399 msgid "B<EOPNOTSUPP>"
1403 #: build/C/man2/pciconfig_read.2:102
1405 "This return value is only valid for B<pciconfig_iobase>(). It is returned "
1406 "if the value for I<which> is invalid."
1410 #: build/C/man2/pciconfig_read.2:107
1412 "User does not have the B<CAP_SYS_ADMIN> capability. This does not apply to "
1413 "B<pciconfig_iobase>()."
1417 #: build/C/man2/pciconfig_read.2:109
1418 msgid "These calls are Linux-specific, available since Linux 2.0.26/2.1.11."
1422 #: build/C/man2/pciconfig_read.2:111
1423 msgid "B<capabilities>(7)"
1427 #: build/C/man2/personality.2:30
1433 #: build/C/man2/personality.2:30
1439 #: build/C/man2/personality.2:33
1440 msgid "personality - set the process execution domain"
1444 #: build/C/man2/personality.2:35
1445 msgid "B<#include E<lt>sys/personality.hE<gt>>"
1449 #: build/C/man2/personality.2:37
1450 msgid "B<int personality(unsigned long >I<persona>B<);>"
1454 #: build/C/man2/personality.2:45
1456 "Linux supports different execution domains, or personalities, for each "
1457 "process. Among other things, execution domains tell Linux how to map signal "
1458 "numbers into signal actions. The execution domain system allows Linux to "
1459 "provide limited support for binaries compiled under other UNIX-like "
1460 "operating systems."
1464 #: build/C/man2/personality.2:55
1466 "This function will return the current B<personality>() when I<persona> "
1467 "equals 0xffffffff. Otherwise, it will make the execution domain referenced "
1468 "by I<persona> the new execution domain of the calling process."
1472 #: build/C/man2/personality.2:62
1474 "On success, the previous I<persona> is returned. On error, -1 is returned, "
1475 "and I<errno> is set appropriately."
1479 #: build/C/man2/personality.2:66
1480 msgid "The kernel was unable to change the personality."
1484 #: build/C/man2/personality.2:70
1486 "B<personality>() is Linux-specific and should not be used in programs "
1487 "intended to be portable."
1491 #: build/C/man2/pivot_root.2:7
1497 #: build/C/man2/pivot_root.2:10
1498 msgid "pivot_root - change the root file system"
1502 #: build/C/man2/pivot_root.2:12
1503 msgid "B<int pivot_root(const char *>I<new_root>B<, const char *>I<put_old>B<);>"
1509 #. capability is required.
1511 #: build/C/man2/pivot_root.2:21
1513 "B<pivot_root>() moves the root file system of the calling process to the "
1514 "directory I<put_old> and makes I<new_root> the new root file system of the "
1519 #: build/C/man2/pivot_root.2:28
1521 "The typical use of B<pivot_root>() is during system startup, when the "
1522 "system mounts a temporary root file system (e.g., an B<initrd>), then mounts "
1523 "the real root file system, and eventually turns the latter into the current "
1524 "root of all relevant processes or threads."
1528 #: build/C/man2/pivot_root.2:40
1530 "B<pivot_root>() may or may not change the current root and the current "
1531 "working directory of any processes or threads which use the old root "
1532 "directory. The caller of B<pivot_root>() must ensure that processes with "
1533 "root or current working directory at the old root operate correctly in "
1534 "either case. An easy way to ensure this is to change their root and current "
1535 "working directory to I<new_root> before invoking B<pivot_root>()."
1539 #: build/C/man2/pivot_root.2:58
1541 "The paragraph above is intentionally vague because the implementation of "
1542 "B<pivot_root>() may change in the future. At the time of writing, "
1543 "B<pivot_root>() changes root and current working directory of each process "
1544 "or thread to I<new_root> if they point to the old root directory. This is "
1545 "necessary in order to prevent kernel threads from keeping the old root "
1546 "directory busy with their root and current working directory, even if they "
1547 "never access the file system in any way. In the future, there may be a "
1548 "mechanism for kernel threads to explicitly relinquish any access to the file "
1549 "system, such that this fairly intrusive mechanism can be removed from "
1554 #: build/C/man2/pivot_root.2:66
1556 "Note that this also applies to the calling process: B<pivot_root>() may or "
1557 "may not affect its current working directory. It is therefore recommended "
1558 "to call B<chdir(\"/\")> immediately after B<pivot_root>()."
1562 #: build/C/man2/pivot_root.2:68
1563 msgid "The following restrictions apply to I<new_root> and I<put_old>:"
1567 #: build/C/man2/pivot_root.2:68 build/C/man2/pivot_root.2:70 build/C/man2/pivot_root.2:73 build/C/man2/pivot_root.2:77
1573 #: build/C/man2/pivot_root.2:70
1574 msgid "They must be directories."
1578 #: build/C/man2/pivot_root.2:73
1580 "I<new_root> and I<put_old> must not be on the same file system as the "
1585 #: build/C/man2/pivot_root.2:77
1587 "I<put_old> must be underneath I<new_root>, that is, adding a nonzero number "
1588 "of I</..> to the string pointed to by I<put_old> must yield the same "
1589 "directory as I<new_root>."
1593 #: build/C/man2/pivot_root.2:79
1594 msgid "No other file system may be mounted on I<put_old>."
1598 #: build/C/man2/pivot_root.2:83
1599 msgid "See also B<pivot_root>(8) for additional usage examples."
1603 #: build/C/man2/pivot_root.2:90
1605 "If the current root is not a mount point (e.g., after B<chroot>(2) or "
1606 "B<pivot_root>(), see also below), not the old root directory, but the mount "
1607 "point of that file system is mounted on I<put_old>."
1611 #: build/C/man2/pivot_root.2:95
1613 "I<new_root> does not have to be a mount point. In this case, "
1614 "I</proc/mounts> will show the mount point of the file system containing "
1615 "I<new_root> as root (I</>)."
1619 #: build/C/man2/pivot_root.2:104
1621 "B<pivot_root>() may return (in I<errno>) any of the errors returned by "
1622 "B<stat>(2). Additionally, it may return:"
1626 #: build/C/man2/pivot_root.2:108
1628 "I<new_root> or I<put_old> are on the current root file system, or a file "
1629 "system is already mounted on I<put_old>."
1633 #: build/C/man2/pivot_root.2:111
1634 msgid "I<put_old> is not underneath I<new_root>."
1638 #: build/C/man2/pivot_root.2:111
1644 #: build/C/man2/pivot_root.2:114
1645 msgid "I<new_root> or I<put_old> is not a directory."
1649 #: build/C/man2/pivot_root.2:119
1650 msgid "The calling process does not have the B<CAP_SYS_ADMIN> capability."
1654 #: build/C/man2/pivot_root.2:122
1655 msgid "B<pivot_root>() was introduced in Linux 2.3.41."
1659 #: build/C/man2/pivot_root.2:125
1660 msgid "B<pivot_root>() is Linux-specific and hence is not portable."
1664 #: build/C/man2/pivot_root.2:128 build/C/man2/ptrace.2:518
1670 #: build/C/man2/pivot_root.2:132
1672 "B<pivot_root>() should not have to change root and current working "
1673 "directory of all other processes in the system."
1677 #: build/C/man2/pivot_root.2:137
1679 "Some of the more obscure uses of B<pivot_root>() may quickly lead to "
1684 #: build/C/man2/pivot_root.2:143
1685 msgid "B<chdir>(2), B<chroot>(2), B<stat>(2), B<initrd>(4), B<pivot_root>(8)"
1689 #: build/C/man2/ptrace.2:45
1695 #: build/C/man2/ptrace.2:45
1701 #: build/C/man2/ptrace.2:48
1702 msgid "ptrace - process trace"
1706 #: build/C/man2/ptrace.2:51
1708 msgid "B<#include E<lt>sys/ptrace.hE<gt>>\n"
1712 #: build/C/man2/ptrace.2:54
1715 "B<long ptrace(enum __ptrace_request >I<request>B<, pid_t >I<pid>B<, >\n"
1716 "B< void *>I<addr>B<, void *>I<data>B<);>\n"
1720 #: build/C/man2/ptrace.2:63
1722 "The B<ptrace>() system call provides a means by which a parent process may "
1723 "observe and control the execution of another process, and examine and change "
1724 "its core image and registers. It is primarily used to implement breakpoint "
1725 "debugging and system call tracing."
1729 #: build/C/man2/ptrace.2:72
1731 "The parent can initiate a trace by calling B<fork>(2) and having the "
1732 "resulting child do a B<PTRACE_TRACEME>, followed (typically) by an "
1733 "B<exec>(3). Alternatively, the parent may commence trace of an existing "
1734 "process using B<PTRACE_ATTACH>."
1738 #: build/C/man2/ptrace.2:84
1740 "While being traced, the child will stop each time a signal is delivered, "
1741 "even if the signal is being ignored. (The exception is B<SIGKILL>, which "
1742 "has its usual effect.) The parent will be notified at its next B<wait>(2) "
1743 "and may inspect and modify the child process while it is stopped. The "
1744 "parent then causes the child to continue, optionally ignoring the delivered "
1745 "signal (or even delivering a different signal instead)."
1749 #: build/C/man2/ptrace.2:90
1751 "When the parent is finished tracing, it can terminate the child with "
1752 "B<PTRACE_KILL> or cause it to continue executing in a normal, untraced mode "
1753 "via B<PTRACE_DETACH>."
1757 #: build/C/man2/ptrace.2:92
1758 msgid "The value of I<request> determines the action to be performed:"
1762 #: build/C/man2/ptrace.2:92
1764 msgid "B<PTRACE_TRACEME>"
1768 #: build/C/man2/ptrace.2:111
1770 "Indicates that this process is to be traced by its parent. Any signal "
1771 "(except B<SIGKILL>) delivered to this process will cause it to stop and its "
1772 "parent to be notified via B<wait>(2). Also, all subsequent calls to "
1773 "B<execve>(2) by this process will cause a B<SIGTRAP> to be sent to it, "
1774 "giving the parent a chance to gain control before the new program begins "
1775 "execution. A process probably shouldn't make this request if its parent "
1776 "isn't expecting to trace it. (I<pid>, I<addr>, and I<data> are ignored.)"
1780 #: build/C/man2/ptrace.2:120
1782 "The above request is used only by the child process; the rest are used only "
1783 "by the parent. In the following requests, I<pid> specifies the child "
1784 "process to be acted on. For requests other than B<PTRACE_KILL>, the child "
1785 "process must be stopped."
1789 #: build/C/man2/ptrace.2:120
1791 msgid "B<PTRACE_PEEKTEXT>, B<PTRACE_PEEKDATA>"
1795 #: build/C/man2/ptrace.2:130
1797 "Reads a word at the location I<addr> in the child's memory, returning the "
1798 "word as the result of the B<ptrace>() call. Linux does not have separate "
1799 "text and data address spaces, so the two requests are currently equivalent. "
1800 "(The argument I<data> is ignored.)"
1804 #: build/C/man2/ptrace.2:130
1806 msgid "B<PTRACE_PEEKUSER>"
1809 #. PTRACE_PEEKUSR in kernel source, but glibc uses PTRACE_PEEKUSER,
1810 #. and that is the name that seems common on other systems.
1812 #: build/C/man2/ptrace.2:146
1814 "Reads a word at offset I<addr> in the child's USER area, which holds the "
1815 "registers and other information about the process (see "
1816 "I<E<lt>sys/user.hE<gt>>). The word is returned as the result of the "
1817 "B<ptrace>() call. Typically the offset must be word-aligned, though this "
1818 "might vary by architecture. See NOTES. (I<data> is ignored.)"
1822 #: build/C/man2/ptrace.2:146
1824 msgid "B<PTRACE_POKETEXT>, B<PTRACE_POKEDATA>"
1828 #: build/C/man2/ptrace.2:154
1830 "Copies the word I<data> to location I<addr> in the child's memory. As "
1831 "above, the two requests are currently equivalent."
1835 #: build/C/man2/ptrace.2:154
1837 msgid "B<PTRACE_POKEUSER>"
1840 #. PTRACE_POKEUSR in kernel source, but glibc uses PTRACE_POKEUSER,
1841 #. and that is the name that seems common on other systems.
1843 #: build/C/man2/ptrace.2:166
1845 "Copies the word I<data> to offset I<addr> in the child's USER area. As "
1846 "above, the offset must typically be word-aligned. In order to maintain the "
1847 "integrity of the kernel, some modifications to the USER area are disallowed."
1851 #: build/C/man2/ptrace.2:166
1853 msgid "B<PTRACE_GETREGS>, B<PTRACE_GETFPREGS>"
1857 #: build/C/man2/ptrace.2:173
1859 "Copies the child's general purpose or floating-point registers, "
1860 "respectively, to location I<data> in the parent. See "
1861 "I<E<lt>sys/user.hE<gt>> for information on the format of this data. "
1862 "(I<addr> is ignored.)"
1866 #: build/C/man2/ptrace.2:173
1868 msgid "B<PTRACE_GETSIGINFO> (since Linux 2.3.99-pre6)"
1872 #: build/C/man2/ptrace.2:180
1874 "Retrieve information about the signal that caused the stop. Copies a "
1875 "I<siginfo_t> structure (see B<sigaction>(2)) from the child to location "
1876 "I<data> in the parent. (I<addr> is ignored.)"
1880 #: build/C/man2/ptrace.2:180
1882 msgid "B<PTRACE_SETREGS>, B<PTRACE_SETFPREGS>"
1886 #: build/C/man2/ptrace.2:189
1888 "Copies the child's general purpose or floating-point registers, "
1889 "respectively, from location I<data> in the parent. As for "
1890 "B<PTRACE_POKEUSER>, some general purpose register modifications may be "
1891 "disallowed. (I<addr> is ignored.)"
1895 #: build/C/man2/ptrace.2:189
1897 msgid "B<PTRACE_SETSIGINFO> (since Linux 2.3.99-pre6)"
1901 #: build/C/man2/ptrace.2:201
1903 "Set signal information. Copies a I<siginfo_t> structure from location "
1904 "I<data> in the parent to the child. This will only affect signals that "
1905 "would normally be delivered to the child and were caught by the tracer. It "
1906 "may be difficult to tell these normal signals from synthetic signals "
1907 "generated by B<ptrace>() itself. (I<addr> is ignored.)"
1911 #: build/C/man2/ptrace.2:201
1913 msgid "B<PTRACE_SETOPTIONS> (since Linux 2.4.6; see BUGS for caveats)"
1917 #: build/C/man2/ptrace.2:207
1919 "Sets ptrace options from I<data> in the parent. (I<addr> is ignored.) "
1920 "I<data> is interpreted as a bit mask of options, which are specified by the "
1925 #: build/C/man2/ptrace.2:208
1927 msgid "B<PTRACE_O_TRACESYSGOOD> (since Linux 2.4.6)"
1931 #: build/C/man2/ptrace.2:216
1933 "When delivering syscall traps, set bit 7 in the signal number (i.e., deliver "
1934 "I<SIGTRAP | 0x80>). This makes it easy for the tracer to tell the "
1935 "difference between normal traps and those caused by a syscall. "
1936 "(B<PTRACE_O_TRACESYSGOOD> may not work on all architectures.)"
1940 #: build/C/man2/ptrace.2:216
1942 msgid "B<PTRACE_O_TRACEFORK> (since Linux 2.5.46)"
1946 #: build/C/man2/ptrace.2:226
1948 "Stop the child at the next B<fork>(2) call with I<SIGTRAP | "
1949 "PTRACE_EVENT_FORK\\ E<lt>E<lt>\\ 8> and automatically start tracing the "
1950 "newly forked process, which will start with a B<SIGSTOP>. The PID for the "
1951 "new process can be retrieved with B<PTRACE_GETEVENTMSG>."
1955 #: build/C/man2/ptrace.2:226
1957 msgid "B<PTRACE_O_TRACEVFORK> (since Linux 2.5.46)"
1961 #: build/C/man2/ptrace.2:235
1963 "Stop the child at the next B<vfork>(2) call with I<SIGTRAP | "
1964 "PTRACE_EVENT_VFORK\\ E<lt>E<lt>\\ 8> and automatically start tracing the "
1965 "newly vforked process, which will start with a B<SIGSTOP>. The PID for the "
1966 "new process can be retrieved with B<PTRACE_GETEVENTMSG>."
1970 #: build/C/man2/ptrace.2:235
1972 msgid "B<PTRACE_O_TRACECLONE> (since Linux 2.5.46)"
1976 #: build/C/man2/ptrace.2:265
1978 "Stop the child at the next B<clone>(2) call with I<SIGTRAP | "
1979 "PTRACE_EVENT_CLONE\\ E<lt>E<lt>\\ 8> and automatically start tracing the "
1980 "newly cloned process, which will start with a B<SIGSTOP>. The PID for the "
1981 "new process can be retrieved with B<PTRACE_GETEVENTMSG>. This option may "
1982 "not catch B<clone>(2) calls in all cases. If the child calls B<clone>(2) "
1983 "with the B<CLONE_VFORK> flag, B<PTRACE_EVENT_VFORK> will be delivered "
1984 "instead if B<PTRACE_O_TRACEVFORK> is set; otherwise if the child calls "
1985 "B<clone>(2) with the exit signal set to B<SIGCHLD>, B<PTRACE_EVENT_FORK> "
1986 "will be delivered if B<PTRACE_O_TRACEFORK> is set."
1990 #: build/C/man2/ptrace.2:265
1992 msgid "B<PTRACE_O_TRACEEXEC> (since Linux 2.5.46)"
1996 #: build/C/man2/ptrace.2:270
1998 "Stop the child at the next B<execve>(2) call with I<SIGTRAP | "
1999 "PTRACE_EVENT_EXEC\\ E<lt>E<lt>\\ 8>."
2003 #: build/C/man2/ptrace.2:270
2005 msgid "B<PTRACE_O_TRACEVFORKDONE> (since Linux 2.5.60)"
2009 #: build/C/man2/ptrace.2:275
2011 "Stop the child at the completion of the next B<vfork>(2) call with "
2012 "I<SIGTRAP | PTRACE_EVENT_VFORK_DONE\\ E<lt>E<lt>\\ 8>."
2016 #: build/C/man2/ptrace.2:275
2018 msgid "B<PTRACE_O_TRACEEXIT> (since Linux 2.5.60)"
2022 #: build/C/man2/ptrace.2:286
2024 "Stop the child at exit with I<SIGTRAP | PTRACE_EVENT_EXIT\\ E<lt>E<lt>\\ "
2025 "8>. The child's exit status can be retrieved with B<PTRACE_GETEVENTMSG>. "
2026 "This stop will be done early during process exit when registers are still "
2027 "available, allowing the tracer to see where the exit occurred, whereas the "
2028 "normal exit notification is done after the process is finished exiting. "
2029 "Even though context is available, the tracer cannot prevent the exit from "
2030 "happening at this point."
2034 #: build/C/man2/ptrace.2:287
2036 msgid "B<PTRACE_GETEVENTMSG> (since Linux 2.5.46)"
2040 #: build/C/man2/ptrace.2:307
2042 "Retrieve a message (as an I<unsigned long>) about the ptrace event that "
2043 "just happened, placing it in the location I<data> in the parent. For "
2044 "B<PTRACE_EVENT_EXIT> this is the child's exit status. For "
2045 "B<PTRACE_EVENT_FORK>, B<PTRACE_EVENT_VFORK> and B<PTRACE_EVENT_CLONE> this "
2046 "is the PID of the new process. Since Linux 2.6.18, the PID of the new "
2047 "process is also available for B<PTRACE_EVENT_VFORK_DONE>. (I<addr> is "
2052 #: build/C/man2/ptrace.2:307
2054 msgid "B<PTRACE_CONT>"
2058 #: build/C/man2/ptrace.2:317
2060 "Restarts the stopped child process. If I<data> is nonzero and not "
2061 "B<SIGSTOP>, it is interpreted as a signal to be delivered to the child; "
2062 "otherwise, no signal is delivered. Thus, for example, the parent can "
2063 "control whether a signal sent to the child is delivered or not. (I<addr> is "
2068 #: build/C/man2/ptrace.2:317
2070 msgid "B<PTRACE_SYSCALL>, B<PTRACE_SINGLESTEP>"
2074 #: build/C/man2/ptrace.2:341
2076 "Restarts the stopped child as for B<PTRACE_CONT>, but arranges for the child "
2077 "to be stopped at the next entry to or exit from a system call, or after "
2078 "execution of a single instruction, respectively. (The child will also, as "
2079 "usual, be stopped upon receipt of a signal.) From the parent's perspective, "
2080 "the child will appear to have been stopped by receipt of a B<SIGTRAP>. So, "
2081 "for B<PTRACE_SYSCALL>, for example, the idea is to inspect the arguments to "
2082 "the system call at the first stop, then do another B<PTRACE_SYSCALL> and "
2083 "inspect the return value of the system call at the second stop. The I<data> "
2084 "argument is treated as for B<PTRACE_CONT>. (I<addr> is ignored.)"
2088 #: build/C/man2/ptrace.2:341
2090 msgid "B<PTRACE_SYSEMU>, B<PTRACE_SYSEMU_SINGLESTEP> (since Linux 2.6.14)"
2094 #: build/C/man2/ptrace.2:359
2096 "For B<PTRACE_SYSEMU>, continue and stop on entry to the next syscall, which "
2097 "will not be executed. For B<PTRACE_SYSEMU_SINGLESTEP>, do the same but also "
2098 "singlestep if not a syscall. This call is used by programs like User Mode "
2099 "Linux that want to emulate all the child's system calls. The I<data> "
2100 "argument is treated as for B<PTRACE_CONT>. (I<addr> is ignored; not "
2101 "supported on all architectures.)"
2105 #: build/C/man2/ptrace.2:359
2107 msgid "B<PTRACE_KILL>"
2111 #: build/C/man2/ptrace.2:365
2113 "Sends the child a B<SIGKILL> to terminate it. (I<addr> and I<data> are "
2118 #: build/C/man2/ptrace.2:365
2120 msgid "B<PTRACE_ATTACH>"
2124 #: build/C/man2/ptrace.2:386
2126 "Attaches to the process specified in I<pid>, making it a traced \"child\" of "
2127 "the calling process; the behavior of the child is as if it had done a "
2128 "B<PTRACE_TRACEME>. The calling process actually becomes the parent of the "
2129 "child process for most purposes (e.g., it will receive notification of child "
2130 "events and appears in B<ps>(1) output as the child's parent), but a "
2131 "B<getppid>(2) by the child will still return the PID of the original "
2132 "parent. The child is sent a B<SIGSTOP>, but will not necessarily have "
2133 "stopped by the completion of this call; use B<wait>(2) to wait for the "
2134 "child to stop. (I<addr> and I<data> are ignored.)"
2138 #: build/C/man2/ptrace.2:386
2140 msgid "B<PTRACE_DETACH>"
2144 #: build/C/man2/ptrace.2:399
2146 "Restarts the stopped child as for B<PTRACE_CONT>, but first detaches from "
2147 "the process, undoing the reparenting effect of B<PTRACE_ATTACH>, and the "
2148 "effects of B<PTRACE_TRACEME>. Although perhaps not intended, under Linux a "
2149 "traced child can be detached in this way regardless of which method was used "
2150 "to initiate tracing. (I<addr> is ignored.)"
2154 #: build/C/man2/ptrace.2:412
2156 "On success, B<PTRACE_PEEK*> requests return the requested data, while other "
2157 "requests return zero. On error, all requests return -1, and I<errno> is set "
2158 "appropriately. Since the value returned by a successful B<PTRACE_PEEK*> "
2159 "request may be -1, the caller must check I<errno> after such requests to "
2160 "determine whether or not an error occurred."
2164 #: build/C/man2/ptrace.2:417
2165 msgid "(i386 only) There was an error with allocating or freeing a debug register."
2169 #: build/C/man2/ptrace.2:428
2171 "There was an attempt to read from or write to an invalid area in the "
2172 "parent's or child's memory, probably because the area wasn't mapped or "
2173 "accessible. Unfortunately, under Linux, different variations of this fault "
2174 "will return B<EIO> or B<EFAULT> more or less arbitrarily."
2178 #: build/C/man2/ptrace.2:431
2179 msgid "An attempt was made to set an invalid option."
2183 #: build/C/man2/ptrace.2:437
2185 "I<request> is invalid, or an attempt was made to read from or write to an "
2186 "invalid area in the parent's or child's memory, or there was a "
2187 "word-alignment violation, or an invalid signal was specified during a "
2192 #: build/C/man2/ptrace.2:449
2194 "The specified process cannot be traced. This could be because the parent "
2195 "has insufficient privileges (the required capability is B<CAP_SYS_PTRACE>); "
2196 "unprivileged processes cannot trace processes that they cannot send signals "
2197 "to or those running set-user-ID/set-group-ID programs, for obvious reasons. "
2198 "Alternatively, the process may already be being traced, or be B<init>(8) "
2203 #: build/C/man2/ptrace.2:449 build/C/man2/quotactl.2:459 build/C/man2/quotactl.2:502
2209 #: build/C/man2/ptrace.2:453
2211 "The specified process does not exist, or is not currently being traced by "
2212 "the caller, or is not stopped (for requests that require that)."
2216 #: build/C/man2/ptrace.2:455
2217 msgid "SVr4, 4.3BSD."
2221 #: build/C/man2/ptrace.2:466
2223 "Although arguments to B<ptrace>() are interpreted according to the "
2224 "prototype given, glibc currently declares B<ptrace>() as a variadic "
2225 "function with only the I<request> argument fixed. This means that unneeded "
2226 "trailing arguments may be omitted, though doing so makes use of undocumented "
2227 "B<gcc>(1) behavior."
2231 #: build/C/man2/ptrace.2:469
2232 msgid "B<init>(8), the process with PID 1, may not be traced."
2235 #. See http://lkml.org/lkml/2008/5/8/375
2237 #: build/C/man2/ptrace.2:476
2239 "The layout of the contents of memory and the USER area are quite OS- and "
2240 "architecture-specific. The offset supplied, and the data returned, might "
2241 "not entirely match with the definition of I<struct user>."
2245 #: build/C/man2/ptrace.2:479
2247 "The size of a \"word\" is determined by the OS variant (e.g., for 32-bit "
2248 "Linux it is 32 bits, etc.)."
2252 #: build/C/man2/ptrace.2:488
2254 "Tracing causes a few subtle differences in the semantics of traced "
2255 "processes. For example, if a process is attached to with B<PTRACE_ATTACH>, "
2256 "its original parent can no longer receive notification via B<wait>(2) when "
2257 "it stops, and there is no way for the new parent to effectively simulate "
2258 "this notification."
2262 #: build/C/man2/ptrace.2:502
2264 "When the parent receives an event with B<PTRACE_EVENT_*> set, the child is "
2265 "not in the normal signal delivery path. This means the parent cannot do "
2266 "B<ptrace>(PTRACE_CONT) with a signal or B<ptrace>(PTRACE_KILL). B<kill>(2) "
2267 "with a B<SIGKILL> signal can be used instead to kill the child process after "
2268 "receiving one of these messages."
2272 #: build/C/man2/ptrace.2:510
2274 "This page documents the way the B<ptrace>() call works currently in Linux. "
2275 "Its behavior differs noticeably on other flavors of UNIX. In any case, use "
2276 "of B<ptrace>() is highly OS- and architecture-specific."
2280 #: build/C/man2/ptrace.2:518
2282 "The SunOS man page describes B<ptrace>() as \"unique and arcane\", which it "
2283 "is. The proc-based debugging interface present in Solaris 2 implements a "
2284 "superset of B<ptrace>() functionality in a more powerful and uniform way."
2288 #: build/C/man2/ptrace.2:530
2290 "On hosts with 2.6 kernel headers, B<PTRACE_SETOPTIONS> is declared with a "
2291 "different value than the one for 2.4. This leads to applications compiled "
2292 "with such headers failing when run on 2.4 kernels. This can be worked "
2293 "around by redefining B<PTRACE_SETOPTIONS> to B<PTRACE_OLDSETOPTIONS>, if "
2298 #: build/C/man2/ptrace.2:539
2300 "B<gdb>(1), B<strace>(1), B<execve>(2), B<fork>(2), B<signal>(2), B<wait>(2), "
2301 "B<exec>(3), B<capabilities>(7)"
2305 #: build/C/man2/quotactl.2:25
2311 #: build/C/man2/quotactl.2:25
2317 #: build/C/man2/quotactl.2:28
2318 msgid "quotactl - manipulate disk quotas"
2322 #: build/C/man2/quotactl.2:32
2325 "B<#include E<lt>sys/quota.hE<gt>>\n"
2326 "B<#include E<lt>xfs/xqm.hE<gt>>\n"
2330 #: build/C/man2/quotactl.2:35
2333 "B<int quotactl(int >I<cmd>B<, const char *>I<special>B<, int >I<id>B<, "
2334 "caddr_t >I<addr>B<);>\n"
2338 #: build/C/man2/quotactl.2:47
2340 "The quota system can be used to set per-user and per-group limits on the "
2341 "amount of disk space used on a file system. For each user and/or group, a "
2342 "soft limit and a hard limit can be set for each file system. The hard limit "
2343 "can't be exceeded. The soft limit can be exceeded, but warnings will "
2344 "ensue. Moreover, the user can't exceed the soft limit for more than one "
2345 "week (by default) at a time; after this time, the soft limit counts as a "
2350 #: build/C/man2/quotactl.2:72
2352 "The B<quotactl>() call manipulates disk quotas. The I<cmd> argument "
2353 "indicates a command to be applied to the user or group ID specified in "
2354 "I<id>. To initialize the I<cmd> argument, use the I<QCMD(subcmd, type)> "
2355 "macro. The I<type> value is either B<USRQUOTA>, for user quotas, or "
2356 "B<GRPQUOTA>, for group quotas. The I<subcmd> value is described below."
2360 #: build/C/man2/quotactl.2:77
2362 "The I<special> argument is a pointer to a null-terminated string containing "
2363 "the pathname of the (mounted) block special device for the file system being "
2368 #: build/C/man2/quotactl.2:85
2370 "The I<addr> argument is the address of an optional, command-specific, data "
2371 "structure that is copied in or out of the system. The interpretation of "
2372 "I<addr> is given with each command below."
2376 #: build/C/man2/quotactl.2:89
2377 msgid "The I<subcmd> value is one of the following:"
2381 #: build/C/man2/quotactl.2:89
2383 msgid "B<Q_QUOTAON>"
2387 #: build/C/man2/quotactl.2:96
2389 "Turn on quotas for a file system. The I<id> argument is the identification "
2390 "number of the quota format to be used. Currently, there are three supported "
2395 #: build/C/man2/quotactl.2:97
2397 msgid "B<QFMT_VFS_OLD>"
2401 #: build/C/man2/quotactl.2:100
2402 msgid "The original quota format."
2406 #: build/C/man2/quotactl.2:100
2408 msgid "B<QFMT_VFS_V0>"
2412 #: build/C/man2/quotactl.2:104
2414 "The standard VFS v0 quota format, which can handle 32-bit UIDs and GIDs and "
2415 "quota limits up to 2^42 bytes and 2^32 inodes."
2419 #: build/C/man2/quotactl.2:104
2421 msgid "B<QFMT_VFS_V1>"
2425 #: build/C/man2/quotactl.2:108
2427 "A quota format that can handle 32-bit UIDs and GIDs and quota limits of 2^64 "
2428 "bytes and 2^64 inodes."
2432 #: build/C/man2/quotactl.2:119
2434 "The I<addr> argument points to the pathname of a file containing the quotas "
2435 "for the file system. The quota file must exist; it is normally created with "
2436 "the B<quotacheck>(8) program. This operation requires privilege "
2437 "(B<CAP_SYS_ADMIN>)."
2441 #: build/C/man2/quotactl.2:119
2443 msgid "B<Q_QUOTAOFF>"
2447 #: build/C/man2/quotactl.2:129
2449 "Turn off quotas for a file system. The I<addr> and I<id> arguments are "
2450 "ignored. This operation requires privilege (B<CAP_SYS_ADMIN>)."
2454 #: build/C/man2/quotactl.2:129
2456 msgid "B<Q_GETQUOTA>"
2460 #: build/C/man2/quotactl.2:140
2462 "Get disk quota limits and current usage for user or group I<id>. The "
2463 "I<addr> argument is a pointer to a I<dqblk> structure defined in "
2464 "I<E<lt>sys/quota.hE<gt>> as follows:"
2468 #: build/C/man2/quotactl.2:145 build/C/man2/quotactl.2:232
2471 "/* uint64_t is an unsigned 64-bit integer;\n"
2472 " uint32_t is an unsigned 32-bit integer */\n"
2476 #: build/C/man2/quotactl.2:165
2479 "struct dqblk { /* Definition since Linux 2.4.22 */\n"
2480 " uint64_t dqb_bhardlimit; /* absolute limit on disk\n"
2481 " quota blocks alloc */\n"
2482 " uint64_t dqb_bsoftlimit; /* preferred limit on\n"
2483 " disk quota blocks */\n"
2484 " uint64_t dqb_curspace; /* current quota block\n"
2486 " uint64_t dqb_ihardlimit; /* maximum number of\n"
2487 " allocated inodes */\n"
2488 " uint64_t dqb_isoftlimit; /* preferred inode limit */\n"
2489 " uint64_t dqb_curinodes; /* current number of\n"
2490 " allocated inodes */\n"
2491 " uint64_t dqb_btime; /* time limit for excessive\n"
2493 " uint64_t dqb_itime; /* time limit for excessive\n"
2495 " uint32_t dqb_valid; /* bit mask of QIF_*\n"
2501 #: build/C/man2/quotactl.2:168
2504 "/* Flags in dqb_valid that indicate which fields in\n"
2505 " dqblk structure are valid. */\n"
2509 #: build/C/man2/quotactl.2:179
2512 "#define QIF_BLIMITS 1\n"
2513 "#define QIF_SPACE 2\n"
2514 "#define QIF_ILIMITS 4\n"
2515 "#define QIF_INODES 8\n"
2516 "#define QIF_BTIME 16\n"
2517 "#define QIF_ITIME 32\n"
2518 "#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)\n"
2519 "#define QIF_USAGE (QIF_SPACE | QIF_INODES)\n"
2520 "#define QIF_TIMES (QIF_BTIME | QIF_ITIME)\n"
2521 "#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)\n"
2525 #: build/C/man2/quotactl.2:196
2527 "The I<dqb_valid> field is a bit mask that is set to indicate the entries in "
2528 "the I<dqblk> structure that are valid. Currently, the kernel fills in all "
2529 "entries of the I<dqblk> structure and marks them as valid in the "
2530 "I<dqb_valid> field. Unprivileged users may retrieve only their own quotas; "
2531 "a privileged user (B<CAP_SYS_ADMIN>) can retrieve the quotas of any user."
2535 #: build/C/man2/quotactl.2:196
2537 msgid "B<Q_SETQUOTA>"
2541 #: build/C/man2/quotactl.2:216
2543 "Set quota information for user or group I<id>, using the information "
2544 "supplied in the I<dqblk> structure pointed to by I<addr>. The I<dqb_valid> "
2545 "field of the I<dqblk> structure indicates which entries in the structure "
2546 "have been set by the caller. This operation supersedes the B<Q_SETQLIM> and "
2547 "B<Q_SETUSE> operations in the previous quota interfaces. This operation "
2548 "requires privilege (B<CAP_SYS_ADMIN>)."
2552 #: build/C/man2/quotactl.2:216
2554 msgid "B<Q_GETINFO>"
2558 #: build/C/man2/quotactl.2:227
2560 "Get information (like grace times) about quotafile. The I<addr> argument "
2561 "should be a pointer to a I<dqinfo> structure. This structure is defined in "
2562 "I<E<lt>sys/quota.hE<gt>> as follows:"
2566 #: build/C/man2/quotactl.2:236
2569 "struct dqinfo { /* Defined since kernel 2.4.22 */\n"
2570 " uint64_t dqi_bgrace; /* Time before block soft limit\n"
2571 " becomes hard limit */\n"
2575 #: build/C/man2/quotactl.2:243
2578 " uint64_t dqi_igrace; /* Time before inode soft limit\n"
2579 " becomes hard limit */\n"
2580 " uint32_t dqi_flags; /* Flags for quotafile\n"
2582 " uint32_t dqi_valid;\n"
2587 #: build/C/man2/quotactl.2:245
2589 msgid "/* Bits for dqi_flags */\n"
2593 #: build/C/man2/quotactl.2:247
2595 msgid "/* Quota format QFMT_VFS_OLD */\n"
2599 #: build/C/man2/quotactl.2:249
2601 msgid "#define V1_DQF_RSQUASH\t1 /* Root squash enabled */\n"
2605 #: build/C/man2/quotactl.2:251
2607 msgid "/* Other quota formats have no dqi_flags bits defined */\n"
2611 #: build/C/man2/quotactl.2:254
2614 "/* Flags in dqi_valid that indicate which fields in\n"
2615 " dqinfo structure are valid. */\n"
2619 #: build/C/man2/quotactl.2:259
2622 "# define IIF_BGRACE\t1\n"
2623 "# define IIF_IGRACE\t2\n"
2624 "# define IIF_FLAGS\t4\n"
2625 "# define IIF_ALL\t(IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)\n"
2629 #: build/C/man2/quotactl.2:275
2631 "The I<dqi_valid> field in the I<dqinfo> structure indicates the entries in "
2632 "the structure that are valid. Currently, the kernel fills in all entries of "
2633 "the I<dqinfo> structure and marks them all as valid in the I<dqi_valid> "
2634 "field. The I<id> argument is ignored."
2638 #: build/C/man2/quotactl.2:275
2640 msgid "B<Q_SETINFO>"
2644 #: build/C/man2/quotactl.2:299
2646 "Set information about quotafile. The I<addr> argument should be a pointer "
2647 "to a I<dqinfo> structure. The I<dqi_valid> field of the I<dqinfo> structure "
2648 "indicates the entries in the structure that have been set by the caller. "
2649 "This operation supersedes the B<Q_SETGRACE> and B<Q_SETFLAGS> operations in "
2650 "the previous quota interfaces. The I<id> argument is ignored. This "
2651 "operation requires privilege (B<CAP_SYS_ADMIN>)."
2655 #: build/C/man2/quotactl.2:299
2661 #: build/C/man2/quotactl.2:306
2663 "Get quota format used on the specified file system. The I<addr> argument "
2664 "should be a pointer to a 4-byte buffer where the format number will be "
2669 #: build/C/man2/quotactl.2:306
2675 #: build/C/man2/quotactl.2:317
2677 "Update the on-disk copy of quota usages for a file system. If I<special> is "
2678 "NULL, then all file systems with active quotas are sync'ed. The I<addr> and "
2679 "I<id> arguments are ignored."
2683 #: build/C/man2/quotactl.2:317
2685 msgid "B<Q_GETSTATS>"
2688 #. Q_GETSTATS was removed in kernel 2.4.22.
2690 #: build/C/man2/quotactl.2:337
2692 "Get statistics and other generic information about the quota subsystem. The "
2693 "I<addr> argument should be a pointer to a I<dqstats> structure in which data "
2694 "should be stored. This structure is defined in I<E<lt>sys/quota.hE<gt>.> "
2695 "The I<special> and I<id> arguments are ignored. This operation is obsolete "
2696 "and not supported by recent kernels. Files in I</proc/sys/fs/quota/> carry "
2697 "the information instead."
2701 #: build/C/man2/quotactl.2:340
2703 "For XFS file systems making use of the XFS Quota Manager (XQM), the above "
2704 "commands are bypassed and the following commands are used:"
2708 #: build/C/man2/quotactl.2:340
2710 msgid "B<Q_XQUOTAON>"
2714 #: build/C/man2/quotactl.2:361
2716 "Turn on quotas for an XFS file system. XFS provides the ability to turn "
2717 "on/off quota limit enforcement with quota accounting. Therefore, XFS "
2718 "expects I<addr> to be a pointer to an I<unsigned int> that contains either "
2719 "the flags B<XFS_QUOTA_UDQ_ACCT> and/or B<XFS_QUOTA_UDQ_ENFD> (for user "
2720 "quota), or B<XFS_QUOTA_GDQ_ACCT> and/or B<XFS_QUOTA_GDQ_ENFD> (for group "
2721 "quota), as defined in I<E<lt>xfs/xqm.hE<gt>>. This operation requires "
2722 "privilege (B<CAP_SYS_ADMIN>)."
2726 #: build/C/man2/quotactl.2:361
2728 msgid "B<Q_XQUOTAOFF>"
2732 #: build/C/man2/quotactl.2:372
2734 "Turn off quotas for an XFS file system. As with B<Q_QUOTAON>, XFS file "
2735 "systems expect a pointer to an I<unsigned int> that specifies whether quota "
2736 "accounting and/or limit enforcement need to be turned off. This operation "
2737 "requires privilege (B<CAP_SYS_ADMIN>)."
2741 #: build/C/man2/quotactl.2:372
2743 msgid "B<Q_XGETQUOTA>"
2747 #: build/C/man2/quotactl.2:386
2749 "Get disk quota limits and current usage for user I<id>. The I<addr> "
2750 "argument is a pointer to an I<fs_disk_quota> structure (defined in "
2751 "I<E<lt>xfs/xqm.hE<gt>>). Unprivileged users may retrieve only their own "
2752 "quotas; a privileged user (B<CAP_SYS_ADMIN>) may retrieve the quotas of any "
2757 #: build/C/man2/quotactl.2:386
2759 msgid "B<Q_XSETQLIM>"
2763 #: build/C/man2/quotactl.2:398
2765 "Set disk quota limits for user I<id>. The I<addr> argument is a pointer to "
2766 "an I<fs_disk_quota> structure (defined in I<E<lt>xfs/xqm.hE<gt>>). This "
2767 "operation requires privilege (B<CAP_SYS_ADMIN>)."
2771 #: build/C/man2/quotactl.2:398
2773 msgid "B<Q_XGETQSTAT>"
2777 #: build/C/man2/quotactl.2:406
2779 "Returns an I<fs_quota_stat> structure containing XFS file system specific "
2780 "quota information. This is useful for finding out how much space is used to "
2781 "store quota information, and also to get quotaon/off status of a given local "
2786 #: build/C/man2/quotactl.2:406
2788 msgid "B<Q_XQUOTARM>"
2792 #: build/C/man2/quotactl.2:410
2794 "Free the disk space taken by disk quotas. Quotas must have already been "
2799 #: build/C/man2/quotactl.2:417
2801 "There is no command equivalent to B<Q_SYNC> for XFS since B<sync>(1) writes "
2802 "quota information to disk (in addition to the other file system metadata "
2803 "that it writes out)."
2807 #: build/C/man2/quotactl.2:417
2809 msgid "RETURN VALUES"
2813 #: build/C/man2/quotactl.2:425
2815 "On success, B<quotactl>() returns 0; on error -1 is returned, and I<errno> "
2816 "is set to indicate the error."
2820 #: build/C/man2/quotactl.2:432
2821 msgid "I<addr> or I<special> is invalid."
2825 #: build/C/man2/quotactl.2:438
2826 msgid "I<cmd> or I<type> is invalid."
2830 #: build/C/man2/quotactl.2:438
2836 #: build/C/man2/quotactl.2:445
2837 msgid "The file specified by I<special> or I<addr> does not exist."
2841 #: build/C/man2/quotactl.2:450
2842 msgid "The kernel has not been compiled with the B<CONFIG_QUOTA> option."
2846 #: build/C/man2/quotactl.2:450
2852 #: build/C/man2/quotactl.2:454
2853 msgid "I<special> is not a block device."
2857 #: build/C/man2/quotactl.2:459
2859 "The caller lacked the required privilege (B<CAP_SYS_ADMIN>) for the "
2860 "specified operation."
2864 #: build/C/man2/quotactl.2:463
2866 "No disk quota is found for the indicated user. Quotas have not been turned "
2867 "on for this file system."
2871 #: build/C/man2/quotactl.2:472
2872 msgid "If I<cmd> is B<Q_SETQUOTA>, B<quotactl>() may also set I<errno> to:"
2876 #: build/C/man2/quotactl.2:475
2877 msgid "Specified limits are out of range allowed by quota format."
2881 #: build/C/man2/quotactl.2:484
2882 msgid "If I<cmd> is B<Q_QUOTAON>, B<quotactl>() may also set I<errno> to:"
2886 #: build/C/man2/quotactl.2:493
2888 "The quota file pointed to by I<addr> exists, but is not a regular file; or, "
2889 "the quota file pointed to by I<addr> exists, but is not on the file system "
2890 "pointed to by I<special>."
2894 #: build/C/man2/quotactl.2:499
2895 msgid "B<Q_QUOTAON> attempted, but another B<Q_QUOTAON> had already been performed."
2899 #: build/C/man2/quotactl.2:502
2900 msgid "The quota file is corrupted."
2904 #: build/C/man2/quotactl.2:505
2905 msgid "Specified quota format was not found."
2909 #: build/C/man2/quotactl.2:510
2910 msgid "B<quota>(1), B<getrlimit>(2), B<quotacheck>(8), B<quotaon>(8)"
2914 #: build/C/man2/sendfile.2:15
2920 #: build/C/man2/sendfile.2:15
2926 #: build/C/man2/sendfile.2:18
2927 msgid "sendfile - transfer data between file descriptors"
2931 #: build/C/man2/sendfile.2:20
2932 msgid "B<#include E<lt>sys/sendfile.hE<gt>>"
2935 #. The below is too ugly. Comments about glibc versions belong
2936 #. in the notes, not in the header.
2938 #. .B #include <features.h>
2940 #. .B #if (__GLIBC__==2 && __GLIBC_MINOR__>=1) || __GLIBC__>2
2942 #. .B #include <sys/sendfile.h>
2946 #. .B #include <sys/types.h>
2948 #. .B /* No system prototype before glibc 2.1. */
2950 #. .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \
2951 #. offset ", size_t" " count" )
2955 #: build/C/man2/sendfile.2:43
2957 "B<ssize_t sendfile(int>I< out_fd>B<, int>I< in_fd>B<, off_t *>I<offset>B<, "
2958 "size_t>I< count>B<);>"
2962 #: build/C/man2/sendfile.2:53
2964 "B<sendfile>() copies data between one file descriptor and another. Because "
2965 "this copying is done within the kernel, B<sendfile>() is more efficient "
2966 "than the combination of B<read>(2) and B<write>(2), which would require "
2967 "transferring data to and from user space."
2971 #: build/C/man2/sendfile.2:58
2973 "I<in_fd> should be a file descriptor opened for reading and I<out_fd> should "
2974 "be a descriptor opened for writing."
2978 #: build/C/man2/sendfile.2:79
2980 "If I<offset> is not NULL, then it points to a variable holding the file "
2981 "offset from which B<sendfile>() will start reading data from I<in_fd>. "
2982 "When B<sendfile>() returns, this variable will be set to the offset of the "
2983 "byte following the last byte that was read. If I<offset> is not NULL, then "
2984 "B<sendfile>() does not modify the current file offset of I<in_fd>; "
2985 "otherwise the current file offset is adjusted to reflect the number of bytes "
2986 "read from I<in_fd>."
2990 #: build/C/man2/sendfile.2:86
2992 "If I<offset> is NULL, then data will be read from I<in_fd> starting at the "
2993 "current file offset, and the file offset will be updated by the call."
2997 #: build/C/man2/sendfile.2:89
2998 msgid "I<count> is the number of bytes to copy between the file descriptors."
3002 #: build/C/man2/sendfile.2:96
3004 "The I<in_fd> argument must correspond to a file which supports "
3005 "B<mmap>(2)-like operations (i.e., it cannot be a socket)."
3009 #: build/C/man2/sendfile.2:104
3011 "In Linux kernels before 2.6.33, I<out_fd> must refer to a socket. Since "
3012 "Linux 2.6.33 it can be any file. If it is a regular file, then "
3013 "B<sendfile>() changes the file offset appropriately."
3017 #: build/C/man2/sendfile.2:111
3019 "If the transfer was successful, the number of bytes written to I<out_fd> is "
3020 "returned. On error, -1 is returned, and I<errno> is set appropriately."
3024 #: build/C/man2/sendfile.2:117
3026 "Nonblocking I/O has been selected using B<O_NONBLOCK> and the write would "
3031 #: build/C/man2/sendfile.2:117 build/C/man2/splice.2:143 build/C/man2/vmsplice.2:123
3037 #: build/C/man2/sendfile.2:121
3039 "The input file was not opened for reading or the output file was not opened "
3044 #: build/C/man2/sendfile.2:124
3045 msgid "Bad address."
3049 #: build/C/man2/sendfile.2:130
3051 "Descriptor is not valid or locked, or an B<mmap>(2)-like operation is not "
3052 "available for I<in_fd>."
3056 #: build/C/man2/sendfile.2:134
3057 msgid "Unspecified error while reading from I<in_fd>."
3061 #: build/C/man2/sendfile.2:138
3062 msgid "Insufficient memory to read from I<in_fd>."
3066 #: build/C/man2/sendfile.2:144
3068 "B<sendfile>() is a new feature in Linux 2.2. The include file "
3069 "I<E<lt>sys/sendfile.hE<gt>> is present since glibc 2.1."
3073 #: build/C/man2/sendfile.2:146
3074 msgid "Not specified in POSIX.1-2001, or other standards."
3078 #: build/C/man2/sendfile.2:151
3080 "Other UNIX systems implement B<sendfile>() with different semantics and "
3081 "prototypes. It should not be used in portable programs."
3085 #: build/C/man2/sendfile.2:161
3087 "If you plan to use B<sendfile>() for sending files to a TCP socket, but "
3088 "need to send some header data in front of the file contents, you will find "
3089 "it useful to employ the B<TCP_CORK> option, described in B<tcp>(7), to "
3090 "minimize the number of packets and to tune performance."
3094 #: build/C/man2/sendfile.2:167
3096 "In Linux 2.4 and earlier, I<out_fd> could also refer to a regular file, and "
3097 "B<sendfile>() changed the current offset of that file."
3101 #: build/C/man2/sendfile.2:179
3103 "The original Linux B<sendfile>() system call was not designed to handle "
3104 "large file offsets. Consequently, Linux 2.4 added B<sendfile64>(), with a "
3105 "wider type for the I<offset> argument. The glibc B<sendfile>() wrapper "
3106 "function transparently deals with the kernel differences."
3110 #: build/C/man2/sendfile.2:188
3112 "Applications may wish to fall back to B<read>(2)/B<write>(2) in the case "
3113 "where B<sendfile>() fails with B<EINVAL> or B<ENOSYS>."
3117 #: build/C/man2/sendfile.2:193
3119 "The Linux-specific B<splice>(2) call supports transferring data between "
3120 "arbitrary files (e.g., a pair of sockets)."
3124 #: build/C/man2/sendfile.2:198
3125 msgid "B<mmap>(2), B<open>(2), B<socket>(2), B<splice>(2)"
3129 #: build/C/man2/set_tid_address.2:23
3131 msgid "SET_TID_ADDRESS"
3135 #: build/C/man2/set_tid_address.2:23
3141 #: build/C/man2/set_tid_address.2:26
3142 msgid "set_tid_address - set pointer to thread ID"
3146 #: build/C/man2/set_tid_address.2:29
3148 msgid "B<#include E<lt>linux/unistd.hE<gt>>\n"
3152 #: build/C/man2/set_tid_address.2:31
3154 msgid "B<long set_tid_address(int *>I<tidptr>B<);>\n"
3158 #: build/C/man2/set_tid_address.2:38
3160 "The kernel keeps for each process two values called I<set_child_tid> and "
3161 "I<clear_child_tid> that are NULL by default."
3165 #: build/C/man2/set_tid_address.2:38
3167 msgid "set_child_tid"
3171 #: build/C/man2/set_tid_address.2:48
3173 "If a process is started using B<clone>(2) with the B<CLONE_CHILD_SETTID> "
3174 "flag, I<set_child_tid> is set to I<child_tidptr>, the fifth argument of that "
3179 #: build/C/man2/set_tid_address.2:53
3181 "When I<set_child_tid> is set, the very first thing the new process does is "
3182 "writing its PID at this address."
3186 #: build/C/man2/set_tid_address.2:53
3188 msgid "clear_child_tid"
3192 #: build/C/man2/set_tid_address.2:63
3194 "If a process is started using B<clone>(2) with the B<CLONE_CHILD_CLEARTID> "
3195 "flag, I<clear_child_tid> is set to I<child_tidptr>, the fifth argument of "
3200 #: build/C/man2/set_tid_address.2:70
3202 "The system call B<set_tid_address>() sets the I<clear_child_tid> value for "
3203 "the calling process to I<tidptr>."
3207 #: build/C/man2/set_tid_address.2:80
3209 "When I<clear_child_tid> is set, and the process exits, and the process was "
3210 "sharing memory with other processes or threads, then 0 is written at this "
3211 "address, and a I<futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0);> call is "
3212 "done. (That is, wake a single process waiting on this futex.) Errors are "
3217 #: build/C/man2/set_tid_address.2:83
3218 msgid "B<set_tid_address>() always returns the PID of the calling process."
3222 #: build/C/man2/set_tid_address.2:86
3223 msgid "B<set_tid_address>() always succeeds."
3227 #: build/C/man2/set_tid_address.2:89
3229 "This call is present since Linux 2.5.48. Details as given here are valid "
3230 "since Linux 2.5.49."
3234 #: build/C/man2/set_tid_address.2:94
3235 msgid "B<clone>(2), B<futex>(2)"
3239 #: build/C/man2/splice.2:26
3245 #: build/C/man2/splice.2:26 build/C/man2/tee.2:26 build/C/man2/vmsplice.2:26
3251 #: build/C/man2/splice.2:29
3252 msgid "splice - splice data to/from a pipe"
3256 #: build/C/man2/splice.2:33 build/C/man2/tee.2:33
3259 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
3260 "B<#include E<lt>fcntl.hE<gt>>\n"
3263 #. Return type was long before glibc 2.7
3265 #: build/C/man2/splice.2:38
3268 "B<ssize_t splice(int >I<fd_in>B<, loff_t *>I<off_in>B<, int >I<fd_out>B<,>\n"
3269 "B< loff_t *>I<off_out>B<, size_t >I<len>B<, unsigned int "
3274 #: build/C/man2/splice.2:50
3276 "B<splice>() moves data between two file descriptors without copying between "
3277 "kernel address space and user address space. It transfers up to I<len> "
3278 "bytes of data from the file descriptor I<fd_in> to the file descriptor "
3279 "I<fd_out>, where one of the descriptors must refer to a pipe."
3283 #: build/C/man2/splice.2:80
3285 "If I<fd_in> refers to a pipe, then I<off_in> must be NULL. If I<fd_in> does "
3286 "not refer to a pipe and I<off_in> is NULL, then bytes are read from I<fd_in> "
3287 "starting from the current file offset, and the current file offset is "
3288 "adjusted appropriately. If I<fd_in> does not refer to a pipe and I<off_in> "
3289 "is not NULL, then I<off_in> must point to a buffer which specifies the "
3290 "starting offset from which bytes will be read from I<fd_in>; in this case, "
3291 "the current file offset of I<fd_in> is not changed. Analogous statements "
3292 "apply for I<fd_out> and I<off_out>."
3296 #: build/C/man2/splice.2:85 build/C/man2/vmsplice.2:78
3298 "The I<flags> argument is a bit mask that is composed by ORing together zero "
3299 "or more of the following values:"
3303 #: build/C/man2/splice.2:85 build/C/man2/tee.2:62 build/C/man2/vmsplice.2:78
3305 msgid "B<SPLICE_F_MOVE>"
3309 #: build/C/man2/splice.2:98
3311 "Attempt to move pages instead of copying. This is only a hint to the "
3312 "kernel: pages may still be copied if the kernel cannot move the pages from "
3313 "the pipe, or if the pipe buffers don't refer to full pages. The initial "
3314 "implementation of this flag was buggy: therefore starting in Linux 2.6.21 it "
3315 "is a no-op (but is still permitted in a B<splice>() call); in the future, a "
3316 "correct implementation may be restored."
3320 #: build/C/man2/splice.2:98 build/C/man2/tee.2:68 build/C/man2/vmsplice.2:84
3322 msgid "B<SPLICE_F_NONBLOCK>"
3326 #: build/C/man2/splice.2:107
3328 "Do not block on I/O. This makes the splice pipe operations nonblocking, but "
3329 "B<splice>() may nevertheless block because the file descriptors that are "
3330 "spliced to/from may block (unless they have the B<O_NONBLOCK> flag set)."
3334 #: build/C/man2/splice.2:107 build/C/man2/tee.2:73 build/C/man2/vmsplice.2:91
3336 msgid "B<SPLICE_F_MORE>"
3340 #: build/C/man2/splice.2:121
3342 "More data will be coming in a subsequent splice. This is a helpful hint "
3343 "when the I<fd_out> refers to a socket (see also the description of "
3344 "B<MSG_MORE> in B<send>(2), and the description of B<TCP_CORK> in B<tcp>(7))"
3348 #: build/C/man2/splice.2:121 build/C/man2/tee.2:79 build/C/man2/vmsplice.2:97
3350 msgid "B<SPLICE_F_GIFT>"
3354 #: build/C/man2/splice.2:127
3355 msgid "Unused for B<splice>(); see B<vmsplice>(2)."
3359 #: build/C/man2/splice.2:136
3361 "Upon successful completion, B<splice>() returns the number of bytes spliced "
3362 "to or from the pipe. A return value of 0 means that there was no data to "
3363 "transfer, and it would not make sense to block, because there are no writers "
3364 "connected to the write end of the pipe referred to by I<fd_in>."
3368 #: build/C/man2/splice.2:142
3369 msgid "On error, B<splice>() returns -1 and I<errno> is set to indicate the error."
3373 #: build/C/man2/splice.2:147
3375 "One or both file descriptors are not valid, or do not have proper read-write "
3379 #. The append-mode error is given since 2.6.27; in earlier kernels,
3380 #. splice() in append mode was broken
3382 #: build/C/man2/splice.2:155
3384 "Target file system doesn't support splicing; target file is opened in append "
3385 "mode; neither of the descriptors refers to a pipe; or offset given for "
3386 "nonseekable device."
3390 #: build/C/man2/splice.2:158 build/C/man2/tee.2:114 build/C/man2/vmsplice.2:138
3391 msgid "Out of memory."
3395 #: build/C/man2/splice.2:158
3401 #: build/C/man2/splice.2:165
3403 "Either I<off_in> or I<off_out> was not NULL, but the corresponding file "
3404 "descriptor refers to a pipe."
3408 #: build/C/man2/splice.2:169
3409 msgid "The B<splice>() system call first appeared in Linux 2.6.17."
3413 #: build/C/man2/splice.2:181
3415 "The three system calls B<splice>(), B<vmsplice>(2), and B<tee>(2), provide "
3416 "userspace programs with full control over an arbitrary kernel buffer, "
3417 "implemented within the kernel using the same type of buffer that is used for "
3418 "a pipe. In overview, these system calls perform the following tasks:"
3422 #: build/C/man2/splice.2:181
3428 #: build/C/man2/splice.2:185
3430 "moves data from the buffer to an arbitrary file descriptor, or vice versa, "
3431 "or from one buffer to another."
3435 #: build/C/man2/splice.2:185
3441 #: build/C/man2/splice.2:188
3442 msgid "\"copies\" the data from one buffer to another."
3446 #: build/C/man2/splice.2:188
3448 msgid "B<vmsplice>(2)"
3452 #: build/C/man2/splice.2:191
3453 msgid "\"copies\" data from user space into the buffer."
3457 #. Linus: Now, imagine using the above in a media server, for example.
3458 #. Let's say that a year or two has passed, so that the video drivers
3459 #. have been updated to be able to do the splice thing, and what can
3462 #. - splice from the (mpeg or whatever - let's just assume that the video
3463 #. input is either digital or does the encoding on its own - like they
3464 #. pretty much all do) video input into a pipe (remember: no copies - the
3465 #. video input will just DMA directly into memory, and splice will just
3466 #. set up the pages in the pipe buffer)
3467 #. - tee that pipe to split it up
3468 #. - splice one end to a file (ie "save the compressed stream to disk")
3469 #. - splice the other end to a real-time video decoder window for your
3470 #. real-time viewing pleasure.
3472 #. Linus: Now, the advantage of splice()/tee() is that you can
3473 #. do zero-copy movement of data, and unlike sendfile() you can
3474 #. do it on _arbitrary_ data (and, as shown by "tee()", it's more
3475 #. than just sending the data to somebody else: you can duplicate
3476 #. the data and choose to forward it to two or more different
3477 #. users - for things like logging etc.).
3479 #: build/C/man2/splice.2:222
3481 "Though we talk of copying, actual copies are generally avoided. The kernel "
3482 "does this by implementing a pipe buffer as a set of reference-counted "
3483 "pointers to pages of kernel memory. The kernel creates \"copies\" of pages "
3484 "in a buffer by creating new pointers (for the output buffer) referring to "
3485 "the pages, and increasing the reference counts for the pages: only pointers "
3486 "are copied, not the pages of the buffer."
3490 #: build/C/man2/splice.2:222 build/C/man2/tee.2:129
3496 #: build/C/man2/splice.2:225
3497 msgid "See B<tee>(2)."
3501 #: build/C/man2/splice.2:229
3502 msgid "B<sendfile>(2), B<tee>(2), B<vmsplice>(2)"
3506 #: build/C/man2/tee.2:26
3512 #: build/C/man2/tee.2:29
3513 msgid "tee - duplicating pipe content"
3517 #: build/C/man2/tee.2:36
3520 "B<ssize_t tee(int >I<fd_in>B<, int >I<fd_out>B<, size_t >I<len>B<, unsigned "
3521 "int >I<flags>B<);>\n"
3524 #. Example programs http://brick.kernel.dk/snaps
3527 #. add a "tee(in, out1, out2)" system call that duplicates the pages
3528 #. (again, incrementing their reference count, not copying the data) from
3529 #. one pipe to two other pipes.
3531 #: build/C/man2/tee.2:56
3533 "B<tee>() duplicates up to I<len> bytes of data from the pipe referred to by "
3534 "the file descriptor I<fd_in> to the pipe referred to by the file descriptor "
3535 "I<fd_out>. It does not consume the data that is duplicated from I<fd_in>; "
3536 "therefore, that data can be copied by a subsequent B<splice>(2)."
3540 #: build/C/man2/tee.2:62
3542 "I<flags> is a series of modifier flags, which share the name space with "
3543 "B<splice>(2) and B<vmsplice>(2):"
3547 #: build/C/man2/tee.2:68
3548 msgid "Currently has no effect for B<tee>(); see B<splice>(2)."
3551 #. Not used for vmsplice
3552 #. May be in the future -- therefore EAGAIN
3554 #: build/C/man2/tee.2:73 build/C/man2/vmsplice.2:91
3555 msgid "Do not block on I/O; see B<splice>(2) for further details."
3559 #: build/C/man2/tee.2:79
3561 "Currently has no effect for B<tee>(), but may be implemented in the future; "
3566 #: build/C/man2/tee.2:85
3567 msgid "Unused for B<tee>(); see B<vmsplice>(2)."
3571 #: build/C/man2/tee.2:94
3573 "Upon successful completion, B<tee>() returns the number of bytes that were "
3574 "duplicated between the input and output. A return value of 0 means that "
3575 "there was no data to transfer, and it would not make sense to block, because "
3576 "there are no writers connected to the write end of the pipe referred to by "
3581 #: build/C/man2/tee.2:100
3582 msgid "On error, B<tee>() returns -1 and I<errno> is set to indicate the error."
3586 #: build/C/man2/tee.2:111
3588 "I<fd_in> or I<fd_out> does not refer to a pipe; or I<fd_in> and I<fd_out> "
3589 "refer to the same pipe."
3593 #: build/C/man2/tee.2:118
3594 msgid "The B<tee>() system call first appeared in Linux 2.6.17."
3598 #: build/C/man2/tee.2:129
3600 "Conceptually, B<tee>() copies the data between the two pipes. In reality "
3601 "no real data copying takes place though: under the covers, B<tee>() assigns "
3602 "data in the output by merely grabbing a reference to the input."
3606 #: build/C/man2/tee.2:135
3608 "The following example implements a basic B<tee>(1) program using the "
3609 "B<tee>() system call."
3613 #: build/C/man2/tee.2:144
3616 "#define _GNU_SOURCE\n"
3617 "#include E<lt>fcntl.hE<gt>\n"
3618 "#include E<lt>stdio.hE<gt>\n"
3619 "#include E<lt>stdlib.hE<gt>\n"
3620 "#include E<lt>unistd.hE<gt>\n"
3621 "#include E<lt>errno.hE<gt>\n"
3622 "#include E<lt>limits.hE<gt>\n"
3626 #: build/C/man2/tee.2:150
3630 "main(int argc, char *argv[])\n"
3637 #: build/C/man2/tee.2:155
3640 " if (argc != 2) {\n"
3641 " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
3642 " exit(EXIT_FAILURE);\n"
3647 #: build/C/man2/tee.2:161
3650 " fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);\n"
3651 " if (fd == -1) {\n"
3652 " perror(\"open\");\n"
3653 " exit(EXIT_FAILURE);\n"
3658 #: build/C/man2/tee.2:168
3663 " * tee stdin to stdout.\n"
3665 " len = tee(STDIN_FILENO, STDOUT_FILENO,\n"
3666 " INT_MAX, SPLICE_F_NONBLOCK);\n"
3670 #: build/C/man2/tee.2:177
3673 " if (len E<lt> 0) {\n"
3674 " if (errno == EAGAIN)\n"
3676 " perror(\"tee\");\n"
3677 " exit(EXIT_FAILURE);\n"
3684 #: build/C/man2/tee.2:191
3688 " * Consume stdin by splicing it to a file.\n"
3690 " while (len E<gt> 0) {\n"
3691 " slen = splice(STDIN_FILENO, NULL, fd, NULL,\n"
3692 " len, SPLICE_F_MOVE);\n"
3693 " if (slen E<lt> 0) {\n"
3694 " perror(\"splice\");\n"
3703 #: build/C/man2/tee.2:195
3707 " exit(EXIT_SUCCESS);\n"
3712 #: build/C/man2/tee.2:199
3713 msgid "B<splice>(2), B<vmsplice>(2)"
3717 #: build/C/man2/vm86.2:26
3723 #: build/C/man2/vm86.2:26
3729 #: build/C/man2/vm86.2:29
3730 msgid "vm86old, vm86 - enter virtual 8086 mode"
3734 #: build/C/man2/vm86.2:31
3735 msgid "B<#include E<lt>sys/vm86.hE<gt>>"
3739 #: build/C/man2/vm86.2:33
3740 msgid "B<int vm86old(struct vm86_struct *>I<info>B<);>"
3744 #: build/C/man2/vm86.2:35
3745 msgid "B<int vm86(unsigned long >I<fn>B<, struct vm86plus_struct *>I<v86>B<);>"
3749 #: build/C/man2/vm86.2:46
3751 "The system call B<vm86>() was introduced in Linux 0.97p2. In Linux 2.1.15 "
3752 "and 2.0.28 it was renamed to B<vm86old>(), and a new B<vm86>() was "
3753 "introduced. The definition of I<struct vm86_struct> was changed in 1.1.8 "
3758 #: build/C/man2/vm86.2:50
3760 "These calls cause the process to enter VM86 mode (virtual-8086 in Intel "
3761 "literature), and are used by B<dosemu>."
3765 #: build/C/man2/vm86.2:52
3766 msgid "VM86 mode is an emulation of real mode within a protected mode task."
3770 #: build/C/man2/vm86.2:62
3772 "This return value is specific to i386 and indicates a problem with getting "
3777 #: build/C/man2/vm86.2:66
3779 "This return value indicates the call is not implemented on the present "
3784 #: build/C/man2/vm86.2:71
3786 "Saved kernel stack exists. (This is a kernel sanity check; the saved stack "
3787 "should only exist within vm86 mode itself.)"
3791 #: build/C/man2/vm86.2:74
3793 "This call is specific to Linux on 32-bit Intel processors, and should not be "
3794 "used in programs intended to be portable."
3798 #: build/C/man2/vmsplice.2:26
3804 #: build/C/man2/vmsplice.2:29
3805 msgid "vmsplice - splice user pages into a pipe"
3809 #: build/C/man2/vmsplice.2:34
3812 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
3813 "B<#include E<lt>fcntl.hE<gt>>\n"
3814 "B<#include E<lt>sys/uio.hE<gt>>\n"
3818 #: build/C/man2/vmsplice.2:37
3821 "B<ssize_t vmsplice(int >I<fd>B<, const struct iovec *>I<iov>B<,>\n"
3822 "B< unsigned long >I<nr_segs>B<, unsigned int "
3826 #. Linus: vmsplice() system call to basically do a "write to
3827 #. the buffer", but using the reference counting and VM traversal
3828 #. to actually fill the buffer. This means that the user needs to
3829 #. be careful not to reuse the user-space buffer it spliced into
3830 #. the kernel-space one (contrast this to "write()", which copies
3831 #. the actual data, and you can thus reuse the buffer immediately
3832 #. after a successful write), but that is often easy to do.
3834 #: build/C/man2/vmsplice.2:57
3836 "The B<vmsplice>() system call maps I<nr_segs> ranges of user memory "
3837 "described by I<iov> into a pipe. The file descriptor I<fd> must refer to a "
3842 #: build/C/man2/vmsplice.2:64
3844 "The pointer I<iov> points to an array of I<iovec> structures as defined in "
3845 "I<E<lt>sys/uio.hE<gt>>:"
3849 #: build/C/man2/vmsplice.2:71
3853 " void *iov_base; /* Starting address */\n"
3854 " size_t iov_len; /* Number of bytes */\n"
3859 #: build/C/man2/vmsplice.2:84
3860 msgid "Unused for B<vmsplice>(); see B<splice>(2)."
3864 #: build/C/man2/vmsplice.2:97
3866 "Currently has no effect for B<vmsplice>(), but may be implemented in the "
3867 "future; see B<splice>(2)."
3870 #. FIXME Explain the following line in a little more detail:
3871 #. .... if we expect to later SPLICE_F_MOVE to the cache.
3873 #: build/C/man2/vmsplice.2:113
3875 "The user pages are a gift to the kernel. The application may not modify "
3876 "this memory ever, or page cache and on-disk data may differ. Gifting pages "
3877 "to the kernel means that a subsequent B<splice>(2) B<SPLICE_F_MOVE> can "
3878 "successfully move the pages; if this flag is not specified, then a "
3879 "subsequent B<splice>(2) B<SPLICE_F_MOVE> must copy the pages. Data must "
3880 "also be properly page aligned, both in memory and length."
3884 #: build/C/man2/vmsplice.2:122
3886 "Upon successful completion, B<vmsplice>() returns the number of bytes "
3887 "transferred to the pipe. On error, B<vmsplice>() returns -1 and I<errno> "
3888 "is set to indicate the error."
3892 #: build/C/man2/vmsplice.2:127
3893 msgid "I<fd> either not valid, or doesn't refer to a pipe."
3897 #: build/C/man2/vmsplice.2:135
3899 "I<nr_segs> is 0 or greater than B<IOV_MAX>; or memory not aligned if "
3900 "B<SPLICE_F_GIFT> set."
3904 #: build/C/man2/vmsplice.2:142
3905 msgid "The B<vmsplice>() system call first appeared in Linux 2.6.17."
3909 #: build/C/man2/vmsplice.2:153
3911 "B<vmsplice>() follows the other vectorized read/write type functions when "
3912 "it comes to limitations on number of segments being passed in. This limit "
3913 "is B<IOV_MAX> as defined in I<E<lt>limits.hE<gt>>. At the time of this "
3914 "writing, that limit is 1024."
3918 #: build/C/man2/vmsplice.2:156
3919 msgid "B<splice>(2), B<tee>(2)"