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-05-28 07:16+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/get_robust_list.2:27 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/process_vm_readv.2:27 build/C/man2/ptrace.2:49 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/process_vm_readv.2:27 build/C/man2/ptrace.2:49 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/get_robust_list.2:28 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/process_vm_readv.2:28 build/C/man2/ptrace.2:50 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/get_robust_list.2:30 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/process_vm_readv.2:30 build/C/man2/ptrace.2:52 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/get_robust_list.2:39 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/process_vm_readv.2:48 build/C/man2/ptrace.2:59 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/get_robust_list.2:72 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:51 build/C/man2/pciconfig_read.2:47 build/C/man2/personality.2:55 build/C/man2/pivot_root.2:95 build/C/man2/process_vm_readv.2:207 build/C/man2/ptrace.2:1580 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/get_robust_list.2:79 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/process_vm_readv.2:227 build/C/man2/ptrace.2:1594 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/get_robust_list.2:106 build/C/man2/lookup_dcookie.2:51 build/C/man2/modify_ldt.2:107 build/C/man2/process_vm_readv.2:249 build/C/man2/process_vm_readv.2:254 build/C/man2/ptrace.2:1598 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/get_robust_list.2:83 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/process_vm_readv.2:228 build/C/man2/process_vm_readv.2:239 build/C/man2/process_vm_readv.2:243 build/C/man2/ptrace.2:1609 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/get_robust_list.2:93 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/process_vm_readv.2:265 build/C/man2/ptrace.2:1619 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:56 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/process_vm_readv.2:277 build/C/man2/ptrace.2:1637 build/C/man2/sendfile.2:144 build/C/man2/set_tid_address.2:89 build/C/man2/splice.2:170 build/C/man2/tee.2:119 build/C/man2/vm86.2:71 build/C/man2/vmsplice.2:143
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/get_robust_list.2:114 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/process_vm_readv.2:279 build/C/man2/ptrace.2:1639 build/C/man2/sendfile.2:151 build/C/man2/splice.2:172 build/C/man2/tee.2:121 build/C/man2/vmsplice.2:145
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/get_robust_list.2:121 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/process_vm_readv.2:329 build/C/man2/ptrace.2:1746 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:226 build/C/man2/tee.2:197 build/C/man2/vmsplice.2:154
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/get_robust_list.2:130 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:58 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/process_vm_readv.2:332 build/C/man2/ptrace.2:1760 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:230 build/C/man2/tee.2:200 build/C/man2/vm86.2:74 build/C/man2/vmsplice.2:157
288 #: build/C/man2/arch_prctl.2:151 build/C/man2/futex.2:281 build/C/man2/get_robust_list.2:137 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:65 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/process_vm_readv.2:339 build/C/man2/ptrace.2:1767 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:237 build/C/man2/tee.2:207 build/C/man2/vm86.2:81 build/C/man2/vmsplice.2:164
290 "This page is part of release 3.41 of the Linux I<man-pages> project. A "
291 "description of the project, and information about reporting bugs, can be "
292 "found at http://www.kernel.org/doc/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/get_robust_list.2:110 build/C/man2/kexec_load.2:134 build/C/man2/lookup_dcookie.2:73 build/C/man2/pivot_root.2:119 build/C/man2/process_vm_readv.2:274 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:172 build/C/man2/tee.2:121 build/C/man2/vmsplice.2:145
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/get_robust_list.2:27
662 msgid "GET_ROBUST_LIST"
666 #: build/C/man2/get_robust_list.2:27
672 #: build/C/man2/get_robust_list.2:27
674 msgid "Linux System Calls"
678 #: build/C/man2/get_robust_list.2:30
679 msgid "get_robust_list, set_robust_list - get/set list of robust futexes"
683 #: build/C/man2/get_robust_list.2:34
686 "B<#include E<lt>linux/futex.hE<gt>>\n"
687 "B<#include E<lt>syscall.hE<gt>>\n"
691 #: build/C/man2/get_robust_list.2:38
694 "B<long get_robust_list(int >I<pid>B<, struct robust_list_head "
695 "**>I<head_ptr>B<,>\n"
696 "B<\t\t\t size_t *>I<len_ptr>B<);>\n"
697 "B<long set_robust_list(struct robust_list_head *>I<head>B<, size_t "
702 #: build/C/man2/get_robust_list.2:44
704 "The robust futex implementation needs to maintain per-thread lists of robust "
705 "futexes which are unlocked when the thread exits. These lists are managed "
706 "in user space; the kernel is only notified about the location of the head of "
711 #: build/C/man2/get_robust_list.2:60
713 "The B<get_robust_list>() system call returns the head of the robust futex "
714 "list of the thread whose thread ID is specified in I<pid>. If I<pid> is 0, "
715 "the head of the list for the calling thread is returned. The list head is "
716 "stored in the location pointed to by I<head_ptr>. The size of the object "
717 "pointed to by I<**head_ptr> is stored in I<len_ptr>."
721 #: build/C/man2/get_robust_list.2:72
723 "The B<set_robust_list>() system call requests the kernel to record the head "
724 "of the list of robust futexes owned by the calling thread. The I<head> "
725 "argument is the list head to record. The I<len> argument should be "
730 #: build/C/man2/get_robust_list.2:79
732 "The B<set_robust_list>() and B<get_robust_list>() system calls return zero "
733 "when the operation is successful, an error code otherwise."
737 #: build/C/man2/get_robust_list.2:83
738 msgid "The B<set_robust_list>() system call can fail with the following error:"
742 #: build/C/man2/get_robust_list.2:89
744 "I<len> does not match the size of structure B<struct robust_list_head> "
745 "expected by kernel."
749 #: build/C/man2/get_robust_list.2:93
750 msgid "The B<get_robust_list>() system call can fail with the following errors:"
754 #: build/C/man2/get_robust_list.2:101
756 "The calling process does not have permission to see the robust futex list of "
757 "the thread with the thread ID I<pid>, and does not have the "
758 "B<CAP_SYS_PTRACE> capability."
762 #: build/C/man2/get_robust_list.2:101 build/C/man2/process_vm_readv.2:269 build/C/man2/ptrace.2:1632 build/C/man2/quotactl.2:459 build/C/man2/quotactl.2:502
768 #: build/C/man2/get_robust_list.2:106
769 msgid "No thread with the thread ID I<pid> could be found."
773 #: build/C/man2/get_robust_list.2:110
774 msgid "The head of the robust futex list can't be stored at the location I<head>."
778 #: build/C/man2/get_robust_list.2:114
780 "These system calls were added in Linux 2.6.17. No library support is "
781 "provided; use B<syscall>(2)."
785 #: build/C/man2/get_robust_list.2:117
787 "These system calls are not needed by normal applications. No support for "
788 "them is provided in glibc."
792 #: build/C/man2/get_robust_list.2:121
794 "A thread can have only one robust futex list; therefore applications that "
795 "wish to use this functionality should use the robust mutexes provided by "
799 #. .BR pthread_mutexattr_setrobust_np (3)
801 #: build/C/man2/get_robust_list.2:124
805 #. http://lwn.net/Articles/172149/
807 #: build/C/man2/get_robust_list.2:130
809 "The kernel source files I<Documentation/robust-futexes.txt> and "
810 "I<Documentation/robust-futex-ABI.txt>."
814 #: build/C/man2/kexec_load.2:25
820 #: build/C/man2/kexec_load.2:25
826 #: build/C/man2/kexec_load.2:28
827 msgid "kexec_load - load a new kernel for later execution"
831 #: build/C/man2/kexec_load.2:30
832 msgid "B<#include E<lt>linux/kexec.hE<gt>>"
836 #: build/C/man2/kexec_load.2:32
838 "B<long kexec_load(unsigned long >I<entry>B<, unsigned long "
839 ">I<nr_segments>B<,>"
843 #: build/C/man2/kexec_load.2:35
844 msgid "B< struct kexec_segment *>I<segments>B<, unsigned long >I<flags>B<);>"
848 #: build/C/man2/kexec_load.2:40
850 "The B<kexec_load>() system call loads a new kernel that can be executed "
851 "later by B<reboot>(2)."
855 #: build/C/man2/kexec_load.2:46
857 "The I<flags> argument is a mask whose high-order bits control the operation "
858 "of the call. The following values can be specified in I<flags>:"
862 #: build/C/man2/kexec_load.2:46
864 msgid "B<KEXEC_ON_CRASH> (since Linux 2.6.13)"
867 #. FIXME figure out how this is really used
869 #: build/C/man2/kexec_load.2:50
870 msgid "Execute the new kernel automatically on a system crash."
874 #: build/C/man2/kexec_load.2:50
876 msgid "B<KEXEC_PRESERVE_CONTEXT> (since Linux 2.7.27)"
880 #: build/C/man2/kexec_load.2:60
882 "Preserve the system hardware and software states before executing the new "
883 "kernel. This could be used for system suspend. This flag is only available "
884 "if the kernel was configured with B<CONFIG_KEXEC_JUMP>, and is only "
885 "effective if I<nr_segments> is greater than 0."
889 #: build/C/man2/kexec_load.2:80
891 "The low-order bits of I<flags> contain the architecture of the "
892 "to-be-executed kernel. Specify (OR) the constant B<KEXEC_ARCH_DEFAULT> to "
893 "use the current architecture, or one of the following architecture constants "
894 "B<KEXEC_ARCH_386>, B<KEXEC_ARCH_X86_64>, B<KEXEC_ARCH_PPC>, "
895 "B<KEXEC_ARCH_PPC64>, B<KEXEC_ARCH_IA_64>, B<KEXEC_ARCH_ARM>, "
896 "B<KEXEC_ARCH_S390>, B<KEXEC_ARCH_SH>, B<KEXEC_ARCH_MIPS>, and "
897 "B<KEXEC_ARCH_MIPS_LE>. The architecture must be executable on the CPU of "
902 #: build/C/man2/kexec_load.2:94
904 "The I<entry> argument is the physical entry address in the kernel image. "
905 "The I<nr_segments> argument is the number of segments pointed to by the "
906 "I<segments> pointer. The I<segments> argument is an array of "
907 "I<kexec_segment> structures which define the kernel layout:"
911 #: build/C/man2/kexec_load.2:103
914 "struct kexec_segment {\n"
915 " void *buf; /* Buffer in user space */\n"
916 " size_t bufsz; /* Buffer length in user space */\n"
917 " void *mem; /* Physical address of kernel */\n"
918 " size_t memsz; /* Physical address length */\n"
922 #. FIXME elaborate on the following:
924 #: build/C/man2/kexec_load.2:110
926 "The kernel image defined by I<segments> is copied from the calling process "
927 "into previously reserved memory."
931 #: build/C/man2/kexec_load.2:117
933 "On success, B<kexec_load>() returns 0. On error, -1 is returned and "
934 "I<errno> is set to indicate the error."
938 #: build/C/man2/kexec_load.2:118 build/C/man2/pivot_root.2:104 build/C/man2/ptrace.2:1595 build/C/man2/quotactl.2:493
944 #: build/C/man2/kexec_load.2:122
946 "Another crash kernel is already being loaded or a crash kernel is already in "
950 #. KEXEC_SEGMENT_MAX == 16
952 #: build/C/man2/kexec_load.2:129
953 msgid "I<flags> is invalid; or I<nr_segments> is too large"
957 #: build/C/man2/kexec_load.2:134
958 msgid "The caller does not have the B<CAP_SYS_BOOT> capability."
962 #: build/C/man2/kexec_load.2:138
963 msgid "The B<kexec_load>() system call first appeared in Linux 2.6.13."
967 #: build/C/man2/kexec_load.2:145
969 "Currently, there is no glibc support for B<kexec_load>(). Call it using "
973 #. FIXME Andi submitted a patch for this.
974 #. Check if it got accepted later.
976 #: build/C/man2/kexec_load.2:152
978 "The required constants are in the kernel source file I<linux/kexec.h>, which "
979 "is not currently exported to glibc. Therefore, these constants must be "
984 #: build/C/man2/kexec_load.2:155
986 "This system call is only available if the kernel was configured with "
991 #: build/C/man2/kexec_load.2:158
992 msgid "B<reboot>(2), B<syscall>(2)"
996 #: build/C/man2/lookup_dcookie.2:27
998 msgid "LOOKUP_DCOOKIE"
1002 #: build/C/man2/lookup_dcookie.2:27
1008 #: build/C/man2/lookup_dcookie.2:30
1009 msgid "lookup_dcookie - return a directory entry's path"
1013 #: build/C/man2/lookup_dcookie.2:32
1015 "B<int lookup_dcookie(u64 >I<cookie>B<, char *>I<buffer>B<, size_t "
1020 #: build/C/man2/lookup_dcookie.2:38
1022 "Look up the full path of the directory entry specified by the value "
1023 "I<cookie>. The cookie is an opaque identifier uniquely identifying a "
1024 "particular directory entry. The buffer given is filled in with the full "
1025 "path of the directory entry."
1029 #: build/C/man2/lookup_dcookie.2:43
1031 "For B<lookup_dcookie>() to return successfully, the kernel must still hold "
1032 "a cookie reference to the directory entry."
1036 #: build/C/man2/lookup_dcookie.2:50
1038 "On success, B<lookup_dcookie>() returns the length of the path string "
1039 "copied into the buffer. On error, -1 is returned, and I<errno> is set "
1044 #: build/C/man2/lookup_dcookie.2:54
1045 msgid "The buffer was not valid."
1049 #: build/C/man2/lookup_dcookie.2:58
1051 "The kernel has no registered cookie/directory entry mappings at the time of "
1052 "lookup, or the cookie does not refer to a valid directory entry."
1056 #: build/C/man2/lookup_dcookie.2:58
1058 msgid "B<ENAMETOOLONG>"
1062 #: build/C/man2/lookup_dcookie.2:61
1063 msgid "The name could not fit in the buffer."
1067 #: build/C/man2/lookup_dcookie.2:61 build/C/man2/process_vm_readv.2:260 build/C/man2/sendfile.2:134 build/C/man2/splice.2:155 build/C/man2/tee.2:111 build/C/man2/vmsplice.2:135
1073 #: build/C/man2/lookup_dcookie.2:65
1075 "The kernel could not allocate memory for the temporary buffer holding the "
1080 #: build/C/man2/lookup_dcookie.2:70
1082 "The process does not have the capability B<CAP_SYS_ADMIN> required to look "
1087 #: build/C/man2/lookup_dcookie.2:70 build/C/man2/quotactl.2:472
1093 #: build/C/man2/lookup_dcookie.2:73
1094 msgid "The buffer was not large enough to hold the path of the directory entry."
1098 #: build/C/man2/lookup_dcookie.2:78
1100 "Available since Linux 2.5.43. The B<ENAMETOOLONG> error return was added in "
1105 #: build/C/man2/lookup_dcookie.2:81
1106 msgid "B<lookup_dcookie>() is Linux-specific."
1110 #: build/C/man2/lookup_dcookie.2:85
1112 "B<lookup_dcookie>() is a special-purpose system call, currently used only "
1113 "by the oprofile profiler. It relies on a kernel driver to register cookies "
1114 "for directory entries."
1118 #: build/C/man2/lookup_dcookie.2:88
1120 "The path returned may be suffixed by the string \" (deleted)\" if the "
1121 "directory entry has been removed."
1125 #: build/C/man2/modify_ldt.2:25
1131 #: build/C/man2/modify_ldt.2:25 build/C/man2/pivot_root.2:7
1137 #: build/C/man2/modify_ldt.2:28
1138 msgid "modify_ldt - get or set ldt"
1142 #: build/C/man2/modify_ldt.2:31
1144 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
1148 #: build/C/man2/modify_ldt.2:33
1151 "B<int modify_ldt(int >I<func>B<, void *>I<ptr>B<, unsigned long "
1152 ">I<bytecount>B<);>\n"
1156 #: build/C/man2/modify_ldt.2:39
1158 "B<modify_ldt>() reads or writes the local descriptor table (ldt) for a "
1159 "process. The ldt is a per-process memory management table used by the i386 "
1160 "processor. For more information on this table, see an Intel 386 processor "
1165 #: build/C/man2/modify_ldt.2:49
1167 "When I<func> is 0, B<modify_ldt>() reads the ldt into the memory pointed to "
1168 "by I<ptr>. The number of bytes read is the smaller of I<bytecount> and the "
1169 "actual size of the ldt."
1173 #. FIXME ? say something about func == 2 and func == 0x11?
1174 #. In Linux 2.4, func == 2 returned "the default ldt"
1175 #. In Linux 2.6, func == 2 is a nop, returning a zeroed out structure.
1176 #. Linux 2.4 and 2.6 implement an operation for func == 0x11
1178 #: build/C/man2/modify_ldt.2:67
1180 "When I<func> is 1, B<modify_ldt>() modifies one ldt entry. I<ptr> points "
1181 "to a I<user_desc> structure and I<bytecount> must equal the size of this "
1186 #: build/C/man2/modify_ldt.2:71
1187 msgid "The I<user_desc> structure is defined in I<E<lt>asm/ldt.hE<gt>> as:"
1191 #: build/C/man2/modify_ldt.2:85
1194 "struct user_desc {\n"
1195 " unsigned int entry_number;\n"
1196 " unsigned long base_addr;\n"
1197 " unsigned int limit;\n"
1198 " unsigned int seg_32bit:1;\n"
1199 " unsigned int contents:2;\n"
1200 " unsigned int read_exec_only:1;\n"
1201 " unsigned int limit_in_pages:1;\n"
1202 " unsigned int seg_not_present:1;\n"
1203 " unsigned int useable:1;\n"
1208 #. The ldt is specific for the calling process. Any attempts to change
1209 #. the ldt to include the address space of another process or the kernel
1210 #. will result in a segmentation violation when trying to access the memory
1211 #. outside of the process address space. The memory protection is enforced
1212 #. at the paging layer.
1214 #: build/C/man2/modify_ldt.2:96
1215 msgid "In Linux 2.4 and earlier, this structure was named I<modify_ldt_ldt_s>."
1219 #: build/C/man2/modify_ldt.2:106
1221 "On success, B<modify_ldt>() returns either the actual number of bytes read "
1222 "(for reading) or 0 (for writing). On failure, B<modify_ldt>() returns -1 "
1223 "and sets I<errno> to indicate the error."
1227 #: build/C/man2/modify_ldt.2:111
1228 msgid "I<ptr> points outside the address space."
1232 #: build/C/man2/modify_ldt.2:124
1234 "I<ptr> is 0, or I<func> is 1 and I<bytecount> is not equal to the size of "
1235 "the structure I<modify_ldt_ldt_s>, or I<func> is 1 and the new ldt entry has "
1240 #: build/C/man2/modify_ldt.2:128
1241 msgid "I<func> is neither 0 nor 1."
1245 #: build/C/man2/modify_ldt.2:131
1247 "This call is Linux-specific and should not be used in programs intended to "
1252 #: build/C/man2/modify_ldt.2:134 build/C/man2/pivot_root.2:128
1254 "Glibc does not provide a wrapper for this system call; call it using "
1259 #: build/C/man2/modify_ldt.2:136
1264 #: build/C/man2/nfsservctl.2:8
1270 #: build/C/man2/nfsservctl.2:8
1276 #: build/C/man2/nfsservctl.2:11
1277 msgid "nfsservctl - syscall interface to kernel nfs daemon"
1281 #: build/C/man2/nfsservctl.2:14
1283 msgid "B<#include E<lt>linux/nfsd/syscall.hE<gt>>\n"
1287 #: build/C/man2/nfsservctl.2:17
1290 "B<long nfsservctl(int >I<cmd>B<, struct nfsctl_arg *>I<argp>B<,>\n"
1291 "B< union nfsctl_res *>I<resp>B<);>\n"
1295 #: build/C/man2/nfsservctl.2:21
1296 msgid "I<Note>: Since Linux 3.1, this system call no longer exists."
1300 #: build/C/man2/nfsservctl.2:33
1304 " * These are the commands understood by nfsctl().\n"
1306 "#define NFSCTL_SVC 0 /* This is a server process. */\n"
1307 "#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */\n"
1308 "#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */\n"
1309 "#define NFSCTL_EXPORT 3 /* export a file system. */\n"
1310 "#define NFSCTL_UNEXPORT 4 /* unexport a file system. */\n"
1311 "#define NFSCTL_UGIDUPDATE 5 /* update a client's UID/GID map. */\n"
1312 "#define NFSCTL_GETFH 6 /* get an fh (used by mountd) */\n"
1316 #: build/C/man2/nfsservctl.2:45
1319 "struct nfsctl_arg {\n"
1320 " int ca_version; /* safeguard */\n"
1322 " struct nfsctl_svc u_svc;\n"
1323 " struct nfsctl_client u_client;\n"
1324 " struct nfsctl_export u_export;\n"
1325 " struct nfsctl_uidmap u_umap;\n"
1326 " struct nfsctl_fhparm u_getfh;\n"
1327 " unsigned int u_debug;\n"
1333 #: build/C/man2/nfsservctl.2:50
1336 "union nfsctl_res {\n"
1337 " struct knfs_fh cr_getfh;\n"
1338 " unsigned int cr_debug;\n"
1343 #: build/C/man2/nfsservctl.2:56 build/C/man2/pivot_root.2:99 build/C/man2/vm86.2:57
1345 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
1350 #: build/C/man2/nfsservctl.2:58
1351 msgid "This call is Linux-specific."
1355 #: build/C/man2/outb.2:28
1361 #: build/C/man2/outb.2:28
1367 #: build/C/man2/outb.2:33
1369 "outb, outw, outl, outsb, outsw, outsl, inb, inw, inl, insb, insw, insl, "
1370 "outb_p, outw_p, outl_p, inb_p, inw_p, inl_p - port I/O"
1374 #: build/C/man2/outb.2:38
1376 "This family of functions is used to do low-level port input and output. The "
1377 "out* functions do port output, the in* functions do port input; the b-suffix "
1378 "functions are byte-width and the w-suffix functions word-width; the "
1379 "_p-suffix functions pause until the I/O completes."
1382 #. , given the following information
1383 #. in addition to that given in
1386 #: build/C/man2/outb.2:44
1388 "They are primarily designed for internal kernel use, but can be used from "
1393 #: build/C/man2/outb.2:49
1395 "You compile with B<-O> or B<-O2> or similar. The functions are defined as "
1396 "inline macros, and will not be substituted in without optimization enabled, "
1397 "causing unresolved references at link time."
1401 #: build/C/man2/outb.2:58
1403 "You use B<ioperm>(2) or alternatively B<iopl>(2) to tell the kernel to "
1404 "allow the user space application to access the I/O ports in question. "
1405 "Failure to do this will cause the application to receive a segmentation "
1410 #: build/C/man2/outb.2:67
1412 "B<outb>() and friends are hardware-specific. The I<value> argument is "
1413 "passed first and the I<port> argument is passed second, which is the "
1414 "opposite order from most DOS implementations."
1418 #: build/C/man2/outb.2:70
1419 msgid "B<ioperm>(2), B<iopl>(2)"
1423 #: build/C/man2/pciconfig_read.2:5
1425 msgid "PCICONFIG_READ"
1429 #: build/C/man2/pciconfig_read.2:5
1435 #: build/C/man2/pciconfig_read.2:8
1437 "pciconfig_read, pciconfig_write, pciconfig_iobase - pci device information "
1442 #: build/C/man2/pciconfig_read.2:11
1444 msgid "B<#include E<lt>pci.hE<gt>>\n"
1448 #: build/C/man2/pciconfig_read.2:18
1451 "B<int pciconfig_read(unsigned long >I<bus>B<, unsigned long >I<dfn>B<,>\n"
1452 "B< unsigned long >I<off>B<, unsigned long >I<len>B<, void "
1454 "B<int pciconfig_write(unsigned long >I<bus>B<, unsigned long >I<dfn>B<,>\n"
1455 "B< unsigned long >I<off>B<, unsigned long >I<len>B<, void "
1457 "B<int pciconfig_iobase(long >I<which>B<, unsigned long >I<bus>B<,>\n"
1458 "B< unsigned long >I<devfn>B<);>\n"
1462 #: build/C/man2/pciconfig_read.2:24
1464 "Most of the interaction with PCI devices is already handled by the kernel "
1465 "PCI layer, and thus these calls should not normally need to be accessed from "
1470 #: build/C/man2/pciconfig_read.2:24 build/C/man2/pciconfig_read.2:48
1472 msgid "B<pciconfig_read>()"
1476 #: build/C/man2/pciconfig_read.2:33
1477 msgid "Reads to I<buf> from device I<dev> at offset I<off> value."
1481 #: build/C/man2/pciconfig_read.2:33 build/C/man2/pciconfig_read.2:54
1483 msgid "B<pciconfig_write>()"
1487 #: build/C/man2/pciconfig_read.2:42
1488 msgid "Writes from I<buf> to device I<dev> at offset I<off> value."
1492 #: build/C/man2/pciconfig_read.2:42 build/C/man2/pciconfig_read.2:60
1494 msgid "B<pciconfig_iobase>()"
1498 #: build/C/man2/pciconfig_read.2:47
1500 "You pass it a bus/devfn pair and get a physical address for either the "
1501 "memory offset (for things like prep, this is 0xc0000000), the IO base for "
1502 "PIO cycles, or the ISA holes if any."
1506 #: build/C/man2/pciconfig_read.2:54 build/C/man2/pciconfig_read.2:60
1508 "On success zero is returned. On error, -1 is returned and I<errno> is set "
1513 #: build/C/man2/pciconfig_read.2:74
1515 "Returns information on locations of various I/O regions in physical memory "
1516 "according to the I<which> value. Values for I<which> are: "
1517 "B<IOBASE_BRIDGE_NUMBER>, B<IOBASE_MEMORY>, B<IOBASE_IO>, B<IOBASE_ISA_IO>, "
1518 "B<IOBASE_ISA_MEM>."
1522 #: build/C/man2/pciconfig_read.2:81
1523 msgid "I<len> value is invalid. This does not apply to B<pciconfig_iobase>()."
1527 #: build/C/man2/pciconfig_read.2:81 build/C/man2/ptrace.2:1612 build/C/man2/sendfile.2:130
1533 #: build/C/man2/pciconfig_read.2:84
1538 #: build/C/man2/pciconfig_read.2:84
1544 #: build/C/man2/pciconfig_read.2:90
1546 "For B<pciconfig_iobase>(), \"hose\" value is NULL. For the other calls, "
1547 "could not find a slot."
1551 #: build/C/man2/pciconfig_read.2:95
1552 msgid "The system has not implemented these calls (B<CONFIG_PCI> not defined)."
1556 #: build/C/man2/pciconfig_read.2:95
1558 msgid "B<EOPNOTSUPP>"
1562 #: build/C/man2/pciconfig_read.2:102
1564 "This return value is only valid for B<pciconfig_iobase>(). It is returned "
1565 "if the value for I<which> is invalid."
1569 #: build/C/man2/pciconfig_read.2:107
1571 "User does not have the B<CAP_SYS_ADMIN> capability. This does not apply to "
1572 "B<pciconfig_iobase>()."
1576 #: build/C/man2/pciconfig_read.2:109
1577 msgid "These calls are Linux-specific, available since Linux 2.0.26/2.1.11."
1581 #: build/C/man2/pciconfig_read.2:111
1582 msgid "B<capabilities>(7)"
1586 #: build/C/man2/personality.2:30
1592 #: build/C/man2/personality.2:30
1598 #: build/C/man2/personality.2:33
1599 msgid "personality - set the process execution domain"
1603 #: build/C/man2/personality.2:35
1604 msgid "B<#include E<lt>sys/personality.hE<gt>>"
1608 #: build/C/man2/personality.2:37
1609 msgid "B<int personality(unsigned long >I<persona>B<);>"
1613 #: build/C/man2/personality.2:45
1615 "Linux supports different execution domains, or personalities, for each "
1616 "process. Among other things, execution domains tell Linux how to map signal "
1617 "numbers into signal actions. The execution domain system allows Linux to "
1618 "provide limited support for binaries compiled under other UNIX-like "
1619 "operating systems."
1623 #: build/C/man2/personality.2:55
1625 "This function will return the current B<personality>() when I<persona> "
1626 "equals 0xffffffff. Otherwise, it will make the execution domain referenced "
1627 "by I<persona> the new execution domain of the calling process."
1631 #: build/C/man2/personality.2:62
1633 "On success, the previous I<persona> is returned. On error, -1 is returned, "
1634 "and I<errno> is set appropriately."
1638 #: build/C/man2/personality.2:66
1639 msgid "The kernel was unable to change the personality."
1643 #: build/C/man2/personality.2:70
1645 "B<personality>() is Linux-specific and should not be used in programs "
1646 "intended to be portable."
1650 #: build/C/man2/pivot_root.2:7
1656 #: build/C/man2/pivot_root.2:10
1657 msgid "pivot_root - change the root file system"
1661 #: build/C/man2/pivot_root.2:12
1662 msgid "B<int pivot_root(const char *>I<new_root>B<, const char *>I<put_old>B<);>"
1668 #. capability is required.
1670 #: build/C/man2/pivot_root.2:21
1672 "B<pivot_root>() moves the root file system of the calling process to the "
1673 "directory I<put_old> and makes I<new_root> the new root file system of the "
1678 #: build/C/man2/pivot_root.2:28
1680 "The typical use of B<pivot_root>() is during system startup, when the "
1681 "system mounts a temporary root file system (e.g., an B<initrd>), then mounts "
1682 "the real root file system, and eventually turns the latter into the current "
1683 "root of all relevant processes or threads."
1687 #: build/C/man2/pivot_root.2:40
1689 "B<pivot_root>() may or may not change the current root and the current "
1690 "working directory of any processes or threads which use the old root "
1691 "directory. The caller of B<pivot_root>() must ensure that processes with "
1692 "root or current working directory at the old root operate correctly in "
1693 "either case. An easy way to ensure this is to change their root and current "
1694 "working directory to I<new_root> before invoking B<pivot_root>()."
1698 #: build/C/man2/pivot_root.2:58
1700 "The paragraph above is intentionally vague because the implementation of "
1701 "B<pivot_root>() may change in the future. At the time of writing, "
1702 "B<pivot_root>() changes root and current working directory of each process "
1703 "or thread to I<new_root> if they point to the old root directory. This is "
1704 "necessary in order to prevent kernel threads from keeping the old root "
1705 "directory busy with their root and current working directory, even if they "
1706 "never access the file system in any way. In the future, there may be a "
1707 "mechanism for kernel threads to explicitly relinquish any access to the file "
1708 "system, such that this fairly intrusive mechanism can be removed from "
1713 #: build/C/man2/pivot_root.2:66
1715 "Note that this also applies to the calling process: B<pivot_root>() may or "
1716 "may not affect its current working directory. It is therefore recommended "
1717 "to call B<chdir(\"/\")> immediately after B<pivot_root>()."
1721 #: build/C/man2/pivot_root.2:68
1722 msgid "The following restrictions apply to I<new_root> and I<put_old>:"
1726 #: 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
1732 #: build/C/man2/pivot_root.2:70
1733 msgid "They must be directories."
1737 #: build/C/man2/pivot_root.2:73
1739 "I<new_root> and I<put_old> must not be on the same file system as the "
1744 #: build/C/man2/pivot_root.2:77
1746 "I<put_old> must be underneath I<new_root>, that is, adding a nonzero number "
1747 "of I</..> to the string pointed to by I<put_old> must yield the same "
1748 "directory as I<new_root>."
1752 #: build/C/man2/pivot_root.2:79
1753 msgid "No other file system may be mounted on I<put_old>."
1757 #: build/C/man2/pivot_root.2:83
1758 msgid "See also B<pivot_root>(8) for additional usage examples."
1762 #: build/C/man2/pivot_root.2:90
1764 "If the current root is not a mount point (e.g., after B<chroot>(2) or "
1765 "B<pivot_root>(), see also below), not the old root directory, but the mount "
1766 "point of that file system is mounted on I<put_old>."
1770 #: build/C/man2/pivot_root.2:95
1772 "I<new_root> does not have to be a mount point. In this case, "
1773 "I</proc/mounts> will show the mount point of the file system containing "
1774 "I<new_root> as root (I</>)."
1778 #: build/C/man2/pivot_root.2:104
1780 "B<pivot_root>() may return (in I<errno>) any of the errors returned by "
1781 "B<stat>(2). Additionally, it may return:"
1785 #: build/C/man2/pivot_root.2:108
1787 "I<new_root> or I<put_old> are on the current root file system, or a file "
1788 "system is already mounted on I<put_old>."
1792 #: build/C/man2/pivot_root.2:111
1793 msgid "I<put_old> is not underneath I<new_root>."
1797 #: build/C/man2/pivot_root.2:111
1803 #: build/C/man2/pivot_root.2:114
1804 msgid "I<new_root> or I<put_old> is not a directory."
1808 #: build/C/man2/pivot_root.2:119
1809 msgid "The calling process does not have the B<CAP_SYS_ADMIN> capability."
1813 #: build/C/man2/pivot_root.2:122
1814 msgid "B<pivot_root>() was introduced in Linux 2.3.41."
1818 #: build/C/man2/pivot_root.2:125
1819 msgid "B<pivot_root>() is Linux-specific and hence is not portable."
1823 #: build/C/man2/pivot_root.2:128 build/C/man2/ptrace.2:1675
1829 #: build/C/man2/pivot_root.2:132
1831 "B<pivot_root>() should not have to change root and current working "
1832 "directory of all other processes in the system."
1836 #: build/C/man2/pivot_root.2:137
1838 "Some of the more obscure uses of B<pivot_root>() may quickly lead to "
1843 #: build/C/man2/pivot_root.2:143
1844 msgid "B<chdir>(2), B<chroot>(2), B<stat>(2), B<initrd>(4), B<pivot_root>(8)"
1848 #: build/C/man2/process_vm_readv.2:27
1850 msgid "PROCESS_VM_READV"
1854 #: build/C/man2/process_vm_readv.2:27
1860 #: build/C/man2/process_vm_readv.2:30
1862 "process_vm_readv, process_vm_writev - transfer data between process address "
1867 #: build/C/man2/process_vm_readv.2:33
1869 msgid "B<#include E<lt>sys/uio.hE<gt>>\n"
1873 #: build/C/man2/process_vm_readv.2:40
1876 "B<ssize_t process_vm_readv(pid_t >I<pid>B<,>\n"
1877 "B< const struct iovec *>I<local_iov>B<,>\n"
1878 "B< unsigned long >I<liovcnt>B<,>\n"
1879 "B< const struct iovec *>I<remote_iov>B<,>\n"
1880 "B< unsigned long >I<riovcnt>B<,>\n"
1881 "B< unsigned long >I<flags>B<);>\n"
1885 #: build/C/man2/process_vm_readv.2:47
1888 "B<ssize_t process_vm_writev(pid_t >I<pid>B<,>\n"
1889 "B< const struct iovec *>I<local_iov>B<,>\n"
1890 "B< unsigned long >I<liovcnt>B<,>\n"
1891 "B< const struct iovec *>I<remote_iov>B<,>\n"
1892 "B< unsigned long >I<riovcnt>B<,>\n"
1893 "B< unsigned long >I<flags>B<);>\n"
1897 #: build/C/man2/process_vm_readv.2:55
1899 "These system calls transfer data between the address space of the calling "
1900 "process (\"the local process\") and the process identified by I<pid> (\"the "
1901 "remote process\"). The data moves directly between the address spaces of "
1902 "the two processes, without passing through kernel space."
1906 #: build/C/man2/process_vm_readv.2:80
1908 "The B<process_vm_readv>() system call transfers data from the remote "
1909 "process to the local process. The data to be transferred is identified by "
1910 "I<remote_iov> and I<riovcnt>: I<remote_iov> is a pointer to an array "
1911 "describing address ranges in the process I<pid>, and I<riovcnt> specifies "
1912 "the number of elements in I<remote_iov>. The data is transferred to the "
1913 "locations specified by I<local_iov> and I<liovcnt>: I<local_iov> is a "
1914 "pointer to an array describing address ranges in the calling process, and "
1915 "I<liovcnt> specifies the number of elements in I<local_iov>."
1919 #: build/C/man2/process_vm_readv.2:94
1921 "The B<process_vm_writev>() system call is the converse of "
1922 "B<process_vm_readv>()\\(emit transfers data from the local process to the "
1923 "remote process. Other than the direction of the transfer, the arguments "
1924 "I<liovcnt>, I<local_iov>, I<riovcnt>, and I<remote_iov> have the same "
1925 "meaning as for B<process_vm_readv>()."
1929 #: build/C/man2/process_vm_readv.2:104
1931 "The I<local_iov> and I<remote_iov> arguments point to an array of I<iovec> "
1932 "structures, defined in I<E<lt>sys/uio.hE<gt>> as:"
1936 #: build/C/man2/process_vm_readv.2:111
1940 " void *iov_base; /* Starting address */\n"
1941 " size_t iov_len; /* Number of bytes to transfer */\n"
1946 #: build/C/man2/process_vm_readv.2:127
1948 "Buffers are processed in array order. This means that B<process_vm_readv>() "
1949 "completely fills I<local_iov[0]> before proceeding to I<local_iov[1]>, and "
1950 "so on. Likewise, I<remote_iov[0]> is completely read before proceeding to "
1951 "I<remote_iov[1]>, and so on."
1955 #: build/C/man2/process_vm_readv.2:138
1957 "Similarly, B<process_vm_writev>() writes out the entire contents of "
1958 "I<local_iov[0]> before proceeding to I<local_iov[1]>, and it completely "
1959 "fills I<remote_iov[0]> before proceeding to I<remote_iov[1]>."
1963 #: build/C/man2/process_vm_readv.2:146
1965 "The lengths of I<remote_iov[i].iov_len> and I<local_iov[i].iov_len> do not "
1966 "have to be the same. Thus, it is possible to split a single local buffer "
1967 "into multiple remote buffers, or vice versa."
1971 #: build/C/man2/process_vm_readv.2:150
1972 msgid "The I<flags> argument is currently unused and must be set to 0."
1975 #. In time, glibc might provide a wrapper that works around this limit,
1976 #. as is done for readv()/writev()
1978 #: build/C/man2/process_vm_readv.2:163
1980 "The values specified in the I<liovcnt> and I<riovcnt> arguments must be less "
1981 "than or equal to B<IOV_MAX> (defined in I<E<lt>limits.hE<gt>> or accessible "
1982 "via the call I<sysconf(_SC_IOV_MAX)>)."
1986 #: build/C/man2/process_vm_readv.2:173
1988 "The count arguments and I<local_iov> are checked before doing any "
1989 "transfers. If the counts are too big, or I<local_iov> is invalid, or the "
1990 "addresses refer to regions that are inaccessible to the local process, none "
1991 "of the vectors will be processed and an error will be returned immediately."
1995 #: build/C/man2/process_vm_readv.2:193
1997 "Note, however, that these system calls do not check the memory regions in "
1998 "the remote process until just before doing the read/write. Consequently, a "
1999 "partial read/write (see RETURN VALUE) may result if one of the "
2000 "I<remote_iov> elements points to an invalid memory region in the remote "
2001 "process. No further reads/writes will be attempted beyond that point. Keep "
2002 "this in mind when attempting to read data of unknown length (such as C "
2003 "strings that are null-terminated) from a remote process, by avoiding "
2004 "spanning memory pages (typically 4KiB) in a single remote I<iovec> element. "
2005 "(Instead, split the remote read into two I<remote_iov> elements and have "
2006 "them merge back into a single write I<local_iov> entry. The first read "
2007 "entry goes up to the page boundary, while the second starts on the next page "
2012 #: build/C/man2/process_vm_readv.2:207
2014 "In order to read from or write to another process, either the caller must "
2015 "have the capability B<CAP_SYS_PTRACE>, or the real user ID, effective user "
2016 "ID, and saved set-user-ID of the remote process must match the real user ID "
2017 "of the caller I<and> the real group ID, effective group ID, and saved "
2018 "set-group-ID of the remote process must match the real group ID of the "
2019 "caller. (The permission required is exactly the same as that required to "
2020 "perform a B<ptrace>(2) B<PTRACE_ATTACH> on the remote process.)"
2024 #: build/C/man2/process_vm_readv.2:223
2026 "On success, B<process_vm_readv>() returns the number of bytes read and "
2027 "B<process_vm_writev>() returns the number of bytes written. This return "
2028 "value may be less than the total number of requested bytes, if a partial "
2029 "read/write occurred. (Partial transfers apply at the granularity of "
2030 "I<iovec> elements. These system calls won't perform a partial transfer that "
2031 "splits a single I<iovec> element.) The caller should check the return value "
2032 "to determine whether a partial read/write occurred."
2036 #: build/C/man2/process_vm_readv.2:227
2037 msgid "On error, -1 is returned and I<errno> is set appropriately."
2041 #: build/C/man2/process_vm_readv.2:239
2043 "The sum of the I<iov_len> values of either I<local_iov> or I<remote_iov> "
2044 "overflows a I<ssize_t> value."
2048 #: build/C/man2/process_vm_readv.2:243
2049 msgid "I<flags> is not 0."
2053 #: build/C/man2/process_vm_readv.2:249
2054 msgid "I<liovcnt> or I<riovcnt> is too large."
2058 #: build/C/man2/process_vm_readv.2:254
2060 "The memory described by I<local_iov> is outside the caller's accessible "
2065 #: build/C/man2/process_vm_readv.2:260
2067 "The memory described by I<remote_iov> is outside the accessible address "
2068 "space of the process I<pid>."
2072 #: build/C/man2/process_vm_readv.2:265
2073 msgid "Could not allocate memory for internal copies of the I<iovec> structures."
2077 #: build/C/man2/process_vm_readv.2:269
2079 "The caller does not have permission to access the address space of the "
2084 #: build/C/man2/process_vm_readv.2:274
2085 msgid "No process with ID I<pid> exists."
2089 #: build/C/man2/process_vm_readv.2:277
2091 "These system calls were added in Linux 3.2. Support is provided in glibc "
2092 "since version 2.15."
2096 #: build/C/man2/process_vm_readv.2:279
2097 msgid "These system calls are nonstandard Linux extensions."
2101 #: build/C/man2/process_vm_readv.2:285
2103 "The data transfers performed by B<process_vm_readv>() and "
2104 "B<process_vm_writev>() are not guaranteed to be atomic in any way."
2107 #. Original user is MPI, http://www.mcs.anl.gov/research/projects/mpi/
2108 #. See also some benchmarks at http://lwn.net/Articles/405284/
2109 #. and http://marc.info/?l=linux-mm&m=130105930902915&w=2
2111 #: build/C/man2/process_vm_readv.2:293
2113 "These system calls were designed to permit fast message passing by allowing "
2114 "messages to be exchanged with a single copy operation (rather than the "
2115 "double copy that would be required when using, for example, shared memory or "
2120 #: build/C/man2/process_vm_readv.2:293 build/C/man2/splice.2:223 build/C/man2/tee.2:130
2126 #: build/C/man2/process_vm_readv.2:301
2128 "The following code sample demonstrates the use of B<process_vm_readv>(). It "
2129 "reads 20 bytes at the address 0x10000 from the process with PID 10 and "
2130 "writes the first 10 bytes into I<buf1> and the second 10 bytes into I<buf2>."
2134 #: build/C/man2/process_vm_readv.2:304
2136 msgid "#include E<lt>sys/uio.hE<gt>\n"
2140 #: build/C/man2/process_vm_readv.2:314
2146 " struct iovec local[2];\n"
2147 " struct iovec remote[1];\n"
2151 " pid_t pid = 10; /* PID of remote process */\n"
2155 #: build/C/man2/process_vm_readv.2:321
2158 " local[0].iov_base = buf1;\n"
2159 " local[0].iov_len = 10;\n"
2160 " local[1].iov_base = buf2;\n"
2161 " local[1].iov_len = 10;\n"
2162 " remote[0].iov_base = (void *) 0x10000;\n"
2163 " remote[1].iov_len = 20;\n"
2167 #: build/C/man2/process_vm_readv.2:328
2170 " nread = process_vm_readv(pid, local, 2, remote, 1, 0);\n"
2171 " if (nread != 20)\n"
2179 #: build/C/man2/process_vm_readv.2:332
2180 msgid "B<readv>(2), B<writev>(2)"
2184 #: build/C/man2/ptrace.2:49
2190 #: build/C/man2/ptrace.2:49
2196 #: build/C/man2/ptrace.2:52
2197 msgid "ptrace - process trace"
2201 #: build/C/man2/ptrace.2:55
2203 msgid "B<#include E<lt>sys/ptrace.hE<gt>>\n"
2207 #: build/C/man2/ptrace.2:58
2210 "B<long ptrace(enum __ptrace_request >I<request>B<, pid_t >I<pid>B<, >\n"
2211 "B< void *>I<addr>B<, void *>I<data>B<);>\n"
2215 #: build/C/man2/ptrace.2:67
2217 "The B<ptrace>() system call provides a means by which one process (the "
2218 "\"tracer\") may observe and control the execution of another process (the "
2219 "\"tracee\"), and examine and change the tracee's memory and registers. It "
2220 "is primarily used to implement breakpoint debugging and system call tracing."
2224 #: build/C/man2/ptrace.2:78
2226 "A tracee first needs to be attached to the tracer. Attachment and "
2227 "subsequent commands are per thread: in a multithreaded process, every thread "
2228 "can be individually attached to a (potentially different) tracer, or left "
2229 "not attached and thus not debugged. Therefore, \"tracee\" always means "
2230 "\"(one) thread\", never \"a (possibly multithreaded) process\". Ptrace "
2231 "commands are always sent to a specific tracee using a call of the form"
2235 #: build/C/man2/ptrace.2:80
2237 msgid " ptrace(PTRACE_foo, pid, ...)\n"
2241 #: build/C/man2/ptrace.2:84
2242 msgid "where I<pid> is the thread ID of the corresponding Linux thread."
2246 #: build/C/man2/ptrace.2:90
2248 "(Note that in this page, a \"multithreaded process\" means a thread group "
2249 "consisting of threads created using the B<clone>(2) B<CLONE_THREAD> flag.)"
2253 #: build/C/man2/ptrace.2:99
2255 "A process can initiate a trace by calling B<fork>(2) and having the "
2256 "resulting child do a B<PTRACE_TRACEME>, followed (typically) by an "
2257 "B<execve>(2). Alternatively, one process may commence tracing another "
2258 "process using B<PTRACE_ATTACH>."
2262 #: build/C/man2/ptrace.2:116
2264 "While being traced, the tracee will stop each time a signal is delivered, "
2265 "even if the signal is being ignored. (An exception is B<SIGKILL>, which has "
2266 "its usual effect.) The tracer will be notified at its next call to "
2267 "B<waitpid>(2) (or one of the related \"wait\" system calls); that call will "
2268 "return a I<status> value containing information that indicates the cause of "
2269 "the stop in the tracee. While the tracee is stopped, the tracer can use "
2270 "various ptrace requests to inspect and modify the tracee. The tracer then "
2271 "causes the tracee to continue, optionally ignoring the delivered signal (or "
2272 "even delivering a different signal instead)."
2276 #: build/C/man2/ptrace.2:126
2278 "If the B<PTRACE_O_TRACEEXEC> option is not in effect, all successful calls "
2279 "to B<execve>(2) by the traced process will cause it to be sent a B<SIGTRAP> "
2280 "signal, giving the parent a chance to gain control before the new program "
2285 #: build/C/man2/ptrace.2:130
2287 "When the tracer is finished tracing, it can cause the tracee to continue "
2288 "executing in a normal, untraced mode via B<PTRACE_DETACH>."
2292 #: build/C/man2/ptrace.2:134
2293 msgid "The value of I<request> determines the action to be performed:"
2297 #: build/C/man2/ptrace.2:134
2299 msgid "B<PTRACE_TRACEME>"
2303 #: build/C/man2/ptrace.2:144
2305 "Indicate that this process is to be traced by its parent. A process "
2306 "probably shouldn't make this request if its parent isn't expecting to trace "
2307 "it. (I<pid>, I<addr>, and I<data> are ignored.)"
2311 #: build/C/man2/ptrace.2:157
2313 "The B<PTRACE_TRACEME> request is used only by the tracee; the remaining "
2314 "requests are used only by the tracer. In the following requests, I<pid> "
2315 "specifies the thread ID of the tracee to be acted on. For requests other "
2316 "than B<PTRACE_ATTACH> and B<PTRACE_KILL>, the tracee must be stopped."
2320 #: build/C/man2/ptrace.2:157
2322 msgid "B<PTRACE_PEEKTEXT>, B<PTRACE_PEEKDATA>"
2326 #: build/C/man2/ptrace.2:168
2328 "Read a word at the address I<addr> in the tracee's memory, returning the "
2329 "word as the result of the B<ptrace>() call. Linux does not have separate "
2330 "text and data address spaces, so these two requests are currently "
2331 "equivalent. (I<data> is ignored.)"
2335 #: build/C/man2/ptrace.2:168
2337 msgid "B<PTRACE_PEEKUSER>"
2340 #. PTRACE_PEEKUSR in kernel source, but glibc uses PTRACE_PEEKUSER,
2341 #. and that is the name that seems common on other systems.
2343 #: build/C/man2/ptrace.2:186
2345 "Read a word at offset I<addr> in the tracee's USER area, which holds the "
2346 "registers and other information about the process (see "
2347 "I<E<lt>sys/user.hE<gt>>). The word is returned as the result of the "
2348 "B<ptrace>() call. Typically, the offset must be word-aligned, though this "
2349 "might vary by architecture. See NOTES. (I<data> is ignored.)"
2353 #: build/C/man2/ptrace.2:186
2355 msgid "B<PTRACE_POKETEXT>, B<PTRACE_POKEDATA>"
2359 #: build/C/man2/ptrace.2:198
2361 "Copy the word I<data> to the address I<addr> in the tracee's memory. As for "
2362 "B<PTRACE_PEEKTEXT> and B<PTRACE_PEEKDATA>, these two requests are currently "
2367 #: build/C/man2/ptrace.2:198
2369 msgid "B<PTRACE_POKEUSER>"
2372 #. PTRACE_POKEUSR in kernel source, but glibc uses PTRACE_POKEUSER,
2373 #. and that is the name that seems common on other systems.
2374 #. FIXME In the preceding sentence, which modifications are disallowed,
2375 #. and when they are disallowed, how does userspace discover that fact?
2377 #: build/C/man2/ptrace.2:214
2379 "Copy the word I<data> to offset I<addr> in the tracee's USER area. As for "
2380 "B<PTRACE_PEEKUSER>, the offset must typically be word-aligned. In order to "
2381 "maintain the integrity of the kernel, some modifications to the USER area "
2386 #: build/C/man2/ptrace.2:214
2388 msgid "B<PTRACE_GETREGS>, B<PTRACE_GETFPREGS>"
2392 #: build/C/man2/ptrace.2:233
2394 "Copy the tracee's general-purpose or floating-point registers, respectively, "
2395 "to the address I<data> in the tracer. See I<E<lt>sys/user.hE<gt>> for "
2396 "information on the format of this data. (I<addr> is ignored.) Note that "
2397 "SPARC systems have the meaning of I<data> and I<addr> reversed; that is, "
2398 "I<data> is ignored and the registers are copied to the address I<addr>."
2402 #: build/C/man2/ptrace.2:233
2404 msgid "B<PTRACE_GETSIGINFO> (since Linux 2.3.99-pre6)"
2408 #: build/C/man2/ptrace.2:245
2410 "Retrieve information about the signal that caused the stop. Copy a "
2411 "I<siginfo_t> structure (see B<sigaction>(2)) from the tracee to the address "
2412 "I<data> in the tracer. (I<addr> is ignored.)"
2416 #: build/C/man2/ptrace.2:245
2418 msgid "B<PTRACE_SETREGS>, B<PTRACE_SETFPREGS>"
2421 #. FIXME In the preceding sentence, which modifications are disallowed,
2422 #. and when they are disallowed, how does userspace discover that fact?
2424 #: build/C/man2/ptrace.2:266
2426 "Copy the tracee's general-purpose or floating-point registers, respectively, "
2427 "from the address I<data> in the tracer. As for B<PTRACE_POKEUSER>, some "
2428 "general-purpose register modifications may be disallowed. (I<addr> is "
2429 "ignored.) Note that SPARC systems have the meaning of I<data> and I<addr> "
2430 "reversed; that is, I<data> is ignored and the registers are copied from the "
2435 #: build/C/man2/ptrace.2:266
2437 msgid "B<PTRACE_SETSIGINFO> (since Linux 2.3.99-pre6)"
2441 #: build/C/man2/ptrace.2:282
2443 "Set signal information: copy a I<siginfo_t> structure from the address "
2444 "I<data> in the tracer to the tracee. This will affect only signals that "
2445 "would normally be delivered to the tracee and were caught by the tracer. It "
2446 "may be difficult to tell these normal signals from synthetic signals "
2447 "generated by B<ptrace>() itself. (I<addr> is ignored.)"
2451 #: build/C/man2/ptrace.2:282
2453 msgid "B<PTRACE_SETOPTIONS> (since Linux 2.4.6; see BUGS for caveats)"
2457 #: build/C/man2/ptrace.2:291
2459 "Set ptrace options from I<data>. (I<addr> is ignored.) I<data> is "
2460 "interpreted as a bit mask of options, which are specified by the following "
2465 #: build/C/man2/ptrace.2:292
2467 msgid "B<PTRACE_O_TRACESYSGOOD> (since Linux 2.4.6)"
2471 #: build/C/man2/ptrace.2:301
2473 "When delivering system call traps, set bit 7 in the signal number (i.e., "
2474 "deliver I<SIGTRAP|0x80>). This makes it easy for the tracer to distinguish "
2475 "normal traps from those caused by a system call. (B<PTRACE_O_TRACESYSGOOD> "
2476 "may not work on all architectures.)"
2480 #: build/C/man2/ptrace.2:301
2482 msgid "B<PTRACE_O_TRACEFORK> (since Linux 2.5.46)"
2486 #: build/C/man2/ptrace.2:313
2488 "Stop the tracee at the next B<fork>(2) and automatically start tracing the "
2489 "newly forked process, which will start with a B<SIGSTOP>. A B<waitpid>(2) "
2490 "by the tracer will return a I<status> value such that"
2494 #: build/C/man2/ptrace.2:316
2496 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_FORKE<lt>E<lt>8))\n"
2500 #: build/C/man2/ptrace.2:320 build/C/man2/ptrace.2:339 build/C/man2/ptrace.2:358
2501 msgid "The PID of the new process can be retrieved with B<PTRACE_GETEVENTMSG>."
2505 #: build/C/man2/ptrace.2:320
2507 msgid "B<PTRACE_O_TRACEVFORK> (since Linux 2.5.46)"
2511 #: build/C/man2/ptrace.2:332
2513 "Stop the tracee at the next B<vfork>(2) and automatically start tracing the "
2514 "newly vforked process, which will start with a B<SIGSTOP>. A B<waitpid>(2) "
2515 "by the tracer will return a I<status> value such that"
2519 #: build/C/man2/ptrace.2:335
2521 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_VFORKE<lt>E<lt>8))\n"
2525 #: build/C/man2/ptrace.2:339
2527 msgid "B<PTRACE_O_TRACECLONE> (since Linux 2.5.46)"
2531 #: build/C/man2/ptrace.2:351
2533 "Stop the tracee at the next B<clone>(2) and automatically start tracing the "
2534 "newly cloned process, which will start with a B<SIGSTOP>. A B<waitpid>(2) "
2535 "by the tracer will return a I<status> value such that"
2539 #: build/C/man2/ptrace.2:354
2541 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_CLONEE<lt>E<lt>8))\n"
2545 #: build/C/man2/ptrace.2:379
2547 "This option may not catch B<clone>(2) calls in all cases. If the tracee "
2548 "calls B<clone>(2) with the B<CLONE_VFORK> flag, B<PTRACE_EVENT_VFORK> will "
2549 "be delivered instead if B<PTRACE_O_TRACEVFORK> is set; otherwise if the "
2550 "tracee calls B<clone>(2) with the exit signal set to B<SIGCHLD>, "
2551 "B<PTRACE_EVENT_FORK> will be delivered if B<PTRACE_O_TRACEFORK> is set."
2555 #: build/C/man2/ptrace.2:379
2557 msgid "B<PTRACE_O_TRACEEXEC> (since Linux 2.5.46)"
2561 #: build/C/man2/ptrace.2:388
2563 "Stop the tracee at the next B<execve>(2). A B<waitpid>(2) by the tracer "
2564 "will return a I<status> value such that"
2568 #: build/C/man2/ptrace.2:391
2570 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_EXECE<lt>E<lt>8))\n"
2574 #: build/C/man2/ptrace.2:397
2576 "If the execing thread is not a thread group leader, the thread ID is reset "
2577 "to thread group leader's ID before this stop. Since Linux 3.0, the former "
2578 "thread ID can be retrieved with B<PTRACE_GETEVENTMSG>."
2582 #: build/C/man2/ptrace.2:397
2584 msgid "B<PTRACE_O_TRACEVFORKDONE> (since Linux 2.5.60)"
2588 #: build/C/man2/ptrace.2:406
2590 "Stop the tracee at the completion of the next B<vfork>(2). A B<waitpid>(2) "
2591 "by the tracer will return a I<status> value such that"
2595 #: build/C/man2/ptrace.2:409
2597 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_VFORK_DONEE<lt>E<lt>8))\n"
2601 #: build/C/man2/ptrace.2:413
2603 "The PID of the new process can (since Linux 2.6.18) be retrieved with "
2604 "B<PTRACE_GETEVENTMSG>."
2608 #: build/C/man2/ptrace.2:413
2610 msgid "B<PTRACE_O_TRACEEXIT> (since Linux 2.5.60)"
2614 #: build/C/man2/ptrace.2:421
2616 "Stop the tracee at exit. A B<waitpid>(2) by the tracer will return a "
2617 "I<status> value such that"
2621 #: build/C/man2/ptrace.2:424
2623 msgid " statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_EXITE<lt>E<lt>8))\n"
2627 #: build/C/man2/ptrace.2:428
2628 msgid "The tracee's exit status can be retrieved with B<PTRACE_GETEVENTMSG>."
2632 #: build/C/man2/ptrace.2:436
2634 "The tracee is stopped early during process exit, when registers are still "
2635 "available, allowing the tracer to see where the exit occurred, whereas the "
2636 "normal exit notification is done after the process is finished exiting. "
2637 "Even though context is available, the tracer cannot prevent the exit from "
2638 "happening at this point."
2642 #: build/C/man2/ptrace.2:437
2644 msgid "B<PTRACE_GETEVENTMSG> (since Linux 2.5.46)"
2648 #: build/C/man2/ptrace.2:457
2650 "Retrieve a message (as an I<unsigned long>) about the ptrace event that "
2651 "just happened, placing it at the address I<data> in the tracer. For "
2652 "B<PTRACE_EVENT_EXIT>, this is the tracee's exit status. For "
2653 "B<PTRACE_EVENT_FORK>, B<PTRACE_EVENT_VFORK>, B<PTRACE_EVENT_VFORK_DONE>, and "
2654 "B<PTRACE_EVENT_CLONE>, this is the PID of the new process. (I<addr> is "
2659 #: build/C/man2/ptrace.2:457
2661 msgid "B<PTRACE_CONT>"
2665 #: build/C/man2/ptrace.2:469
2667 "Restart the stopped tracee process. If I<data> is nonzero, it is "
2668 "interpreted as the number of a signal to be delivered to the tracee; "
2669 "otherwise, no signal is delivered. Thus, for example, the tracer can "
2670 "control whether a signal sent to the tracee is delivered or not. (I<addr> "
2675 #: build/C/man2/ptrace.2:469
2677 msgid "B<PTRACE_SYSCALL>, B<PTRACE_SINGLESTEP>"
2681 #: build/C/man2/ptrace.2:493
2683 "Restart the stopped tracee as for B<PTRACE_CONT>, but arrange for the tracee "
2684 "to be stopped at the next entry to or exit from a system call, or after "
2685 "execution of a single instruction, respectively. (The tracee will also, as "
2686 "usual, be stopped upon receipt of a signal.) From the tracer's perspective, "
2687 "the tracee will appear to have been stopped by receipt of a B<SIGTRAP>. So, "
2688 "for B<PTRACE_SYSCALL>, for example, the idea is to inspect the arguments to "
2689 "the system call at the first stop, then do another B<PTRACE_SYSCALL> and "
2690 "inspect the return value of the system call at the second stop. The I<data> "
2691 "argument is treated as for B<PTRACE_CONT>. (I<addr> is ignored.)"
2695 #: build/C/man2/ptrace.2:493
2697 msgid "B<PTRACE_SYSEMU>, B<PTRACE_SYSEMU_SINGLESTEP> (since Linux 2.6.14)"
2701 #: build/C/man2/ptrace.2:511
2703 "For B<PTRACE_SYSEMU>, continue and stop on entry to the next system call, "
2704 "which will not be executed. For B<PTRACE_SYSEMU_SINGLESTEP>, do the same "
2705 "but also singlestep if not a system call. This call is used by programs "
2706 "like User Mode Linux that want to emulate all the tracee's system calls. "
2707 "The I<data> argument is treated as for B<PTRACE_CONT>. (I<addr> is ignored; "
2708 "not supported on all architectures.)"
2712 #: build/C/man2/ptrace.2:511
2714 msgid "B<PTRACE_KILL>"
2718 #: build/C/man2/ptrace.2:520
2720 "Send the tracee a B<SIGKILL> to terminate it. (I<addr> and I<data> are "
2724 #. [Note from Denys Vlasenko:
2725 #. deprecation suggested by Oleg Nesterov. He prefers to deprecate it
2726 #. instead of describing (and needing to support) PTRACE_KILL's quirks.]
2728 #: build/C/man2/ptrace.2:539
2730 "I<This operation is deprecated; do not use it!> Instead, send a B<SIGKILL> "
2731 "directly using B<kill>(2) or B<tgkill>(2). The problem with B<PTRACE_KILL> "
2732 "is that it requires the tracee to be in signal-delivery-stop, otherwise it "
2733 "may not work (i.e., may complete successfully but won't kill the tracee). "
2734 "By contrast, sending a B<SIGKILL> directly has no such limitation."
2738 #: build/C/man2/ptrace.2:539
2740 msgid "B<PTRACE_ATTACH>"
2743 #. No longer true (removed by Denys Vlasenko, 2011, who remarks:
2744 #. "I think it isn't true in non-ancient 2.4 and in 2.6/3.x.
2745 #. Basically, it's not true for any Linux in practical use.
2746 #. ; the behavior of the tracee is as if it had done a
2747 #. .BR PTRACE_TRACEME .
2748 #. The calling process actually becomes the parent of the tracee
2749 #. process for most purposes (e.g., it will receive
2750 #. notification of tracee events and appears in
2752 #. output as the tracee's parent), but a
2754 #. by the tracee will still return the PID of the original parent.
2756 #: build/C/man2/ptrace.2:567
2758 "Attach to the process specified in I<pid>, making it a tracee of the calling "
2759 "process. The tracee is sent a B<SIGSTOP>, but will not necessarily have "
2760 "stopped by the completion of this call; use B<waitpid>(2) to wait for the "
2761 "tracee to stop. See the \"Attaching and detaching\" subsection for "
2762 "additional information. (I<addr> and I<data> are ignored.)"
2766 #: build/C/man2/ptrace.2:567
2768 msgid "B<PTRACE_DETACH>"
2772 #: build/C/man2/ptrace.2:576
2774 "Restart the stopped tracee as for B<PTRACE_CONT>, but first detach from it. "
2775 "Under Linux, a tracee can be detached in this way regardless of which method "
2776 "was used to initiate tracing. (I<addr> is ignored.)"
2780 #: build/C/man2/ptrace.2:576
2782 msgid "Death under ptrace"
2786 #: build/C/man2/ptrace.2:585
2788 "When a (possibly multithreaded) process receives a killing signal (one whose "
2789 "disposition is set to B<SIG_DFL> and whose default action is to kill the "
2790 "process), all threads exit. Tracees report their death to their tracer(s). "
2791 "Notification of this event is delivered via B<waitpid>(2)."
2795 #: build/C/man2/ptrace.2:594
2797 "Note that the killing signal will first cause signal-delivery-stop (on one "
2798 "tracee only), and only after it is injected by the tracer (or after it was "
2799 "dispatched to a thread which isn't traced), will death from the signal "
2800 "happen on I<all> tracees within a multithreaded process. (The term "
2801 "\"signal-delivery-stop\" is explained below.)"
2805 #: build/C/man2/ptrace.2:608
2807 "B<SIGKILL> operates similarly, with exceptions. No signal-delivery-stop is "
2808 "generated for B<SIGKILL> and therefore the tracer can't suppress it. "
2809 "B<SIGKILL> kills even within system calls (syscall-exit-stop is not "
2810 "generated prior to death by B<SIGKILL>). The net effect is that B<SIGKILL> "
2811 "always kills the process (all its threads), even if some threads of the "
2812 "process are ptraced."
2816 #: build/C/man2/ptrace.2:613
2818 "When the tracee calls B<_exit>(2), it reports its death to its tracer. "
2819 "Other threads are not affected."
2823 #: build/C/man2/ptrace.2:617
2825 "When any thread executes B<exit_group>(2), every tracee in its thread group "
2826 "reports its death to its tracer."
2830 #: build/C/man2/ptrace.2:631
2832 "If the B<PTRACE_O_TRACEEXIT> option is on, B<PTRACE_EVENT_EXIT> will happen "
2833 "before actual death. This applies to exits via B<exit>(2), "
2834 "B<exit_group>(2), and signal deaths (except B<SIGKILL>), and when threads "
2835 "are torn down on B<execve>(2) in a multithreaded process."
2839 #: build/C/man2/ptrace.2:656
2841 "The tracer cannot assume that the ptrace-stopped tracee exists. There are "
2842 "many scenarios when the tracee may die while stopped (such as B<SIGKILL>). "
2843 "Therefore, the tracer must be prepared to handle an B<ESRCH> error on any "
2844 "ptrace operation. Unfortunately, the same error is returned if the tracee "
2845 "exists but is not ptrace-stopped (for commands which require a stopped "
2846 "tracee), or if it is not traced by the process which issued the ptrace "
2847 "call. The tracer needs to keep track of the stopped/running state of the "
2848 "tracee, and interpret B<ESRCH> as \"tracee died unexpectedly\" only if it "
2849 "knows that the tracee has been observed to enter ptrace-stop. Note that "
2850 "there is no guarantee that I<waitpid(WNOHANG)> will reliably report the "
2851 "tracee's death status if a ptrace operation returned B<ESRCH>. "
2852 "I<waitpid(WNOHANG)> may return 0 instead. In other words, the tracee may be "
2853 "\"not yet fully dead\", but already refusing ptrace requests."
2857 #: build/C/man2/ptrace.2:670
2859 "The tracer can't assume that the tracee I<always> ends its life by reporting "
2860 "I<WIFEXITED(status)> or I<WIFSIGNALED(status)>; there are cases where this "
2861 "does not occur. For example, if a thread other than thread group leader "
2862 "does an B<execve>(2), it disappears; its PID will never be seen again, and "
2863 "any subsequent ptrace stops will be reported under the thread group leader's "
2868 #: build/C/man2/ptrace.2:670
2870 msgid "Stopped states"
2874 #: build/C/man2/ptrace.2:672
2875 msgid "A tracee can be in two states: running or stopped."
2879 #: build/C/man2/ptrace.2:676
2881 "There are many kinds of states when the tracee is stopped, and in ptrace "
2882 "discussions they are often conflated. Therefore, it is important to use "
2887 #: build/C/man2/ptrace.2:687
2889 "In this manual page, any stopped state in which the tracee is ready to "
2890 "accept ptrace commands from the tracer is called I<ptrace-stop>. "
2891 "Ptrace-stops can be further subdivided into I<signal-delivery-stop>, "
2892 "I<group-stop>, I<syscall-stop>, and so on. These stopped states are "
2893 "described in detail below."
2897 #: build/C/man2/ptrace.2:692
2899 "When the running tracee enters ptrace-stop, it notifies its tracer using "
2900 "B<waitpid>(2) (or one of the other \"wait\" system calls). Most of this "
2901 "manual page assumes that the tracer waits with:"
2905 #: build/C/man2/ptrace.2:694
2907 msgid " pid = waitpid(pid_or_minus_1, &status, __WALL);\n"
2911 #. Do we require __WALL usage, or will just using 0 be ok? (With 0,
2912 #. I am not 100% sure there aren't ugly corner cases.) Are the
2913 #. rules different if user wants to use waitid? Will waitid require
2916 #: build/C/man2/ptrace.2:706
2918 "Ptrace-stopped tracees are reported as returns with I<pid> greater than 0 "
2919 "and I<WIFSTOPPED(status)> true."
2923 #: build/C/man2/ptrace.2:714
2925 "The B<__WALL> flag does not include the B<WSTOPPED> and B<WEXITED> flags, "
2926 "but implies their functionality."
2930 #: build/C/man2/ptrace.2:721
2932 "Setting the B<WCONTINUED> flag when calling B<waitpid>(2) is not "
2933 "recommended: the \"continued\" state is per-process and consuming it can "
2934 "confuse the real parent of the tracee."
2938 #: build/C/man2/ptrace.2:729
2940 "Use of the B<WNOHANG> flag may cause B<waitpid>(2) to return 0 (\"no wait "
2941 "results available yet\") even if the tracer knows there should be a "
2942 "notification. Example:"
2946 #: build/C/man2/ptrace.2:733
2949 " kill(tracee, SIGKILL);\n"
2950 " waitpid(tracee, &status, __WALL | WNOHANG);\n"
2954 #: build/C/man2/ptrace.2:756
2956 "The following kinds of ptrace-stops exist: signal-delivery-stops, "
2957 "group-stops, B<PTRACE_EVENT> stops, syscall-stops. They all are reported by "
2958 "B<waitpid>(2) with I<WIFSTOPPED(status)> true. They may be differentiated "
2959 "by examining the value I<statusE<gt>E<gt>8>, and if there is ambiguity in "
2960 "that value, by querying B<PTRACE_GETSIGINFO>. (Note: the "
2961 "I<WSTOPSIG(status)> macro can't be used to perform this examination, because "
2962 "it returns the value I<(statusE<gt>E<gt>8)\\ &\\ 0xff>.)"
2966 #: build/C/man2/ptrace.2:756
2968 msgid "Signal-delivery-stop"
2972 #: build/C/man2/ptrace.2:776
2974 "When a (possibly multithreaded) process receives any signal except "
2975 "B<SIGKILL>, the kernel selects an arbitrary thread which handles the "
2976 "signal. (If the signal is generated with B<tgkill>(2), the target thread "
2977 "can be explicitly selected by the caller.) If the selected thread is "
2978 "traced, it enters signal-delivery-stop. At this point, the signal is not "
2979 "yet delivered to the process, and can be suppressed by the tracer. If the "
2980 "tracer doesn't suppress the signal, it passes the signal to the tracee in "
2981 "the next ptrace restart request. This second step of signal delivery is "
2982 "called I<signal injection> in this manual page. Note that if the signal is "
2983 "blocked, signal-delivery-stop doesn't happen until the signal is unblocked, "
2984 "with the usual exception that B<SIGSTOP> can't be blocked."
2988 #: build/C/man2/ptrace.2:790
2990 "Signal-delivery-stop is observed by the tracer as B<waitpid>(2) returning "
2991 "with I<WIFSTOPPED(status)> true, with the signal returned by "
2992 "I<WSTOPSIG(status)>. If the signal is B<SIGTRAP>, this may be a different "
2993 "kind of ptrace-stop; see the \"Syscall-stops\" and \"execve\" sections below "
2994 "for details. If I<WSTOPSIG(status)> returns a stopping signal, this may be "
2995 "a group-stop; see below."
2999 #: build/C/man2/ptrace.2:790
3001 msgid "Signal injection and suppression"
3005 #: build/C/man2/ptrace.2:793
3007 "After signal-delivery-stop is observed by the tracer, the tracer should "
3008 "restart the tracee with the call"
3012 #: build/C/man2/ptrace.2:795
3014 msgid " ptrace(PTRACE_restart, pid, 0, sig)\n"
3018 #: build/C/man2/ptrace.2:808
3020 "where B<PTRACE_restart> is one of the restarting ptrace requests. If I<sig> "
3021 "is 0, then a signal is not delivered. Otherwise, the signal I<sig> is "
3022 "delivered. This operation is called I<signal injection> in this manual "
3023 "page, to distinguish it from signal-delivery-stop."
3027 #: build/C/man2/ptrace.2:814
3029 "The I<sig> value may be different from the I<WSTOPSIG(status)> value: the "
3030 "tracer can cause a different signal to be injected."
3034 #: build/C/man2/ptrace.2:830
3036 "Note that a suppressed signal still causes system calls to return "
3037 "prematurely. In this case system calls will be restarted: the tracer will "
3038 "observe the tracee to reexecute the interrupted system call (or "
3039 "B<restart_syscall>(2) system call for a few syscalls which use a different "
3040 "mechanism for restarting) if the tracer uses B<PTRACE_SYSCALL>. Even system "
3041 "calls (such as B<poll>(2)) which are not restartable after signal are "
3042 "restarted after signal is suppressed; however, kernel bugs exist which cause "
3043 "some syscalls to fail with B<EINTR> even though no observable signal is "
3044 "injected to the tracee."
3048 #: build/C/man2/ptrace.2:841
3050 "Restarting ptrace commands issued in ptrace-stops other than "
3051 "signal-delivery-stop are not guaranteed to inject a signal, even if I<sig> "
3052 "is nonzero. No error is reported; a nonzero I<sig> may simply be ignored. "
3053 "Ptrace users should not try to \"create a new signal\" this way: use "
3054 "B<tgkill>(2) instead."
3058 #: build/C/man2/ptrace.2:848
3060 "The fact that signal injection requests may be ignored when restarting the "
3061 "tracee after ptrace stops that are not signal-delivery-stops is a cause of "
3062 "confusion among ptrace users. One typical scenario is that the tracer "
3063 "observes group-stop, mistakes it for signal-delivery-stop, restarts the "
3068 #: build/C/man2/ptrace.2:850
3070 msgid " ptrace(PTRACE_rest, pid, 0, stopsig)\n"
3074 #: build/C/man2/ptrace.2:856
3076 "with the intention of injecting I<stopsig>, but I<stopsig> gets ignored and "
3077 "the tracee continues to run."
3081 #: build/C/man2/ptrace.2:876
3083 "The B<SIGCONT> signal has a side effect of waking up (all threads of) a "
3084 "group-stopped process. This side effect happens before "
3085 "signal-delivery-stop. The tracer can't suppress this side effect (it can "
3086 "only suppress signal injection, which only causes the B<SIGCONT> handler to "
3087 "not be executed in the tracee, if such a handler is installed). In fact, "
3088 "waking up from group-stop may be followed by signal-delivery-stop for "
3089 "signal(s) I<other than> B<SIGCONT>, if they were pending when B<SIGCONT> "
3090 "was delivered. In other words, B<SIGCONT> may be not the first signal "
3091 "observed by the tracee after it was sent."
3095 #: build/C/man2/ptrace.2:880
3097 "Stopping signals cause (all threads of) a process to enter group-stop. This "
3098 "side effect happens after signal injection, and therefore can be suppressed "
3102 #. In the Linux 2.4 sources, in arch/i386/kernel/signal.c::do_signal(),
3105 #. /* The debugger continued. Ignore SIGSTOP. */
3106 #. if (signr == SIGSTOP)
3109 #: build/C/man2/ptrace.2:890
3110 msgid "In Linux 2.4 and earlier, the B<SIGSTOP> signal can't be injected."
3114 #: build/C/man2/ptrace.2:907
3116 "B<PTRACE_GETSIGINFO> can be used to retrieve a I<siginfo_t> structure which "
3117 "corresponds to the delivered signal. B<PTRACE_SETSIGINFO> may be used to "
3118 "modify it. If B<PTRACE_SETSIGINFO> has been used to alter I<siginfo_t>, the "
3119 "I<si_signo> field and the I<sig> parameter in the restarting command must "
3120 "match, otherwise the result is undefined."
3124 #: build/C/man2/ptrace.2:907
3130 #: build/C/man2/ptrace.2:919
3132 "When a (possibly multithreaded) process receives a stopping signal, all "
3133 "threads stop. If some threads are traced, they enter a group-stop. Note "
3134 "that the stopping signal will first cause signal-delivery-stop (on one "
3135 "tracee only), and only after it is injected by the tracer (or after it was "
3136 "dispatched to a thread which isn't traced), will group-stop be initiated on "
3137 "I<all> tracees within the multithreaded process. As usual, every tracee "
3138 "reports its group-stop separately to the corresponding tracer."
3142 #: build/C/man2/ptrace.2:928
3144 "Group-stop is observed by the tracer as B<waitpid>(2) returning with "
3145 "I<WIFSTOPPED(status)> true, with the stopping signal available via "
3146 "I<WSTOPSIG(status)>. The same result is returned by some other classes of "
3147 "ptrace-stops, therefore the recommended practice is to perform the call"
3151 #: build/C/man2/ptrace.2:930
3153 msgid " ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo)\n"
3157 #: build/C/man2/ptrace.2:951
3159 "The call can be avoided if the signal is not B<SIGSTOP>, B<SIGTSTP>, "
3160 "B<SIGTTIN>, or B<SIGTTOU>; only these four signals are stopping signals. If "
3161 "the tracer sees something else, it can't be a group-stop. Otherwise, the "
3162 "tracer needs to call B<PTRACE_GETSIGINFO>. If B<PTRACE_GETSIGINFO> fails "
3163 "with B<EINVAL>, then it is definitely a group-stop. (Other failure codes "
3164 "are possible, such as B<ESRCH> (\"no such process\") if a B<SIGKILL> killed "
3169 #: build/C/man2/ptrace.2:960
3171 "As of kernel 2.6.38, after the tracer sees the tracee ptrace-stop and until "
3172 "it restarts or kills it, the tracee will not run, and will not send "
3173 "notifications (except B<SIGKILL> death) to the tracer, even if the tracer "
3174 "enters into another B<waitpid>(2) call."
3178 #: build/C/man2/ptrace.2:974
3180 "The kernel behavior described in the previous paragraph causes a problem "
3181 "with transparent handling of stopping signals. If the tracer restarts the "
3182 "tracee after group-stop, the stopping signal is effectively ignored\\(emthe "
3183 "tracee doesn't remain stopped, it runs. If the tracer doesn't restart the "
3184 "tracee before entering into the next B<waitpid>(2), future B<SIGCONT> "
3185 "signals will not be reported to the tracer; this would cause the B<SIGCONT> "
3186 "signals to have no effect on the tracee."
3190 #: build/C/man2/ptrace.2:974
3192 msgid "PTRACE_EVENT stops"
3196 #: build/C/man2/ptrace.2:980
3198 "If the tracer sets B<PTRACE_O_TRACE_*> options, the tracee will enter "
3199 "ptrace-stops called B<PTRACE_EVENT> stops."
3203 #: build/C/man2/ptrace.2:994
3205 "B<PTRACE_EVENT> stops are observed by the tracer as B<waitpid>(2) returning "
3206 "with I<WIFSTOPPED(status)>, and I<WSTOPSIG(status)> returns B<SIGTRAP>. An "
3207 "additional bit is set in the higher byte of the status word: the value "
3208 "I<statusE<gt>E<gt>8> will be"
3212 #: build/C/man2/ptrace.2:996
3214 msgid " (SIGTRAP | PTRACE_EVENT_foo E<lt>E<lt> 8).\n"
3218 #: build/C/man2/ptrace.2:998
3219 msgid "The following events exist:"
3223 #: build/C/man2/ptrace.2:998
3225 msgid "B<PTRACE_EVENT_VFORK>"
3229 #: build/C/man2/ptrace.2:1011
3231 "Stop before return from B<vfork>(2) or B<clone>(2) with the B<CLONE_VFORK> "
3232 "flag. When the tracee is continued after this stop, it will wait for child "
3233 "to exit/exec before continuing its execution (in other words, the usual "
3234 "behavior on B<vfork>(2))."
3238 #: build/C/man2/ptrace.2:1011
3240 msgid "B<PTRACE_EVENT_FORK>"
3244 #: build/C/man2/ptrace.2:1019
3246 "Stop before return from B<fork>(2) or B<clone>(2) with the exit signal set "
3251 #: build/C/man2/ptrace.2:1019
3253 msgid "B<PTRACE_EVENT_CLONE>"
3257 #: build/C/man2/ptrace.2:1023
3258 msgid "Stop before return from B<clone>(2)."
3262 #: build/C/man2/ptrace.2:1023
3264 msgid "B<PTRACE_EVENT_VFORK_DONE>"
3268 #: build/C/man2/ptrace.2:1033
3270 "Stop before return from B<vfork>(2) or B<clone>(2) with the B<CLONE_VFORK> "
3271 "flag, but after the child unblocked this tracee by exiting or execing."
3275 #: build/C/man2/ptrace.2:1039
3277 "For all four stops described above, the stop occurs in the parent (i.e., the "
3278 "tracee), not in the newly created thread. B<PTRACE_GETEVENTMSG> can be used "
3279 "to retrieve the new thread's ID."
3283 #: build/C/man2/ptrace.2:1039
3285 msgid "B<PTRACE_EVENT_EXEC>"
3289 #: build/C/man2/ptrace.2:1046
3291 "Stop before return from B<execve>(2). Since Linux 3.0, "
3292 "B<PTRACE_GETEVENTMSG> returns the former thread ID."
3296 #: build/C/man2/ptrace.2:1046
3298 msgid "B<PTRACE_EVENT_EXIT>"
3302 #: build/C/man2/ptrace.2:1062
3304 "Stop before exit (including death from B<exit_group>(2)), signal death, or "
3305 "exit caused by B<execve>(2) in a multithreaded process. "
3306 "B<PTRACE_GETEVENTMSG> returns the exit status. Registers can be examined "
3307 "(unlike when \"real\" exit happens). The tracee is still alive; it needs to "
3308 "be B<PTRACE_CONT>ed or B<PTRACE_DETACH>ed to finish exiting."
3312 #: build/C/man2/ptrace.2:1074
3314 "B<PTRACE_GETSIGINFO> on B<PTRACE_EVENT> stops returns B<SIGTRAP> in "
3315 "I<si_signo>, with I<si_code> set to I<(eventE<lt>E<lt>8)\\ |\\ SIGTRAP>."
3319 #: build/C/man2/ptrace.2:1074
3321 msgid "Syscall-stops"
3325 #: build/C/man2/ptrace.2:1087
3327 "If the tracee was restarted by B<PTRACE_SYSCALL>, the tracee enters "
3328 "syscall-enter-stop just prior to entering any system call. If the tracer "
3329 "restarts the tracee with B<PTRACE_SYSCALL>, the tracee enters "
3330 "syscall-exit-stop when the system call is finished, or if it is interrupted "
3331 "by a signal. (That is, signal-delivery-stop never happens between "
3332 "syscall-enter-stop and syscall-exit-stop; it happens I<after> "
3333 "syscall-exit-stop.)"
3337 #: build/C/man2/ptrace.2:1101
3339 "Other possibilities are that the tracee may stop in a B<PTRACE_EVENT> stop, "
3340 "exit (if it entered B<_exit>(2) or B<exit_group>(2)), be killed by "
3341 "B<SIGKILL>, or die silently (if it is a thread group leader, the "
3342 "B<execve>(2) happened in another thread, and that thread is not traced by "
3343 "the same tracer; this situation is discussed later)."
3347 #: build/C/man2/ptrace.2:1116
3349 "Syscall-enter-stop and syscall-exit-stop are observed by the tracer as "
3350 "B<waitpid>(2) returning with I<WIFSTOPPED(status)> true, and "
3351 "I<WSTOPSIG(status)> giving B<SIGTRAP>. If the B<PTRACE_O_TRACESYSGOOD> "
3352 "option was set by the tracer, then I<WSTOPSIG(status)> will give the value "
3353 "I<(SIGTRAP\\ |\\ 0x80)>."
3357 #: build/C/man2/ptrace.2:1122
3359 "Syscall-stops can be distinguished from signal-delivery-stop with B<SIGTRAP> "
3360 "by querying B<PTRACE_GETSIGINFO> for the following cases:"
3364 #: build/C/man2/ptrace.2:1122
3366 msgid "I<si_code> E<lt>= 0"
3370 #: build/C/man2/ptrace.2:1134
3372 "B<SIGTRAP> was delivered as a result of a userspace action, for example, a "
3373 "system call (B<tgkill>(2), B<kill>(2), B<sigqueue>(3), etc.), expiration of "
3374 "a POSIX timer, change of state on a POSIX message queue, or completion of an "
3375 "asynchronous I/O request."
3379 #: build/C/man2/ptrace.2:1134
3381 msgid "I<si_code> == SI_KERNEL (0x80)"
3385 #: build/C/man2/ptrace.2:1138
3386 msgid "B<SIGTRAP> was sent by the kernel."
3390 #: build/C/man2/ptrace.2:1138
3392 msgid "I<si_code> == SIGTRAP or I<si_code> == (SIGTRAP|0x80)"
3396 #: build/C/man2/ptrace.2:1141
3397 msgid "This is a syscall-stop."
3401 #: build/C/man2/ptrace.2:1146
3403 "However, syscall-stops happen very often (twice per system call), and "
3404 "performing B<PTRACE_GETSIGINFO> for every syscall-stop may be somewhat "
3409 #: build/C/man2/ptrace.2:1169
3411 "Some architectures allow the cases to be distinguished by examining "
3412 "registers. For example, on x86, I<rax> == -B<ENOSYS> in "
3413 "syscall-enter-stop. Since B<SIGTRAP> (like any other signal) always happens "
3414 "I<after> syscall-exit-stop, and at this point I<rax> almost never contains "
3415 "-B<ENOSYS>, the B<SIGTRAP> looks like \"syscall-stop which is not "
3416 "syscall-enter-stop\"; in other words, it looks like a \"stray "
3417 "syscall-exit-stop\" and can be detected this way. But such detection is "
3418 "fragile and is best avoided."
3422 #: build/C/man2/ptrace.2:1175
3424 "Using the B<PTRACE_O_TRACESYSGOOD> option is the recommended method to "
3425 "distinguish syscall-stops from other kinds of ptrace-stops, since it is "
3426 "reliable and does not incur a performance penalty."
3430 #: build/C/man2/ptrace.2:1186
3432 "Syscall-enter-stop and syscall-exit-stop are indistinguishable from each "
3433 "other by the tracer. The tracer needs to keep track of the sequence of "
3434 "ptrace-stops in order to not misinterpret syscall-enter-stop as "
3435 "syscall-exit-stop or vice versa. The rule is that syscall-enter-stop is "
3436 "always followed by syscall-exit-stop, B<PTRACE_EVENT> stop or the tracee's "
3437 "death; no other kinds of ptrace-stop can occur in between."
3441 #: build/C/man2/ptrace.2:1191
3443 "If after syscall-enter-stop, the tracer uses a restarting command other than "
3444 "B<PTRACE_SYSCALL>, syscall-exit-stop is not generated."
3448 #: build/C/man2/ptrace.2:1203
3450 "B<PTRACE_GETSIGINFO> on syscall-stops returns B<SIGTRAP> in I<si_signo>, "
3451 "with I<si_code> set to B<SIGTRAP> or I<(SIGTRAP|0x80)>."
3455 #: build/C/man2/ptrace.2:1203
3457 msgid "PTRACE_SINGLESTEP, PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP stops"
3462 #. document stops occurring with PTRACE_SINGLESTEP, PTRACE_SYSEMU,
3463 #. PTRACE_SYSEMU_SINGLESTEP
3465 #: build/C/man2/ptrace.2:1209
3466 msgid "[Details of these kinds of stops are yet to be documented.]"
3470 #: build/C/man2/ptrace.2:1209
3472 msgid "Informational and restarting ptrace commands"
3476 #: build/C/man2/ptrace.2:1217
3478 "Most ptrace commands (all except B<PTRACE_ATTACH>, B<PTRACE_TRACEME>, and "
3479 "B<PTRACE_KILL>) require the tracee to be in a ptrace-stop, otherwise they "
3480 "fail with B<ESRCH>."
3484 #: build/C/man2/ptrace.2:1222
3486 "When the tracee is in ptrace-stop, the tracer can read and write data to the "
3487 "tracee using informational commands. These commands leave the tracee in "
3488 "ptrace-stopped state:"
3492 #: build/C/man2/ptrace.2:1232
3495 " ptrace(PTRACE_PEEKTEXT/PEEKDATA/PEEKUSER, pid, addr, 0);\n"
3496 " ptrace(PTRACE_POKETEXT/POKEDATA/POKEUSER, pid, addr, long_val);\n"
3497 " ptrace(PTRACE_GETREGS/GETFPREGS, pid, 0, &struct);\n"
3498 " ptrace(PTRACE_SETREGS/SETFPREGS, pid, 0, &struct);\n"
3499 " ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo);\n"
3500 " ptrace(PTRACE_SETSIGINFO, pid, 0, &siginfo);\n"
3501 " ptrace(PTRACE_GETEVENTMSG, pid, 0, &long_var);\n"
3502 " ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_flags);\n"
3506 #: build/C/man2/ptrace.2:1244
3508 "Note that some errors are not reported. For example, setting signal "
3509 "information (I<siginfo>) may have no effect in some ptrace-stops, yet the "
3510 "call may succeed (return 0 and not set I<errno>); querying "
3511 "B<PTRACE_GETEVENTMSG> may succeed and return some random value if current "
3512 "ptrace-stop is not documented as returning a meaningful event message."
3516 #: build/C/man2/ptrace.2:1246
3521 #: build/C/man2/ptrace.2:1248
3523 msgid " ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_flags);\n"
3527 #: build/C/man2/ptrace.2:1257
3529 "affects one tracee. The tracee's current flags are replaced. Flags are "
3530 "inherited by new tracees created and \"auto-attached\" via active "
3531 "B<PTRACE_O_TRACEFORK>, B<PTRACE_O_TRACEVFORK>, or B<PTRACE_O_TRACECLONE> "
3536 #: build/C/man2/ptrace.2:1260
3538 "Another group of commands makes the ptrace-stopped tracee run. They have "
3543 #: build/C/man2/ptrace.2:1262
3545 msgid " ptrace(cmd, pid, 0, sig);\n"
3549 #: build/C/man2/ptrace.2:1282
3551 "where I<cmd> is B<PTRACE_CONT>, B<PTRACE_DETACH>, B<PTRACE_SYSCALL>, "
3552 "B<PTRACE_SINGLESTEP>, B<PTRACE_SYSEMU>, or B<PTRACE_SYSEMU_SINGLESTEP>. If "
3553 "the tracee is in signal-delivery-stop, I<sig> is the signal to be injected "
3554 "(if it is nonzero). Otherwise, I<sig> may be ignored. (When restarting a "
3555 "tracee from a ptrace-stop other than signal-delivery-stop, recommended "
3556 "practice is to always pass 0 in I<sig>.)"
3560 #: build/C/man2/ptrace.2:1282
3562 msgid "Attaching and detaching"
3566 #: build/C/man2/ptrace.2:1284
3567 msgid "A thread can be attached to the tracer using the call"
3571 #: build/C/man2/ptrace.2:1286
3573 msgid " ptrace(PTRACE_ATTACH, pid, 0, 0);\n"
3577 #. FIXME: Describe how to attach to a thread which is already
3580 #: build/C/man2/ptrace.2:1310
3582 "This also sends B<SIGSTOP> to this thread. If the tracer wants this "
3583 "B<SIGSTOP> to have no effect, it needs to suppress it. Note that if other "
3584 "signals are concurrently sent to this thread during attach, the tracer may "
3585 "see the tracee enter signal-delivery-stop with other signal(s) first! The "
3586 "usual practice is to reinject these signals until B<SIGSTOP> is seen, then "
3587 "suppress B<SIGSTOP> injection. The design bug here is that a ptrace attach "
3588 "and a concurrently delivered B<SIGSTOP> may race and the concurrent "
3589 "B<SIGSTOP> may be lost."
3593 #: build/C/man2/ptrace.2:1317
3595 "Since attaching sends B<SIGSTOP> and the tracer usually suppresses it, this "
3596 "may cause a stray B<EINTR> return from the currently executing system call "
3597 "in the tracee, as described in the \"Signal injection and suppression\" "
3602 #: build/C/man2/ptrace.2:1319
3607 #: build/C/man2/ptrace.2:1321
3609 msgid " ptrace(PTRACE_TRACEME, 0, 0, 0);\n"
3613 #: build/C/man2/ptrace.2:1327
3615 "turns the calling thread into a tracee. The thread continues to run "
3616 "(doesn't enter ptrace-stop). A common practice is to follow the "
3617 "B<PTRACE_TRACEME> with"
3621 #: build/C/man2/ptrace.2:1329
3623 msgid " raise(SIGSTOP);\n"
3627 #: build/C/man2/ptrace.2:1332
3629 "and allow the parent (which is our tracer now) to observe our "
3630 "signal-delivery-stop."
3634 #: build/C/man2/ptrace.2:1356
3636 "If the B<PTRACE_O_TRACEFORK>, B<PTRACE_O_TRACEVFORK>, or "
3637 "B<PTRACE_O_TRACECLONE> options are in effect, then children created by, "
3638 "respectively, B<vfork>(2) or B<clone>(2) with the B<CLONE_VFORK> flag, "
3639 "B<fork>(2) or B<clone>(2) with the exit signal set to B<SIGCHLD>, and "
3640 "other kinds of B<clone>(2), are automatically attached to the same tracer "
3641 "which traced their parent. B<SIGSTOP> is delivered to the children, causing "
3642 "them to enter signal-delivery-stop after they exit the system call which "
3647 #: build/C/man2/ptrace.2:1358
3648 msgid "Detaching of the tracee is performed by:"
3652 #: build/C/man2/ptrace.2:1360
3654 msgid " ptrace(PTRACE_DETACH, pid, 0, sig);\n"
3658 #: build/C/man2/ptrace.2:1368
3660 "B<PTRACE_DETACH> is a restarting operation; therefore it requires the tracee "
3661 "to be in ptrace-stop. If the tracee is in signal-delivery-stop, a signal "
3662 "can be injected. Otherwise, the I<sig> parameter may be silently ignored."
3665 #. FIXME: Describe how to detach from a group-stopped tracee so that it
3666 #. doesn't run, but continues to wait for SIGCONT.
3668 #: build/C/man2/ptrace.2:1392
3670 "If the tracee is running when the tracer wants to detach it, the usual "
3671 "solution is to send B<SIGSTOP> (using B<tgkill>(2), to make sure it goes to "
3672 "the correct thread), wait for the tracee to stop in signal-delivery-stop for "
3673 "B<SIGSTOP> and then detach it (suppressing B<SIGSTOP> injection). A design "
3674 "bug is that this can race with concurrent B<SIGSTOP>s. Another complication "
3675 "is that the tracee may enter other ptrace-stops and needs to be restarted "
3676 "and waited for again, until B<SIGSTOP> is seen. Yet another complication is "
3677 "to be sure that the tracee is not already ptrace-stopped, because no signal "
3678 "delivery happens while it is\\(emnot even B<SIGSTOP>."
3682 #: build/C/man2/ptrace.2:1400
3684 "If the tracer dies, all tracees are automatically detached and restarted, "
3685 "unless they were in group-stop. Handling of restart from group-stop is "
3686 "currently buggy, but the \"as planned\" behavior is to leave tracee stopped "
3687 "and waiting for B<SIGCONT>. If the tracee is restarted from "
3688 "signal-delivery-stop, the pending signal is injected."
3692 #: build/C/man2/ptrace.2:1400
3694 msgid "execve(2) under ptrace"
3697 #. clone(2) THREAD_CLONE says:
3698 #. If any of the threads in a thread group performs an execve(2),
3699 #. then all threads other than the thread group leader are terminated,
3700 #. and the new program is executed in the thread group leader.
3702 #. In kernel 3.1 sources, see fs/exec.c::de_thread()
3704 #: build/C/man2/ptrace.2:1419
3706 "When one thread in a multithreaded process calls B<execve>(2), the kernel "
3707 "destroys all other threads in the process, and resets the thread ID of the "
3708 "execing thread to the thread group ID (process ID). (Or, to put things "
3709 "another way, when a multithreaded process does an B<execve>(2), at "
3710 "completion of the call, it appears as though the B<execve>(2) occurred in "
3711 "the thread group leader, regardless of which thread did the B<execve>(2).) "
3712 "This resetting of the thread ID looks very confusing to tracers:"
3716 #: build/C/man2/ptrace.2:1419 build/C/man2/ptrace.2:1429 build/C/man2/ptrace.2:1437 build/C/man2/ptrace.2:1443 build/C/man2/ptrace.2:1572
3722 #: build/C/man2/ptrace.2:1429
3724 "All other threads stop in B<PTRACE_EVENT_EXIT> stop, if the "
3725 "B<PTRACE_O_TRACEEXIT> option was turned on. Then all other threads except "
3726 "the thread group leader report death as if they exited via B<_exit>(2) with "
3731 #: build/C/man2/ptrace.2:1437
3733 "The execing tracee changes its thread ID while it is in the B<execve>(2). "
3734 "(Remember, under ptrace, the \"pid\" returned from B<waitpid>(2), or fed "
3735 "into ptrace calls, is the tracee's thread ID.) That is, the tracee's thread "
3736 "ID is reset to be the same as its process ID, which is the same as the "
3737 "thread group leader's thread ID."
3741 #: build/C/man2/ptrace.2:1443
3743 "Then a B<PTRACE_EVENT_EXEC> stop happens, if the B<PTRACE_O_TRACEEXEC> "
3744 "option was turned on."
3748 #: build/C/man2/ptrace.2:1464
3750 "If the thread group leader has reported its B<PTRACE_EVENT_EXIT> stop by "
3751 "this time, it appears to the tracer that the dead thread leader \"reappears "
3752 "from nowhere\". (Note: the thread group leader does not report death via "
3753 "I<WIFEXITED(status)> until there is at least one other live thread. This "
3754 "eliminates the possibility that the tracer will see it dying and then "
3755 "reappearing.) If the thread group leader was still alive, for the tracer "
3756 "this may look as if thread group leader returns from a different system call "
3757 "than it entered, or even \"returned from a system call even though it was "
3758 "not in any system call\". If the thread group leader was not traced (or was "
3759 "traced by a different tracer), then during B<execve>(2) it will appear as "
3760 "if it has become a tracee of the tracer of the execing tracee."
3764 #: build/C/man2/ptrace.2:1467
3766 "All of the above effects are the artifacts of the thread ID change in the "
3771 #: build/C/man2/ptrace.2:1487
3773 "The B<PTRACE_O_TRACEEXEC> option is the recommended tool for dealing with "
3774 "this situation. First, it enables B<PTRACE_EVENT_EXEC> stop, which occurs "
3775 "before B<execve>(2) returns. In this stop, the tracer can use "
3776 "B<PTRACE_GETEVENTMSG> to retrieve the tracee's former thread ID. (This "
3777 "feature was introduced in Linux 3.0). Second, the B<PTRACE_O_TRACEEXEC> "
3778 "option disables legacy B<SIGTRAP> generation on B<execve>(2)."
3782 #: build/C/man2/ptrace.2:1493
3784 "When the tracer receives B<PTRACE_EVENT_EXEC> stop notification, it is "
3785 "guaranteed that except this tracee and the thread group leader, no other "
3786 "threads from the process are alive."
3790 #: build/C/man2/ptrace.2:1501
3792 "On receiving the B<PTRACE_EVENT_EXEC> stop notification, the tracer should "
3793 "clean up all its internal data structures describing the threads of this "
3794 "process, and retain only one data structure\\(emone which describes the "
3795 "single still running tracee, with"
3799 #: build/C/man2/ptrace.2:1503
3801 msgid " thread ID == thread group ID == process ID.\n"
3805 #: build/C/man2/ptrace.2:1507
3806 msgid "Example: two threads call B<execve>(2) at the same time:"
3810 #: build/C/man2/ptrace.2:1518
3813 "*** we get syscall-enter-stop in thread 1: **\n"
3814 "PID1 execve(\"/bin/foo\", \"foo\" E<lt>unfinished ...E<gt>\n"
3815 "*** we issue PTRACE_SYSCALL for thread 1 **\n"
3816 "*** we get syscall-enter-stop in thread 2: **\n"
3817 "PID2 execve(\"/bin/bar\", \"bar\" E<lt>unfinished ...E<gt>\n"
3818 "*** we issue PTRACE_SYSCALL for thread 2 **\n"
3819 "*** we get PTRACE_EVENT_EXEC for PID0, we issue PTRACE_SYSCALL **\n"
3820 "*** we get syscall-exit-stop for PID0: **\n"
3821 "PID0 E<lt>... execve resumedE<gt> ) = 0\n"
3825 #: build/C/man2/ptrace.2:1541
3827 "If the B<PTRACE_O_TRACEEXEC> option is I<not> in effect for the execing "
3828 "tracee, the kernel delivers an extra B<SIGTRAP> to the tracee after "
3829 "B<execve>(2) returns. This is an ordinary signal (similar to one which can "
3830 "be generated by I<kill -TRAP>), not a special kind of ptrace-stop. "
3831 "Employing B<PTRACE_GETSIGINFO> for this signal returns I<si_code> set to 0 "
3832 "(I<SI_USER>). This signal may be blocked by signal mask, and thus may be "
3833 "delivered (much) later."
3837 #: build/C/man2/ptrace.2:1560
3839 "Usually, the tracer (for example, B<strace>(1)) would not want to show this "
3840 "extra post-execve B<SIGTRAP> signal to the user, and would suppress its "
3841 "delivery to the tracee (if B<SIGTRAP> is set to B<SIG_DFL>, it is a killing "
3842 "signal). However, determining I<which> B<SIGTRAP> to suppress is not easy. "
3843 "Setting the B<PTRACE_O_TRACEEXEC> option and thus suppressing this extra "
3844 "B<SIGTRAP> is the recommended approach."
3848 #: build/C/man2/ptrace.2:1560
3854 #: build/C/man2/ptrace.2:1567
3856 "The ptrace API (ab)uses the standard UNIX parent/child signaling over "
3857 "B<waitpid>(2). This used to cause the real parent of the process to stop "
3858 "receiving several kinds of B<waitpid>(2) notifications when the child "
3859 "process is traced by some other process."
3863 #: build/C/man2/ptrace.2:1570
3865 "Many of these bugs have been fixed, but as of Linux 2.6.38 several still "
3866 "exist; see BUGS below."
3870 #: build/C/man2/ptrace.2:1572
3871 msgid "As of Linux 2.6.38, the following is believed to work correctly:"
3875 #: build/C/man2/ptrace.2:1580
3877 "exit/death by signal is reported first to the tracer, then, when the tracer "
3878 "consumes the B<waitpid>(2) result, to the real parent (to the real parent "
3879 "only when the whole multithreaded process exits). If the tracer and the "
3880 "real parent are the same process, the report is sent only once."
3884 #: build/C/man2/ptrace.2:1594
3886 "On success, B<PTRACE_PEEK*> requests return the requested data, while other "
3887 "requests return zero. On error, all requests return -1, and I<errno> is set "
3888 "appropriately. Since the value returned by a successful B<PTRACE_PEEK*> "
3889 "request may be -1, the caller must clear I<errno> before the call, and then "
3890 "check it afterward to determine whether or not an error occurred."
3894 #: build/C/man2/ptrace.2:1598
3895 msgid "(i386 only) There was an error with allocating or freeing a debug register."
3899 #: build/C/man2/ptrace.2:1609
3901 "There was an attempt to read from or write to an invalid area in the "
3902 "tracer's or the tracee's memory, probably because the area wasn't mapped or "
3903 "accessible. Unfortunately, under Linux, different variations of this fault "
3904 "will return B<EIO> or B<EFAULT> more or less arbitrarily."
3908 #: build/C/man2/ptrace.2:1612
3909 msgid "An attempt was made to set an invalid option."
3913 #: build/C/man2/ptrace.2:1619
3915 "I<request> is invalid, or an attempt was made to read from or write to an "
3916 "invalid area in the tracer's or the tracee's memory, or there was a "
3917 "word-alignment violation, or an invalid signal was specified during a "
3922 #: build/C/man2/ptrace.2:1632
3924 "The specified process cannot be traced. This could be because the tracer "
3925 "has insufficient privileges (the required capability is B<CAP_SYS_PTRACE>); "
3926 "unprivileged processes cannot trace processes that they cannot send signals "
3927 "to or those running set-user-ID/set-group-ID programs, for obvious reasons. "
3928 "Alternatively, the process may already be being traced, or (on kernels "
3929 "before 2.6.26) be B<init>(8) (PID 1)."
3933 #: build/C/man2/ptrace.2:1637
3935 "The specified process does not exist, or is not currently being traced by "
3936 "the caller, or is not stopped (for requests that require a stopped tracee)."
3940 #: build/C/man2/ptrace.2:1639
3941 msgid "SVr4, 4.3BSD."
3945 #: build/C/man2/ptrace.2:1652
3947 "Although arguments to B<ptrace>() are interpreted according to the "
3948 "prototype given, glibc currently declares B<ptrace>() as a variadic "
3949 "function with only the I<request> argument fixed. This means that unneeded "
3950 "trailing arguments may be omitted, though doing so makes use of undocumented "
3951 "B<gcc>(1) behavior."
3954 #. See commit 00cd5c37afd5f431ac186dd131705048c0a11fdb
3956 #: build/C/man2/ptrace.2:1657
3958 "In Linux kernels before 2.6.26, B<init>(8), the process with PID 1, may not "
3962 #. See http://lkml.org/lkml/2008/5/8/375
3964 #: build/C/man2/ptrace.2:1664
3966 "The layout of the contents of memory and the USER area are quite "
3967 "operating-system- and architecture-specific. The offset supplied, and the "
3968 "data returned, might not entirely match with the definition of I<struct "
3973 #: build/C/man2/ptrace.2:1667
3975 "The size of a \"word\" is determined by the operating-system variant (e.g., "
3976 "for 32-bit Linux it is 32 bits)."
3980 #: build/C/man2/ptrace.2:1675
3982 "This page documents the way the B<ptrace>() call works currently in Linux. "
3983 "Its behavior differs noticeably on other flavors of UNIX. In any case, use "
3984 "of B<ptrace>() is highly specific to the operating system and architecture."
3988 #: build/C/man2/ptrace.2:1686
3990 "On hosts with 2.6 kernel headers, B<PTRACE_SETOPTIONS> is declared with a "
3991 "different value than the one for 2.4. This leads to applications compiled "
3992 "with 2.6 kernel headers failing when run on 2.4 kernels. This can be worked "
3993 "around by redefining B<PTRACE_SETOPTIONS> to B<PTRACE_OLDSETOPTIONS>, if "
3998 #: build/C/man2/ptrace.2:1689
4000 "Group-stop notifications are sent to the tracer, but not to real parent. "
4001 "Last confirmed on 2.6.38.6."
4004 #. Note from Denys Vlasenko:
4005 #. Here "exits" means any kind of death - _exit, exit_group,
4006 #. signal death. Signal death and exit_group cases are trivial,
4007 #. though: since signal death and exit_group kill all other threads
4008 #. too, "until all other threads exit" thing happens rather soon
4009 #. in these cases. Therefore, only _exit presents observably
4010 #. puzzling behavior to ptrace users: thread leader _exit's,
4011 #. but WIFEXITED isn't reported! We are trying to explain here
4013 #. FIXME: ^^^ need to test/verify this scenario
4015 #: build/C/man2/ptrace.2:1720
4017 "If a thread group leader is traced and exits by calling B<_exit>(2), a "
4018 "B<PTRACE_EVENT_EXIT> stop will happen for it (if requested), but the "
4019 "subsequent B<WIFEXITED> notification will not be delivered until all other "
4020 "threads exit. As explained above, if one of other threads calls "
4021 "B<execve>(2), the death of the thread group leader will I<never> be "
4022 "reported. If the execed thread is not traced by this tracer, the tracer "
4023 "will never know that B<execve>(2) happened. One possible workaround is to "
4024 "B<PTRACE_DETACH> the thread group leader instead of restarting it in this "
4025 "case. Last confirmed on 2.6.38.6."
4029 #: build/C/man2/ptrace.2:1730
4031 "A B<SIGKILL> signal may still cause a B<PTRACE_EVENT_EXIT> stop before "
4032 "actual signal death. This may be changed in the future; B<SIGKILL> is meant "
4033 "to always immediately kill tasks even under ptrace. Last confirmed on "
4038 #: build/C/man2/ptrace.2:1746
4040 "Some system calls return with B<EINTR> if a signal was sent to a tracee, but "
4041 "delivery was suppressed by the tracer. (This is very typical operation: it "
4042 "is usually done by debuggers on every attach, in order to not introduce a "
4043 "bogus B<SIGSTOP>). As of Linux 3.2.9, the following system calls are "
4044 "affected (this list is likely incomplete): B<epoll_wait>(2), and B<read>(2) "
4045 "from an B<inotify>(7) file descriptor."
4049 #: build/C/man2/ptrace.2:1760
4051 "B<gdb>(1), B<strace>(1), B<clone>(2), B<execve>(2), B<fork>(2), "
4052 "B<gettid>(2), B<sigaction>(2), B<tgkill>(2), B<vfork>(2), B<waitpid>(2), "
4053 "B<exec>(3), B<capabilities>(7), B<signal>(7)"
4057 #: build/C/man2/quotactl.2:25
4063 #: build/C/man2/quotactl.2:25
4069 #: build/C/man2/quotactl.2:28
4070 msgid "quotactl - manipulate disk quotas"
4074 #: build/C/man2/quotactl.2:32
4077 "B<#include E<lt>sys/quota.hE<gt>>\n"
4078 "B<#include E<lt>xfs/xqm.hE<gt>>\n"
4082 #: build/C/man2/quotactl.2:35
4085 "B<int quotactl(int >I<cmd>B<, const char *>I<special>B<, int >I<id>B<, "
4086 "caddr_t >I<addr>B<);>\n"
4090 #: build/C/man2/quotactl.2:47
4092 "The quota system can be used to set per-user and per-group limits on the "
4093 "amount of disk space used on a file system. For each user and/or group, a "
4094 "soft limit and a hard limit can be set for each file system. The hard limit "
4095 "can't be exceeded. The soft limit can be exceeded, but warnings will "
4096 "ensue. Moreover, the user can't exceed the soft limit for more than one "
4097 "week (by default) at a time; after this time, the soft limit counts as a "
4102 #: build/C/man2/quotactl.2:72
4104 "The B<quotactl>() call manipulates disk quotas. The I<cmd> argument "
4105 "indicates a command to be applied to the user or group ID specified in "
4106 "I<id>. To initialize the I<cmd> argument, use the I<QCMD(subcmd, type)> "
4107 "macro. The I<type> value is either B<USRQUOTA>, for user quotas, or "
4108 "B<GRPQUOTA>, for group quotas. The I<subcmd> value is described below."
4112 #: build/C/man2/quotactl.2:77
4114 "The I<special> argument is a pointer to a null-terminated string containing "
4115 "the pathname of the (mounted) block special device for the file system being "
4120 #: build/C/man2/quotactl.2:85
4122 "The I<addr> argument is the address of an optional, command-specific, data "
4123 "structure that is copied in or out of the system. The interpretation of "
4124 "I<addr> is given with each command below."
4128 #: build/C/man2/quotactl.2:89
4129 msgid "The I<subcmd> value is one of the following:"
4133 #: build/C/man2/quotactl.2:89
4135 msgid "B<Q_QUOTAON>"
4139 #: build/C/man2/quotactl.2:96
4141 "Turn on quotas for a file system. The I<id> argument is the identification "
4142 "number of the quota format to be used. Currently, there are three supported "
4147 #: build/C/man2/quotactl.2:97
4149 msgid "B<QFMT_VFS_OLD>"
4153 #: build/C/man2/quotactl.2:100
4154 msgid "The original quota format."
4158 #: build/C/man2/quotactl.2:100
4160 msgid "B<QFMT_VFS_V0>"
4164 #: build/C/man2/quotactl.2:104
4166 "The standard VFS v0 quota format, which can handle 32-bit UIDs and GIDs and "
4167 "quota limits up to 2^42 bytes and 2^32 inodes."
4171 #: build/C/man2/quotactl.2:104
4173 msgid "B<QFMT_VFS_V1>"
4177 #: build/C/man2/quotactl.2:108
4179 "A quota format that can handle 32-bit UIDs and GIDs and quota limits of 2^64 "
4180 "bytes and 2^64 inodes."
4184 #: build/C/man2/quotactl.2:119
4186 "The I<addr> argument points to the pathname of a file containing the quotas "
4187 "for the file system. The quota file must exist; it is normally created with "
4188 "the B<quotacheck>(8) program. This operation requires privilege "
4189 "(B<CAP_SYS_ADMIN>)."
4193 #: build/C/man2/quotactl.2:119
4195 msgid "B<Q_QUOTAOFF>"
4199 #: build/C/man2/quotactl.2:129
4201 "Turn off quotas for a file system. The I<addr> and I<id> arguments are "
4202 "ignored. This operation requires privilege (B<CAP_SYS_ADMIN>)."
4206 #: build/C/man2/quotactl.2:129
4208 msgid "B<Q_GETQUOTA>"
4212 #: build/C/man2/quotactl.2:140
4214 "Get disk quota limits and current usage for user or group I<id>. The "
4215 "I<addr> argument is a pointer to a I<dqblk> structure defined in "
4216 "I<E<lt>sys/quota.hE<gt>> as follows:"
4220 #: build/C/man2/quotactl.2:145 build/C/man2/quotactl.2:232
4223 "/* uint64_t is an unsigned 64-bit integer;\n"
4224 " uint32_t is an unsigned 32-bit integer */\n"
4228 #: build/C/man2/quotactl.2:165
4231 "struct dqblk { /* Definition since Linux 2.4.22 */\n"
4232 " uint64_t dqb_bhardlimit; /* absolute limit on disk\n"
4233 " quota blocks alloc */\n"
4234 " uint64_t dqb_bsoftlimit; /* preferred limit on\n"
4235 " disk quota blocks */\n"
4236 " uint64_t dqb_curspace; /* current quota block\n"
4238 " uint64_t dqb_ihardlimit; /* maximum number of\n"
4239 " allocated inodes */\n"
4240 " uint64_t dqb_isoftlimit; /* preferred inode limit */\n"
4241 " uint64_t dqb_curinodes; /* current number of\n"
4242 " allocated inodes */\n"
4243 " uint64_t dqb_btime; /* time limit for excessive\n"
4245 " uint64_t dqb_itime; /* time limit for excessive\n"
4247 " uint32_t dqb_valid; /* bit mask of QIF_*\n"
4253 #: build/C/man2/quotactl.2:168
4256 "/* Flags in dqb_valid that indicate which fields in\n"
4257 " dqblk structure are valid. */\n"
4261 #: build/C/man2/quotactl.2:179
4264 "#define QIF_BLIMITS 1\n"
4265 "#define QIF_SPACE 2\n"
4266 "#define QIF_ILIMITS 4\n"
4267 "#define QIF_INODES 8\n"
4268 "#define QIF_BTIME 16\n"
4269 "#define QIF_ITIME 32\n"
4270 "#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)\n"
4271 "#define QIF_USAGE (QIF_SPACE | QIF_INODES)\n"
4272 "#define QIF_TIMES (QIF_BTIME | QIF_ITIME)\n"
4273 "#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)\n"
4277 #: build/C/man2/quotactl.2:196
4279 "The I<dqb_valid> field is a bit mask that is set to indicate the entries in "
4280 "the I<dqblk> structure that are valid. Currently, the kernel fills in all "
4281 "entries of the I<dqblk> structure and marks them as valid in the "
4282 "I<dqb_valid> field. Unprivileged users may retrieve only their own quotas; "
4283 "a privileged user (B<CAP_SYS_ADMIN>) can retrieve the quotas of any user."
4287 #: build/C/man2/quotactl.2:196
4289 msgid "B<Q_SETQUOTA>"
4293 #: build/C/man2/quotactl.2:216
4295 "Set quota information for user or group I<id>, using the information "
4296 "supplied in the I<dqblk> structure pointed to by I<addr>. The I<dqb_valid> "
4297 "field of the I<dqblk> structure indicates which entries in the structure "
4298 "have been set by the caller. This operation supersedes the B<Q_SETQLIM> and "
4299 "B<Q_SETUSE> operations in the previous quota interfaces. This operation "
4300 "requires privilege (B<CAP_SYS_ADMIN>)."
4304 #: build/C/man2/quotactl.2:216
4306 msgid "B<Q_GETINFO>"
4310 #: build/C/man2/quotactl.2:227
4312 "Get information (like grace times) about quotafile. The I<addr> argument "
4313 "should be a pointer to a I<dqinfo> structure. This structure is defined in "
4314 "I<E<lt>sys/quota.hE<gt>> as follows:"
4318 #: build/C/man2/quotactl.2:236
4321 "struct dqinfo { /* Defined since kernel 2.4.22 */\n"
4322 " uint64_t dqi_bgrace; /* Time before block soft limit\n"
4323 " becomes hard limit */\n"
4327 #: build/C/man2/quotactl.2:243
4330 " uint64_t dqi_igrace; /* Time before inode soft limit\n"
4331 " becomes hard limit */\n"
4332 " uint32_t dqi_flags; /* Flags for quotafile\n"
4334 " uint32_t dqi_valid;\n"
4339 #: build/C/man2/quotactl.2:245
4341 msgid "/* Bits for dqi_flags */\n"
4345 #: build/C/man2/quotactl.2:247
4347 msgid "/* Quota format QFMT_VFS_OLD */\n"
4351 #: build/C/man2/quotactl.2:249
4353 msgid "#define V1_DQF_RSQUASH\t1 /* Root squash enabled */\n"
4357 #: build/C/man2/quotactl.2:251
4359 msgid "/* Other quota formats have no dqi_flags bits defined */\n"
4363 #: build/C/man2/quotactl.2:254
4366 "/* Flags in dqi_valid that indicate which fields in\n"
4367 " dqinfo structure are valid. */\n"
4371 #: build/C/man2/quotactl.2:259
4374 "# define IIF_BGRACE\t1\n"
4375 "# define IIF_IGRACE\t2\n"
4376 "# define IIF_FLAGS\t4\n"
4377 "# define IIF_ALL\t(IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)\n"
4381 #: build/C/man2/quotactl.2:275
4383 "The I<dqi_valid> field in the I<dqinfo> structure indicates the entries in "
4384 "the structure that are valid. Currently, the kernel fills in all entries of "
4385 "the I<dqinfo> structure and marks them all as valid in the I<dqi_valid> "
4386 "field. The I<id> argument is ignored."
4390 #: build/C/man2/quotactl.2:275
4392 msgid "B<Q_SETINFO>"
4396 #: build/C/man2/quotactl.2:299
4398 "Set information about quotafile. The I<addr> argument should be a pointer "
4399 "to a I<dqinfo> structure. The I<dqi_valid> field of the I<dqinfo> structure "
4400 "indicates the entries in the structure that have been set by the caller. "
4401 "This operation supersedes the B<Q_SETGRACE> and B<Q_SETFLAGS> operations in "
4402 "the previous quota interfaces. The I<id> argument is ignored. This "
4403 "operation requires privilege (B<CAP_SYS_ADMIN>)."
4407 #: build/C/man2/quotactl.2:299
4413 #: build/C/man2/quotactl.2:306
4415 "Get quota format used on the specified file system. The I<addr> argument "
4416 "should be a pointer to a 4-byte buffer where the format number will be "
4421 #: build/C/man2/quotactl.2:306
4427 #: build/C/man2/quotactl.2:317
4429 "Update the on-disk copy of quota usages for a file system. If I<special> is "
4430 "NULL, then all file systems with active quotas are sync'ed. The I<addr> and "
4431 "I<id> arguments are ignored."
4435 #: build/C/man2/quotactl.2:317
4437 msgid "B<Q_GETSTATS>"
4440 #. Q_GETSTATS was removed in kernel 2.4.22.
4442 #: build/C/man2/quotactl.2:337
4444 "Get statistics and other generic information about the quota subsystem. The "
4445 "I<addr> argument should be a pointer to a I<dqstats> structure in which data "
4446 "should be stored. This structure is defined in I<E<lt>sys/quota.hE<gt>.> "
4447 "The I<special> and I<id> arguments are ignored. This operation is obsolete "
4448 "and not supported by recent kernels. Files in I</proc/sys/fs/quota/> carry "
4449 "the information instead."
4453 #: build/C/man2/quotactl.2:340
4455 "For XFS file systems making use of the XFS Quota Manager (XQM), the above "
4456 "commands are bypassed and the following commands are used:"
4460 #: build/C/man2/quotactl.2:340
4462 msgid "B<Q_XQUOTAON>"
4466 #: build/C/man2/quotactl.2:361
4468 "Turn on quotas for an XFS file system. XFS provides the ability to turn "
4469 "on/off quota limit enforcement with quota accounting. Therefore, XFS "
4470 "expects I<addr> to be a pointer to an I<unsigned int> that contains either "
4471 "the flags B<XFS_QUOTA_UDQ_ACCT> and/or B<XFS_QUOTA_UDQ_ENFD> (for user "
4472 "quota), or B<XFS_QUOTA_GDQ_ACCT> and/or B<XFS_QUOTA_GDQ_ENFD> (for group "
4473 "quota), as defined in I<E<lt>xfs/xqm.hE<gt>>. This operation requires "
4474 "privilege (B<CAP_SYS_ADMIN>)."
4478 #: build/C/man2/quotactl.2:361
4480 msgid "B<Q_XQUOTAOFF>"
4484 #: build/C/man2/quotactl.2:372
4486 "Turn off quotas for an XFS file system. As with B<Q_QUOTAON>, XFS file "
4487 "systems expect a pointer to an I<unsigned int> that specifies whether quota "
4488 "accounting and/or limit enforcement need to be turned off. This operation "
4489 "requires privilege (B<CAP_SYS_ADMIN>)."
4493 #: build/C/man2/quotactl.2:372
4495 msgid "B<Q_XGETQUOTA>"
4499 #: build/C/man2/quotactl.2:386
4501 "Get disk quota limits and current usage for user I<id>. The I<addr> "
4502 "argument is a pointer to an I<fs_disk_quota> structure (defined in "
4503 "I<E<lt>xfs/xqm.hE<gt>>). Unprivileged users may retrieve only their own "
4504 "quotas; a privileged user (B<CAP_SYS_ADMIN>) may retrieve the quotas of any "
4509 #: build/C/man2/quotactl.2:386
4511 msgid "B<Q_XSETQLIM>"
4515 #: build/C/man2/quotactl.2:398
4517 "Set disk quota limits for user I<id>. The I<addr> argument is a pointer to "
4518 "an I<fs_disk_quota> structure (defined in I<E<lt>xfs/xqm.hE<gt>>). This "
4519 "operation requires privilege (B<CAP_SYS_ADMIN>)."
4523 #: build/C/man2/quotactl.2:398
4525 msgid "B<Q_XGETQSTAT>"
4529 #: build/C/man2/quotactl.2:406
4531 "Returns an I<fs_quota_stat> structure containing XFS file system specific "
4532 "quota information. This is useful for finding out how much space is used to "
4533 "store quota information, and also to get quotaon/off status of a given local "
4538 #: build/C/man2/quotactl.2:406
4540 msgid "B<Q_XQUOTARM>"
4544 #: build/C/man2/quotactl.2:410
4546 "Free the disk space taken by disk quotas. Quotas must have already been "
4551 #: build/C/man2/quotactl.2:417
4553 "There is no command equivalent to B<Q_SYNC> for XFS since B<sync>(1) writes "
4554 "quota information to disk (in addition to the other file system metadata "
4555 "that it writes out)."
4559 #: build/C/man2/quotactl.2:417
4561 msgid "RETURN VALUES"
4565 #: build/C/man2/quotactl.2:425
4567 "On success, B<quotactl>() returns 0; on error -1 is returned, and I<errno> "
4568 "is set to indicate the error."
4572 #: build/C/man2/quotactl.2:432
4573 msgid "I<addr> or I<special> is invalid."
4577 #: build/C/man2/quotactl.2:438
4578 msgid "I<cmd> or I<type> is invalid."
4582 #: build/C/man2/quotactl.2:438
4588 #: build/C/man2/quotactl.2:445
4589 msgid "The file specified by I<special> or I<addr> does not exist."
4593 #: build/C/man2/quotactl.2:450
4594 msgid "The kernel has not been compiled with the B<CONFIG_QUOTA> option."
4598 #: build/C/man2/quotactl.2:450
4604 #: build/C/man2/quotactl.2:454
4605 msgid "I<special> is not a block device."
4609 #: build/C/man2/quotactl.2:459
4611 "The caller lacked the required privilege (B<CAP_SYS_ADMIN>) for the "
4612 "specified operation."
4616 #: build/C/man2/quotactl.2:463
4618 "No disk quota is found for the indicated user. Quotas have not been turned "
4619 "on for this file system."
4623 #: build/C/man2/quotactl.2:472
4624 msgid "If I<cmd> is B<Q_SETQUOTA>, B<quotactl>() may also set I<errno> to:"
4628 #: build/C/man2/quotactl.2:475
4629 msgid "Specified limits are out of range allowed by quota format."
4633 #: build/C/man2/quotactl.2:484
4634 msgid "If I<cmd> is B<Q_QUOTAON>, B<quotactl>() may also set I<errno> to:"
4638 #: build/C/man2/quotactl.2:493
4640 "The quota file pointed to by I<addr> exists, but is not a regular file; or, "
4641 "the quota file pointed to by I<addr> exists, but is not on the file system "
4642 "pointed to by I<special>."
4646 #: build/C/man2/quotactl.2:499
4647 msgid "B<Q_QUOTAON> attempted, but another B<Q_QUOTAON> had already been performed."
4651 #: build/C/man2/quotactl.2:502
4652 msgid "The quota file is corrupted."
4656 #: build/C/man2/quotactl.2:505
4657 msgid "Specified quota format was not found."
4661 #: build/C/man2/quotactl.2:510
4662 msgid "B<quota>(1), B<getrlimit>(2), B<quotacheck>(8), B<quotaon>(8)"
4666 #: build/C/man2/sendfile.2:15
4672 #: build/C/man2/sendfile.2:15
4678 #: build/C/man2/sendfile.2:18
4679 msgid "sendfile - transfer data between file descriptors"
4683 #: build/C/man2/sendfile.2:20
4684 msgid "B<#include E<lt>sys/sendfile.hE<gt>>"
4687 #. The below is too ugly. Comments about glibc versions belong
4688 #. in the notes, not in the header.
4690 #. .B #include <features.h>
4692 #. .B #if (__GLIBC__==2 && __GLIBC_MINOR__>=1) || __GLIBC__>2
4694 #. .B #include <sys/sendfile.h>
4698 #. .B #include <sys/types.h>
4700 #. .B /* No system prototype before glibc 2.1. */
4702 #. .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \
4703 #. offset ", size_t" " count" )
4707 #: build/C/man2/sendfile.2:43
4709 "B<ssize_t sendfile(int>I< out_fd>B<, int>I< in_fd>B<, off_t *>I<offset>B<, "
4710 "size_t>I< count>B<);>"
4714 #: build/C/man2/sendfile.2:53
4716 "B<sendfile>() copies data between one file descriptor and another. Because "
4717 "this copying is done within the kernel, B<sendfile>() is more efficient "
4718 "than the combination of B<read>(2) and B<write>(2), which would require "
4719 "transferring data to and from user space."
4723 #: build/C/man2/sendfile.2:58
4725 "I<in_fd> should be a file descriptor opened for reading and I<out_fd> should "
4726 "be a descriptor opened for writing."
4730 #: build/C/man2/sendfile.2:79
4732 "If I<offset> is not NULL, then it points to a variable holding the file "
4733 "offset from which B<sendfile>() will start reading data from I<in_fd>. "
4734 "When B<sendfile>() returns, this variable will be set to the offset of the "
4735 "byte following the last byte that was read. If I<offset> is not NULL, then "
4736 "B<sendfile>() does not modify the current file offset of I<in_fd>; "
4737 "otherwise the current file offset is adjusted to reflect the number of bytes "
4738 "read from I<in_fd>."
4742 #: build/C/man2/sendfile.2:86
4744 "If I<offset> is NULL, then data will be read from I<in_fd> starting at the "
4745 "current file offset, and the file offset will be updated by the call."
4749 #: build/C/man2/sendfile.2:89
4750 msgid "I<count> is the number of bytes to copy between the file descriptors."
4754 #: build/C/man2/sendfile.2:96
4756 "The I<in_fd> argument must correspond to a file which supports "
4757 "B<mmap>(2)-like operations (i.e., it cannot be a socket)."
4761 #: build/C/man2/sendfile.2:104
4763 "In Linux kernels before 2.6.33, I<out_fd> must refer to a socket. Since "
4764 "Linux 2.6.33 it can be any file. If it is a regular file, then "
4765 "B<sendfile>() changes the file offset appropriately."
4769 #: build/C/man2/sendfile.2:111
4771 "If the transfer was successful, the number of bytes written to I<out_fd> is "
4772 "returned. On error, -1 is returned, and I<errno> is set appropriately."
4776 #: build/C/man2/sendfile.2:117
4778 "Nonblocking I/O has been selected using B<O_NONBLOCK> and the write would "
4783 #: build/C/man2/sendfile.2:117 build/C/man2/splice.2:143 build/C/man2/vmsplice.2:123
4789 #: build/C/man2/sendfile.2:121
4791 "The input file was not opened for reading or the output file was not opened "
4796 #: build/C/man2/sendfile.2:124
4797 msgid "Bad address."
4801 #: build/C/man2/sendfile.2:130
4803 "Descriptor is not valid or locked, or an B<mmap>(2)-like operation is not "
4804 "available for I<in_fd>."
4808 #: build/C/man2/sendfile.2:134
4809 msgid "Unspecified error while reading from I<in_fd>."
4813 #: build/C/man2/sendfile.2:138
4814 msgid "Insufficient memory to read from I<in_fd>."
4818 #: build/C/man2/sendfile.2:144
4820 "B<sendfile>() is a new feature in Linux 2.2. The include file "
4821 "I<E<lt>sys/sendfile.hE<gt>> is present since glibc 2.1."
4825 #: build/C/man2/sendfile.2:146
4826 msgid "Not specified in POSIX.1-2001, or other standards."
4830 #: build/C/man2/sendfile.2:151
4832 "Other UNIX systems implement B<sendfile>() with different semantics and "
4833 "prototypes. It should not be used in portable programs."
4837 #: build/C/man2/sendfile.2:161
4839 "If you plan to use B<sendfile>() for sending files to a TCP socket, but "
4840 "need to send some header data in front of the file contents, you will find "
4841 "it useful to employ the B<TCP_CORK> option, described in B<tcp>(7), to "
4842 "minimize the number of packets and to tune performance."
4846 #: build/C/man2/sendfile.2:167
4848 "In Linux 2.4 and earlier, I<out_fd> could also refer to a regular file, and "
4849 "B<sendfile>() changed the current offset of that file."
4853 #: build/C/man2/sendfile.2:179
4855 "The original Linux B<sendfile>() system call was not designed to handle "
4856 "large file offsets. Consequently, Linux 2.4 added B<sendfile64>(), with a "
4857 "wider type for the I<offset> argument. The glibc B<sendfile>() wrapper "
4858 "function transparently deals with the kernel differences."
4862 #: build/C/man2/sendfile.2:188
4864 "Applications may wish to fall back to B<read>(2)/B<write>(2) in the case "
4865 "where B<sendfile>() fails with B<EINVAL> or B<ENOSYS>."
4869 #: build/C/man2/sendfile.2:193
4871 "The Linux-specific B<splice>(2) call supports transferring data between "
4872 "arbitrary files (e.g., a pair of sockets)."
4876 #: build/C/man2/sendfile.2:198
4877 msgid "B<mmap>(2), B<open>(2), B<socket>(2), B<splice>(2)"
4881 #: build/C/man2/set_tid_address.2:23
4883 msgid "SET_TID_ADDRESS"
4887 #: build/C/man2/set_tid_address.2:23
4893 #: build/C/man2/set_tid_address.2:26
4894 msgid "set_tid_address - set pointer to thread ID"
4898 #: build/C/man2/set_tid_address.2:29
4900 msgid "B<#include E<lt>linux/unistd.hE<gt>>\n"
4904 #: build/C/man2/set_tid_address.2:31
4906 msgid "B<long set_tid_address(int *>I<tidptr>B<);>\n"
4910 #: build/C/man2/set_tid_address.2:38
4912 "The kernel keeps for each process two values called I<set_child_tid> and "
4913 "I<clear_child_tid> that are NULL by default."
4917 #: build/C/man2/set_tid_address.2:38
4919 msgid "set_child_tid"
4923 #: build/C/man2/set_tid_address.2:48
4925 "If a process is started using B<clone>(2) with the B<CLONE_CHILD_SETTID> "
4926 "flag, I<set_child_tid> is set to I<child_tidptr>, the fifth argument of that "
4931 #: build/C/man2/set_tid_address.2:53
4933 "When I<set_child_tid> is set, the very first thing the new process does is "
4934 "writing its PID at this address."
4938 #: build/C/man2/set_tid_address.2:53
4940 msgid "clear_child_tid"
4944 #: build/C/man2/set_tid_address.2:63
4946 "If a process is started using B<clone>(2) with the B<CLONE_CHILD_CLEARTID> "
4947 "flag, I<clear_child_tid> is set to I<child_tidptr>, the fifth argument of "
4952 #: build/C/man2/set_tid_address.2:70
4954 "The system call B<set_tid_address>() sets the I<clear_child_tid> value for "
4955 "the calling process to I<tidptr>."
4959 #: build/C/man2/set_tid_address.2:80
4961 "When I<clear_child_tid> is set, and the process exits, and the process was "
4962 "sharing memory with other processes or threads, then 0 is written at this "
4963 "address, and a I<futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0);> call is "
4964 "done. (That is, wake a single process waiting on this futex.) Errors are "
4969 #: build/C/man2/set_tid_address.2:83
4970 msgid "B<set_tid_address>() always returns the PID of the calling process."
4974 #: build/C/man2/set_tid_address.2:86
4975 msgid "B<set_tid_address>() always succeeds."
4979 #: build/C/man2/set_tid_address.2:89
4981 "This call is present since Linux 2.5.48. Details as given here are valid "
4982 "since Linux 2.5.49."
4986 #: build/C/man2/set_tid_address.2:94
4987 msgid "B<clone>(2), B<futex>(2)"
4991 #: build/C/man2/splice.2:26
4997 #: build/C/man2/splice.2:26 build/C/man2/tee.2:26 build/C/man2/vmsplice.2:26
5003 #: build/C/man2/splice.2:29
5004 msgid "splice - splice data to/from a pipe"
5008 #: build/C/man2/splice.2:33 build/C/man2/tee.2:33
5011 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
5012 "B<#include E<lt>fcntl.hE<gt>>\n"
5015 #. Return type was long before glibc 2.7
5017 #: build/C/man2/splice.2:38
5020 "B<ssize_t splice(int >I<fd_in>B<, loff_t *>I<off_in>B<, int >I<fd_out>B<,>\n"
5021 "B< loff_t *>I<off_out>B<, size_t >I<len>B<, unsigned int "
5026 #: build/C/man2/splice.2:50
5028 "B<splice>() moves data between two file descriptors without copying between "
5029 "kernel address space and user address space. It transfers up to I<len> "
5030 "bytes of data from the file descriptor I<fd_in> to the file descriptor "
5031 "I<fd_out>, where one of the descriptors must refer to a pipe."
5035 #: build/C/man2/splice.2:80
5037 "If I<fd_in> refers to a pipe, then I<off_in> must be NULL. If I<fd_in> does "
5038 "not refer to a pipe and I<off_in> is NULL, then bytes are read from I<fd_in> "
5039 "starting from the current file offset, and the current file offset is "
5040 "adjusted appropriately. If I<fd_in> does not refer to a pipe and I<off_in> "
5041 "is not NULL, then I<off_in> must point to a buffer which specifies the "
5042 "starting offset from which bytes will be read from I<fd_in>; in this case, "
5043 "the current file offset of I<fd_in> is not changed. Analogous statements "
5044 "apply for I<fd_out> and I<off_out>."
5048 #: build/C/man2/splice.2:85 build/C/man2/vmsplice.2:78
5050 "The I<flags> argument is a bit mask that is composed by ORing together zero "
5051 "or more of the following values:"
5055 #: build/C/man2/splice.2:85 build/C/man2/tee.2:62 build/C/man2/vmsplice.2:78
5057 msgid "B<SPLICE_F_MOVE>"
5061 #: build/C/man2/splice.2:98
5063 "Attempt to move pages instead of copying. This is only a hint to the "
5064 "kernel: pages may still be copied if the kernel cannot move the pages from "
5065 "the pipe, or if the pipe buffers don't refer to full pages. The initial "
5066 "implementation of this flag was buggy: therefore starting in Linux 2.6.21 it "
5067 "is a no-op (but is still permitted in a B<splice>() call); in the future, a "
5068 "correct implementation may be restored."
5072 #: build/C/man2/splice.2:98 build/C/man2/tee.2:68 build/C/man2/vmsplice.2:84
5074 msgid "B<SPLICE_F_NONBLOCK>"
5078 #: build/C/man2/splice.2:107
5080 "Do not block on I/O. This makes the splice pipe operations nonblocking, but "
5081 "B<splice>() may nevertheless block because the file descriptors that are "
5082 "spliced to/from may block (unless they have the B<O_NONBLOCK> flag set)."
5086 #: build/C/man2/splice.2:107 build/C/man2/tee.2:73 build/C/man2/vmsplice.2:91
5088 msgid "B<SPLICE_F_MORE>"
5092 #: build/C/man2/splice.2:121
5094 "More data will be coming in a subsequent splice. This is a helpful hint "
5095 "when the I<fd_out> refers to a socket (see also the description of "
5096 "B<MSG_MORE> in B<send>(2), and the description of B<TCP_CORK> in B<tcp>(7))"
5100 #: build/C/man2/splice.2:121 build/C/man2/tee.2:79 build/C/man2/vmsplice.2:97
5102 msgid "B<SPLICE_F_GIFT>"
5106 #: build/C/man2/splice.2:127
5107 msgid "Unused for B<splice>(); see B<vmsplice>(2)."
5111 #: build/C/man2/splice.2:136
5113 "Upon successful completion, B<splice>() returns the number of bytes spliced "
5114 "to or from the pipe. A return value of 0 means that there was no data to "
5115 "transfer, and it would not make sense to block, because there are no writers "
5116 "connected to the write end of the pipe referred to by I<fd_in>."
5120 #: build/C/man2/splice.2:142
5121 msgid "On error, B<splice>() returns -1 and I<errno> is set to indicate the error."
5125 #: build/C/man2/splice.2:147
5127 "One or both file descriptors are not valid, or do not have proper read-write "
5131 #. The append-mode error is given since 2.6.27; in earlier kernels,
5132 #. splice() in append mode was broken
5134 #: build/C/man2/splice.2:155
5136 "Target file system doesn't support splicing; target file is opened in append "
5137 "mode; neither of the descriptors refers to a pipe; or offset given for "
5138 "nonseekable device."
5142 #: build/C/man2/splice.2:158 build/C/man2/tee.2:114 build/C/man2/vmsplice.2:138
5143 msgid "Out of memory."
5147 #: build/C/man2/splice.2:158
5153 #: build/C/man2/splice.2:165
5155 "Either I<off_in> or I<off_out> was not NULL, but the corresponding file "
5156 "descriptor refers to a pipe."
5160 #: build/C/man2/splice.2:170
5162 "The B<splice>() system call first appeared in Linux 2.6.17; library support "
5163 "was added to glibc in version 2.5."
5167 #: build/C/man2/splice.2:182
5169 "The three system calls B<splice>(), B<vmsplice>(2), and B<tee>(2), provide "
5170 "userspace programs with full control over an arbitrary kernel buffer, "
5171 "implemented within the kernel using the same type of buffer that is used for "
5172 "a pipe. In overview, these system calls perform the following tasks:"
5176 #: build/C/man2/splice.2:182
5182 #: build/C/man2/splice.2:186
5184 "moves data from the buffer to an arbitrary file descriptor, or vice versa, "
5185 "or from one buffer to another."
5189 #: build/C/man2/splice.2:186
5195 #: build/C/man2/splice.2:189
5196 msgid "\"copies\" the data from one buffer to another."
5200 #: build/C/man2/splice.2:189
5202 msgid "B<vmsplice>(2)"
5206 #: build/C/man2/splice.2:192
5207 msgid "\"copies\" data from user space into the buffer."
5211 #. Linus: Now, imagine using the above in a media server, for example.
5212 #. Let's say that a year or two has passed, so that the video drivers
5213 #. have been updated to be able to do the splice thing, and what can
5216 #. - splice from the (mpeg or whatever - let's just assume that the video
5217 #. input is either digital or does the encoding on its own - like they
5218 #. pretty much all do) video input into a pipe (remember: no copies - the
5219 #. video input will just DMA directly into memory, and splice will just
5220 #. set up the pages in the pipe buffer)
5221 #. - tee that pipe to split it up
5222 #. - splice one end to a file (ie "save the compressed stream to disk")
5223 #. - splice the other end to a real-time video decoder window for your
5224 #. real-time viewing pleasure.
5226 #. Linus: Now, the advantage of splice()/tee() is that you can
5227 #. do zero-copy movement of data, and unlike sendfile() you can
5228 #. do it on _arbitrary_ data (and, as shown by "tee()", it's more
5229 #. than just sending the data to somebody else: you can duplicate
5230 #. the data and choose to forward it to two or more different
5231 #. users - for things like logging etc.).
5233 #: build/C/man2/splice.2:223
5235 "Though we talk of copying, actual copies are generally avoided. The kernel "
5236 "does this by implementing a pipe buffer as a set of reference-counted "
5237 "pointers to pages of kernel memory. The kernel creates \"copies\" of pages "
5238 "in a buffer by creating new pointers (for the output buffer) referring to "
5239 "the pages, and increasing the reference counts for the pages: only pointers "
5240 "are copied, not the pages of the buffer."
5244 #: build/C/man2/splice.2:226
5245 msgid "See B<tee>(2)."
5249 #: build/C/man2/splice.2:230
5250 msgid "B<sendfile>(2), B<tee>(2), B<vmsplice>(2)"
5254 #: build/C/man2/tee.2:26
5260 #: build/C/man2/tee.2:29
5261 msgid "tee - duplicating pipe content"
5265 #: build/C/man2/tee.2:36
5268 "B<ssize_t tee(int >I<fd_in>B<, int >I<fd_out>B<, size_t >I<len>B<, unsigned "
5269 "int >I<flags>B<);>\n"
5272 #. Example programs http://brick.kernel.dk/snaps
5275 #. add a "tee(in, out1, out2)" system call that duplicates the pages
5276 #. (again, incrementing their reference count, not copying the data) from
5277 #. one pipe to two other pipes.
5279 #: build/C/man2/tee.2:56
5281 "B<tee>() duplicates up to I<len> bytes of data from the pipe referred to by "
5282 "the file descriptor I<fd_in> to the pipe referred to by the file descriptor "
5283 "I<fd_out>. It does not consume the data that is duplicated from I<fd_in>; "
5284 "therefore, that data can be copied by a subsequent B<splice>(2)."
5288 #: build/C/man2/tee.2:62
5290 "I<flags> is a series of modifier flags, which share the name space with "
5291 "B<splice>(2) and B<vmsplice>(2):"
5295 #: build/C/man2/tee.2:68
5296 msgid "Currently has no effect for B<tee>(); see B<splice>(2)."
5299 #. Not used for vmsplice
5300 #. May be in the future -- therefore EAGAIN
5302 #: build/C/man2/tee.2:73 build/C/man2/vmsplice.2:91
5303 msgid "Do not block on I/O; see B<splice>(2) for further details."
5307 #: build/C/man2/tee.2:79
5309 "Currently has no effect for B<tee>(), but may be implemented in the future; "
5314 #: build/C/man2/tee.2:85
5315 msgid "Unused for B<tee>(); see B<vmsplice>(2)."
5319 #: build/C/man2/tee.2:94
5321 "Upon successful completion, B<tee>() returns the number of bytes that were "
5322 "duplicated between the input and output. A return value of 0 means that "
5323 "there was no data to transfer, and it would not make sense to block, because "
5324 "there are no writers connected to the write end of the pipe referred to by "
5329 #: build/C/man2/tee.2:100
5330 msgid "On error, B<tee>() returns -1 and I<errno> is set to indicate the error."
5334 #: build/C/man2/tee.2:111
5336 "I<fd_in> or I<fd_out> does not refer to a pipe; or I<fd_in> and I<fd_out> "
5337 "refer to the same pipe."
5341 #: build/C/man2/tee.2:119
5343 "The B<tee>() system call first appeared in Linux 2.6.17; library support "
5344 "was added to glibc in version 2.5."
5348 #: build/C/man2/tee.2:130
5350 "Conceptually, B<tee>() copies the data between the two pipes. In reality "
5351 "no real data copying takes place though: under the covers, B<tee>() assigns "
5352 "data in the output by merely grabbing a reference to the input."
5356 #: build/C/man2/tee.2:136
5358 "The following example implements a basic B<tee>(1) program using the "
5359 "B<tee>() system call."
5363 #: build/C/man2/tee.2:145
5366 "#define _GNU_SOURCE\n"
5367 "#include E<lt>fcntl.hE<gt>\n"
5368 "#include E<lt>stdio.hE<gt>\n"
5369 "#include E<lt>stdlib.hE<gt>\n"
5370 "#include E<lt>unistd.hE<gt>\n"
5371 "#include E<lt>errno.hE<gt>\n"
5372 "#include E<lt>limits.hE<gt>\n"
5376 #: build/C/man2/tee.2:151
5380 "main(int argc, char *argv[])\n"
5387 #: build/C/man2/tee.2:156
5390 " if (argc != 2) {\n"
5391 " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
5392 " exit(EXIT_FAILURE);\n"
5397 #: build/C/man2/tee.2:162
5400 " fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);\n"
5401 " if (fd == -1) {\n"
5402 " perror(\"open\");\n"
5403 " exit(EXIT_FAILURE);\n"
5408 #: build/C/man2/tee.2:169
5413 " * tee stdin to stdout.\n"
5415 " len = tee(STDIN_FILENO, STDOUT_FILENO,\n"
5416 " INT_MAX, SPLICE_F_NONBLOCK);\n"
5420 #: build/C/man2/tee.2:178
5423 " if (len E<lt> 0) {\n"
5424 " if (errno == EAGAIN)\n"
5426 " perror(\"tee\");\n"
5427 " exit(EXIT_FAILURE);\n"
5434 #: build/C/man2/tee.2:192
5438 " * Consume stdin by splicing it to a file.\n"
5440 " while (len E<gt> 0) {\n"
5441 " slen = splice(STDIN_FILENO, NULL, fd, NULL,\n"
5442 " len, SPLICE_F_MOVE);\n"
5443 " if (slen E<lt> 0) {\n"
5444 " perror(\"splice\");\n"
5453 #: build/C/man2/tee.2:196
5457 " exit(EXIT_SUCCESS);\n"
5462 #: build/C/man2/tee.2:200
5463 msgid "B<splice>(2), B<vmsplice>(2)"
5467 #: build/C/man2/vm86.2:26
5473 #: build/C/man2/vm86.2:26
5479 #: build/C/man2/vm86.2:29
5480 msgid "vm86old, vm86 - enter virtual 8086 mode"
5484 #: build/C/man2/vm86.2:31
5485 msgid "B<#include E<lt>sys/vm86.hE<gt>>"
5489 #: build/C/man2/vm86.2:33
5490 msgid "B<int vm86old(struct vm86_struct *>I<info>B<);>"
5494 #: build/C/man2/vm86.2:35
5495 msgid "B<int vm86(unsigned long >I<fn>B<, struct vm86plus_struct *>I<v86>B<);>"
5499 #: build/C/man2/vm86.2:46
5501 "The system call B<vm86>() was introduced in Linux 0.97p2. In Linux 2.1.15 "
5502 "and 2.0.28 it was renamed to B<vm86old>(), and a new B<vm86>() was "
5503 "introduced. The definition of I<struct vm86_struct> was changed in 1.1.8 "
5508 #: build/C/man2/vm86.2:50
5510 "These calls cause the process to enter VM86 mode (virtual-8086 in Intel "
5511 "literature), and are used by B<dosemu>."
5515 #: build/C/man2/vm86.2:52
5516 msgid "VM86 mode is an emulation of real mode within a protected mode task."
5520 #: build/C/man2/vm86.2:62
5522 "This return value is specific to i386 and indicates a problem with getting "
5527 #: build/C/man2/vm86.2:66
5529 "This return value indicates the call is not implemented on the present "
5534 #: build/C/man2/vm86.2:71
5536 "Saved kernel stack exists. (This is a kernel sanity check; the saved stack "
5537 "should only exist within vm86 mode itself.)"
5541 #: build/C/man2/vm86.2:74
5543 "This call is specific to Linux on 32-bit Intel processors, and should not be "
5544 "used in programs intended to be portable."
5548 #: build/C/man2/vmsplice.2:26
5554 #: build/C/man2/vmsplice.2:29
5555 msgid "vmsplice - splice user pages into a pipe"
5559 #: build/C/man2/vmsplice.2:34
5562 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
5563 "B<#include E<lt>fcntl.hE<gt>>\n"
5564 "B<#include E<lt>sys/uio.hE<gt>>\n"
5568 #: build/C/man2/vmsplice.2:37
5571 "B<ssize_t vmsplice(int >I<fd>B<, const struct iovec *>I<iov>B<,>\n"
5572 "B< unsigned long >I<nr_segs>B<, unsigned int "
5576 #. Linus: vmsplice() system call to basically do a "write to
5577 #. the buffer", but using the reference counting and VM traversal
5578 #. to actually fill the buffer. This means that the user needs to
5579 #. be careful not to reuse the user-space buffer it spliced into
5580 #. the kernel-space one (contrast this to "write()", which copies
5581 #. the actual data, and you can thus reuse the buffer immediately
5582 #. after a successful write), but that is often easy to do.
5584 #: build/C/man2/vmsplice.2:57
5586 "The B<vmsplice>() system call maps I<nr_segs> ranges of user memory "
5587 "described by I<iov> into a pipe. The file descriptor I<fd> must refer to a "
5592 #: build/C/man2/vmsplice.2:64
5594 "The pointer I<iov> points to an array of I<iovec> structures as defined in "
5595 "I<E<lt>sys/uio.hE<gt>>:"
5599 #: build/C/man2/vmsplice.2:71
5603 " void *iov_base; /* Starting address */\n"
5604 " size_t iov_len; /* Number of bytes */\n"
5609 #: build/C/man2/vmsplice.2:84
5610 msgid "Unused for B<vmsplice>(); see B<splice>(2)."
5614 #: build/C/man2/vmsplice.2:97
5616 "Currently has no effect for B<vmsplice>(), but may be implemented in the "
5617 "future; see B<splice>(2)."
5620 #. FIXME Explain the following line in a little more detail:
5621 #. .... if we expect to later SPLICE_F_MOVE to the cache.
5623 #: build/C/man2/vmsplice.2:113
5625 "The user pages are a gift to the kernel. The application may not modify "
5626 "this memory ever, or page cache and on-disk data may differ. Gifting pages "
5627 "to the kernel means that a subsequent B<splice>(2) B<SPLICE_F_MOVE> can "
5628 "successfully move the pages; if this flag is not specified, then a "
5629 "subsequent B<splice>(2) B<SPLICE_F_MOVE> must copy the pages. Data must "
5630 "also be properly page aligned, both in memory and length."
5634 #: build/C/man2/vmsplice.2:122
5636 "Upon successful completion, B<vmsplice>() returns the number of bytes "
5637 "transferred to the pipe. On error, B<vmsplice>() returns -1 and I<errno> "
5638 "is set to indicate the error."
5642 #: build/C/man2/vmsplice.2:127
5643 msgid "I<fd> either not valid, or doesn't refer to a pipe."
5647 #: build/C/man2/vmsplice.2:135
5649 "I<nr_segs> is 0 or greater than B<IOV_MAX>; or memory not aligned if "
5650 "B<SPLICE_F_GIFT> set."
5654 #: build/C/man2/vmsplice.2:143
5656 "The B<vmsplice>() system call first appeared in Linux 2.6.17; library "
5657 "support was added to glibc in version 2.5."
5661 #: build/C/man2/vmsplice.2:154
5663 "B<vmsplice>() follows the other vectorized read/write type functions when "
5664 "it comes to limitations on number of segments being passed in. This limit "
5665 "is B<IOV_MAX> as defined in I<E<lt>limits.hE<gt>>. At the time of this "
5666 "writing, that limit is 1024."
5670 #: build/C/man2/vmsplice.2:157
5671 msgid "B<splice>(2), B<tee>(2)"