OSDN Git Service

3658c64d00a3658683e5c3961b0a6c3013eb55ea
[linuxjm/LDP_man-pages.git] / po4a / man2 / po / man2.pot
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2012-05-10 20:02+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man2/arch_prctl.2:24
21 #, no-wrap
22 msgid "ARCH_PRCTL"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man2/arch_prctl.2:24
27 #, no-wrap
28 msgid "2007-12-26"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man2/arch_prctl.2:24 build/C/man2/futex.2:17 build/C/man2/kexec_load.2:25 build/C/man2/lookup_dcookie.2:27 build/C/man2/modify_ldt.2:25 build/C/man2/nfsservctl.2:8 build/C/man2/outb.2:28 build/C/man2/pciconfig_read.2:5 build/C/man2/personality.2:30 build/C/man2/pivot_root.2:7 build/C/man2/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
33 #, no-wrap
34 msgid "Linux"
35 msgstr ""
36
37 #. type: TH
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
39 #, no-wrap
40 msgid "Linux Programmer's Manual"
41 msgstr ""
42
43 #. type: SH
44 #: build/C/man2/arch_prctl.2:25 build/C/man2/futex.2:18 build/C/man2/kexec_load.2:26 build/C/man2/lookup_dcookie.2:28 build/C/man2/modify_ldt.2:26 build/C/man2/nfsservctl.2:9 build/C/man2/outb.2:29 build/C/man2/pciconfig_read.2:6 build/C/man2/personality.2:31 build/C/man2/pivot_root.2:8 build/C/man2/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
45 #, no-wrap
46 msgid "NAME"
47 msgstr ""
48
49 #. type: Plain text
50 #: build/C/man2/arch_prctl.2:27
51 msgid "arch_prctl - set architecture-specific thread state"
52 msgstr ""
53
54 #. type: SH
55 #: build/C/man2/arch_prctl.2:27 build/C/man2/futex.2:20 build/C/man2/kexec_load.2:28 build/C/man2/lookup_dcookie.2:30 build/C/man2/modify_ldt.2:28 build/C/man2/nfsservctl.2:11 build/C/man2/pciconfig_read.2:8 build/C/man2/personality.2:33 build/C/man2/pivot_root.2:10 build/C/man2/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
56 #, no-wrap
57 msgid "SYNOPSIS"
58 msgstr ""
59
60 #. type: Plain text
61 #: build/C/man2/arch_prctl.2:30
62 #, no-wrap
63 msgid "B<#include E<lt>asm/prctl.hE<gt>>\n"
64 msgstr ""
65
66 #. type: Plain text
67 #: build/C/man2/arch_prctl.2:32
68 #, no-wrap
69 msgid "B<#include E<lt>sys/prctl.hE<gt>>\n"
70 msgstr ""
71
72 #. type: Plain text
73 #: build/C/man2/arch_prctl.2:35
74 #, no-wrap
75 msgid ""
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"
78 msgstr ""
79
80 #.  Return type was long before glibc 2.7
81 #. type: SH
82 #: build/C/man2/arch_prctl.2:36 build/C/man2/futex.2:32 build/C/man2/kexec_load.2:35 build/C/man2/lookup_dcookie.2:32 build/C/man2/modify_ldt.2:34 build/C/man2/nfsservctl.2:18 build/C/man2/outb.2:33 build/C/man2/pciconfig_read.2:19 build/C/man2/personality.2:37 build/C/man2/pivot_root.2:12 build/C/man2/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
83 #, no-wrap
84 msgid "DESCRIPTION"
85 msgstr ""
86
87 #. type: Plain text
88 #: build/C/man2/arch_prctl.2:51
89 msgid ""
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."
94 msgstr ""
95
96 #. type: Plain text
97 #: build/C/man2/arch_prctl.2:53
98 msgid "Sub functions for x86-64 are:"
99 msgstr ""
100
101 #. type: TP
102 #: build/C/man2/arch_prctl.2:53
103 #, no-wrap
104 msgid "B<ARCH_SET_FS>"
105 msgstr ""
106
107 #. type: Plain text
108 #: build/C/man2/arch_prctl.2:59
109 msgid "Set the 64-bit base for the I<FS> register to I<addr>."
110 msgstr ""
111
112 #. type: TP
113 #: build/C/man2/arch_prctl.2:59
114 #, no-wrap
115 msgid "B<ARCH_GET_FS>"
116 msgstr ""
117
118 #. type: Plain text
119 #: build/C/man2/arch_prctl.2:67
120 msgid ""
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>."
123 msgstr ""
124
125 #. type: TP
126 #: build/C/man2/arch_prctl.2:67
127 #, no-wrap
128 msgid "B<ARCH_SET_GS>"
129 msgstr ""
130
131 #. type: Plain text
132 #: build/C/man2/arch_prctl.2:73
133 msgid "Set the 64-bit base for the I<GS> register to I<addr>."
134 msgstr ""
135
136 #. type: TP
137 #: build/C/man2/arch_prctl.2:73
138 #, no-wrap
139 msgid "B<ARCH_GET_GS>"
140 msgstr ""
141
142 #. type: Plain text
143 #: build/C/man2/arch_prctl.2:81
144 msgid ""
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>."
147 msgstr ""
148
149 #. type: SH
150 #: build/C/man2/arch_prctl.2:81 build/C/man2/futex.2:173 build/C/man2/kexec_load.2:110 build/C/man2/lookup_dcookie.2:43 build/C/man2/modify_ldt.2:96 build/C/man2/nfsservctl.2: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
151 #, no-wrap
152 msgid "RETURN VALUE"
153 msgstr ""
154
155 #. type: Plain text
156 #: build/C/man2/arch_prctl.2:87
157 msgid ""
158 "On success, B<arch_prctl>()  returns 0; on error, -1 is returned, and "
159 "I<errno> is set to indicate the error."
160 msgstr ""
161
162 #. type: SH
163 #: build/C/man2/arch_prctl.2:87 build/C/man2/futex.2:210 build/C/man2/kexec_load.2:117 build/C/man2/lookup_dcookie.2:50 build/C/man2/modify_ldt.2:106 build/C/man2/pciconfig_read.2:74 build/C/man2/personality.2:62 build/C/man2/pivot_root.2:99 build/C/man2/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
164 #, no-wrap
165 msgid "ERRORS"
166 msgstr ""
167
168 #. type: TP
169 #: build/C/man2/arch_prctl.2:88 build/C/man2/futex.2:222 build/C/man2/lookup_dcookie.2:51 build/C/man2/modify_ldt.2:107 build/C/man2/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
170 #, no-wrap
171 msgid "B<EFAULT>"
172 msgstr ""
173
174 #. type: Plain text
175 #: build/C/man2/arch_prctl.2:92
176 msgid ""
177 "I<addr> points to an unmapped address or is outside the process address "
178 "space."
179 msgstr ""
180
181 #. type: TP
182 #: build/C/man2/arch_prctl.2:92 build/C/man2/futex.2:227 build/C/man2/kexec_load.2:122 build/C/man2/lookup_dcookie.2:54 build/C/man2/modify_ldt.2:111 build/C/man2/pciconfig_read.2:75 build/C/man2/personality.2:63 build/C/man2/pivot_root.2:108 build/C/man2/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
183 #, no-wrap
184 msgid "B<EINVAL>"
185 msgstr ""
186
187 #. type: Plain text
188 #: build/C/man2/arch_prctl.2:96
189 msgid "I<code> is not a valid subcommand."
190 msgstr ""
191
192 #. type: TP
193 #: build/C/man2/arch_prctl.2:96 build/C/man2/kexec_load.2:129 build/C/man2/lookup_dcookie.2:65 build/C/man2/pciconfig_read.2:102 build/C/man2/pivot_root.2:114 build/C/man2/process_vm_readv.2:265 build/C/man2/ptrace.2:1619 build/C/man2/quotactl.2:454 build/C/man2/vm86.2:66
194 #, no-wrap
195 msgid "B<EPERM>"
196 msgstr ""
197
198 #.  .SH AUTHOR
199 #.  Man page written by Andi Kleen.
200 #. type: Plain text
201 #: build/C/man2/arch_prctl.2:102
202 msgid "I<addr> is outside the process address space."
203 msgstr ""
204
205 #. type: SH
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:169 build/C/man2/tee.2:118 build/C/man2/vm86.2:71 build/C/man2/vmsplice.2:142
207 #, no-wrap
208 msgid "CONFORMING TO"
209 msgstr ""
210
211 #. type: Plain text
212 #: build/C/man2/arch_prctl.2:106
213 msgid ""
214 "B<arch_prctl>()  is a Linux/x86-64 extension and should not be used in "
215 "programs intended to be portable."
216 msgstr ""
217
218 #. type: SH
219 #: build/C/man2/arch_prctl.2:106 build/C/man2/futex.2:249 build/C/man2/kexec_load.2:140 build/C/man2/lookup_dcookie.2:81 build/C/man2/modify_ldt.2:131 build/C/man2/pivot_root.2:125 build/C/man2/process_vm_readv.2:279 build/C/man2/ptrace.2:1639 build/C/man2/sendfile.2:151 build/C/man2/splice.2:171 build/C/man2/tee.2:120 build/C/man2/vmsplice.2:144
220 #, no-wrap
221 msgid "NOTES"
222 msgstr ""
223
224 #. type: Plain text
225 #: build/C/man2/arch_prctl.2:109
226 msgid ""
227 "B<arch_prctl>()  is only supported on Linux/x86-64 for 64-bit programs "
228 "currently."
229 msgstr ""
230
231 #. type: Plain text
232 #: build/C/man2/arch_prctl.2:111
233 msgid "The 64-bit base changes when a new 32-bit segment selector is loaded."
234 msgstr ""
235
236 #. type: Plain text
237 #: build/C/man2/arch_prctl.2:114
238 msgid "B<ARCH_SET_GS> is disabled in some kernels."
239 msgstr ""
240
241 #. type: Plain text
242 #: build/C/man2/arch_prctl.2:129
243 msgid ""
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."
250 msgstr ""
251
252 #. type: Plain text
253 #: build/C/man2/arch_prctl.2:134
254 msgid ""
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 "
257 "versions."
258 msgstr ""
259
260 #. type: Plain text
261 #: build/C/man2/arch_prctl.2:137
262 msgid "I<FS> may be already used by the threading library."
263 msgstr ""
264
265 #. type: SH
266 #: build/C/man2/arch_prctl.2:137 build/C/man2/futex.2:263 build/C/man2/kexec_load.2:155 build/C/man2/modify_ldt.2:134 build/C/man2/outb.2:67 build/C/man2/pciconfig_read.2:109 build/C/man2/pivot_root.2:137 build/C/man2/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:225 build/C/man2/tee.2:196 build/C/man2/vmsplice.2:153
267 #, no-wrap
268 msgid "SEE ALSO"
269 msgstr ""
270
271 #. type: Plain text
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)"
274 msgstr ""
275
276 #. type: Plain text
277 #: build/C/man2/arch_prctl.2:144
278 msgid "AMD X86-64 Programmer's manual"
279 msgstr ""
280
281 #. type: SH
282 #: build/C/man2/arch_prctl.2:144 build/C/man2/futex.2:274 build/C/man2/kexec_load.2:158 build/C/man2/lookup_dcookie.2:88 build/C/man2/modify_ldt.2:136 build/C/man2/nfsservctl.2: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:229 build/C/man2/tee.2:199 build/C/man2/vm86.2:74 build/C/man2/vmsplice.2:156
283 #, no-wrap
284 msgid "COLOPHON"
285 msgstr ""
286
287 #. type: Plain text
288 #: build/C/man2/arch_prctl.2:151 build/C/man2/futex.2:281 build/C/man2/kexec_load.2:165 build/C/man2/lookup_dcookie.2:95 build/C/man2/modify_ldt.2:143 build/C/man2/nfsservctl.2: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:236 build/C/man2/tee.2:206 build/C/man2/vm86.2:81 build/C/man2/vmsplice.2:163
289 msgid ""
290 "This page is part of release 3.40 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/."
293 msgstr ""
294
295 #. type: TH
296 #: build/C/man2/futex.2:17
297 #, no-wrap
298 msgid "FUTEX"
299 msgstr ""
300
301 #. type: TH
302 #: build/C/man2/futex.2:17
303 #, no-wrap
304 msgid "2010-08-29"
305 msgstr ""
306
307 #. type: Plain text
308 #: build/C/man2/futex.2:20
309 msgid "futex - Fast Userspace Locking system call"
310 msgstr ""
311
312 #. type: Plain text
313 #: build/C/man2/futex.2:25
314 #, no-wrap
315 msgid ""
316 "B<#include E<lt>linux/futex.hE<gt>>\n"
317 "B<#include E<lt>sys/time.hE<gt>>\n"
318 msgstr ""
319
320 #. type: Plain text
321 #: build/C/man2/futex.2:28
322 #, no-wrap
323 msgid ""
324 "B<int futex(int *>I<uaddr>B<, int >I<op>B<, int >I<val>B<, const struct "
325 "timespec *>I<timeout>B<,>\n"
326 msgstr ""
327
328 #.  int *? void *? u32 *?
329 #. type: Plain text
330 #: build/C/man2/futex.2:31
331 #, no-wrap
332 msgid "B<          int *>I<uaddr2>B<, int >I<val3>B<);>\n"
333 msgstr ""
334
335 #. type: Plain text
336 #: build/C/man2/futex.2:48
337 msgid ""
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)."
345 msgstr ""
346
347 #. type: Plain text
348 #: build/C/man2/futex.2:55
349 msgid ""
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 "
353 "process."
354 msgstr ""
355
356 #. type: Plain text
357 #: build/C/man2/futex.2:62
358 msgid ""
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."
363 msgstr ""
364
365 #. type: Plain text
366 #: build/C/man2/futex.2:70
367 msgid ""
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>."
371 msgstr ""
372
373 #. type: Plain text
374 #: build/C/man2/futex.2:72
375 msgid "Five operations are currently defined:"
376 msgstr ""
377
378 #. type: TP
379 #: build/C/man2/futex.2:72 build/C/man2/futex.2:177
380 #, no-wrap
381 msgid "B<FUTEX_WAIT>"
382 msgstr ""
383
384 #. type: Plain text
385 #: build/C/man2/futex.2:90
386 msgid ""
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."
392 msgstr ""
393
394 #. type: Plain text
395 #: build/C/man2/futex.2:98
396 msgid ""
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."
400 msgstr ""
401
402 #. type: TP
403 #: build/C/man2/futex.2:98 build/C/man2/futex.2:194
404 #, no-wrap
405 msgid "B<FUTEX_WAKE>"
406 msgstr ""
407
408 #. type: Plain text
409 #: build/C/man2/futex.2:109
410 msgid ""
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."
414 msgstr ""
415
416 #. type: Plain text
417 #: build/C/man2/futex.2:115
418 msgid ""
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 "
421 "it is available)."
422 msgstr ""
423
424 #. type: TP
425 #: build/C/man2/futex.2:115
426 #, no-wrap
427 msgid "B<FUTEX_FD> (present up to and including Linux 2.6.25)"
428 msgstr ""
429
430 #.  , suitable for .BR poll (2).
431 #. type: Plain text
432 #: build/C/man2/futex.2:131
433 msgid ""
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."
439 msgstr ""
440
441 #. type: Plain text
442 #: build/C/man2/futex.2:136
443 msgid ""
444 "To prevent race conditions, the caller should test if the futex has been "
445 "upped after B<FUTEX_FD> returns."
446 msgstr ""
447
448 #. type: Plain text
449 #: build/C/man2/futex.2:140
450 msgid ""
451 "Because it was inherently racy, B<FUTEX_FD> has been removed from Linux "
452 "2.6.26 onward."
453 msgstr ""
454
455 #. type: TP
456 #: build/C/man2/futex.2:140
457 #, no-wrap
458 msgid "B<FUTEX_REQUEUE> (since Linux 2.5.70)"
459 msgstr ""
460
461 #. type: Plain text
462 #: build/C/man2/futex.2:155
463 msgid ""
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."
469 msgstr ""
470
471 #. type: TP
472 #: build/C/man2/futex.2:155
473 #, no-wrap
474 msgid "B<FUTEX_CMP_REQUEUE> (since Linux 2.6.7)"
475 msgstr ""
476
477 #. type: Plain text
478 #: build/C/man2/futex.2:173
479 msgid ""
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."
485 msgstr ""
486
487 #. type: Plain text
488 #: build/C/man2/futex.2:177
489 msgid ""
490 "Depending on which operation was executed, the returned value for a "
491 "successful call can have differing meanings."
492 msgstr ""
493
494 #. type: Plain text
495 #: build/C/man2/futex.2:194
496 msgid ""
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>."
502 msgstr ""
503
504 #. type: Plain text
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."
507 msgstr ""
508
509 #. type: TP
510 #: build/C/man2/futex.2:197
511 #, no-wrap
512 msgid "B<FUTEX_FD>"
513 msgstr ""
514
515 #. type: Plain text
516 #: build/C/man2/futex.2:200
517 msgid "Returns the new file descriptor associated with the futex."
518 msgstr ""
519
520 #. type: TP
521 #: build/C/man2/futex.2:200
522 #, no-wrap
523 msgid "B<FUTEX_REQUEUE>"
524 msgstr ""
525
526 #. type: TP
527 #: build/C/man2/futex.2:203
528 #, no-wrap
529 msgid "B<FUTEX_CMP_REQUEUE>"
530 msgstr ""
531
532 #. type: Plain text
533 #: build/C/man2/futex.2:210
534 msgid ""
535 "In the event of an error, all operations return -1, and set I<errno> to "
536 "indicate the error."
537 msgstr ""
538
539 #. type: TP
540 #: build/C/man2/futex.2:211 build/C/man2/quotactl.2:484
541 #, no-wrap
542 msgid "B<EACCES>"
543 msgstr ""
544
545 #. type: Plain text
546 #: build/C/man2/futex.2:214
547 msgid "No read access to futex memory."
548 msgstr ""
549
550 #. type: TP
551 #: build/C/man2/futex.2:214 build/C/man2/sendfile.2:112
552 #, no-wrap
553 msgid "B<EAGAIN>"
554 msgstr ""
555
556 #. type: Plain text
557 #: build/C/man2/futex.2:222
558 msgid ""
559 "B<FUTEX_CMP_REQUEUE> found an unexpected futex value.  (This probably "
560 "indicates a race; use the safe B<FUTEX_WAKE> now.)"
561 msgstr ""
562
563 #. type: Plain text
564 #: build/C/man2/futex.2:227
565 msgid "Error in getting I<timeout> information from userspace."
566 msgstr ""
567
568 #. type: Plain text
569 #: build/C/man2/futex.2:230
570 msgid "An operation was not defined or error in page alignment."
571 msgstr ""
572
573 #. type: TP
574 #: build/C/man2/futex.2:230
575 #, no-wrap
576 msgid "B<ENFILE>"
577 msgstr ""
578
579 #. type: Plain text
580 #: build/C/man2/futex.2:233
581 msgid "The system limit on the total number of open files has been reached."
582 msgstr ""
583
584 #. type: TP
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
586 #, no-wrap
587 msgid "B<ENOSYS>"
588 msgstr ""
589
590 #. type: Plain text
591 #: build/C/man2/futex.2:237
592 msgid "Invalid operation specified in I<op>."
593 msgstr ""
594
595 #. type: SH
596 #: build/C/man2/futex.2:237 build/C/man2/kexec_load.2:134 build/C/man2/lookup_dcookie.2:73 build/C/man2/pivot_root.2:119 build/C/man2/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
597 #, no-wrap
598 msgid "VERSIONS"
599 msgstr ""
600
601 #. type: Plain text
602 #: build/C/man2/futex.2:247
603 msgid ""
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."
609 msgstr ""
610
611 #. type: Plain text
612 #: build/C/man2/futex.2:249 build/C/man2/kexec_load.2:140 build/C/man2/set_tid_address.2:91 build/C/man2/splice.2:171 build/C/man2/tee.2:120 build/C/man2/vmsplice.2:144
613 msgid "This system call is Linux-specific."
614 msgstr ""
615
616 #.  .SH "AUTHORS"
617 #.  .PP
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.
623 #. type: Plain text
624 #: build/C/man2/futex.2:263
625 msgid ""
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."
630 msgstr ""
631
632 #. type: Plain text
633 #: build/C/man2/futex.2:265
634 msgid "B<futex>(7)"
635 msgstr ""
636
637 #. type: Plain text
638 #: build/C/man2/futex.2:268
639 msgid ""
640 "I<Fuss, Futexes and Furwocks: Fast Userlevel Locking in Linux> (proceedings "
641 "of the Ottawa Linux Symposium 2002), online at"
642 msgstr ""
643
644 #. type: Plain text
645 #: build/C/man2/futex.2:270
646 msgid "http://kernel.org/doc/ols/2002/ols2002-pages-479-495.pdf"
647 msgstr ""
648
649 #. type: Plain text
650 #: build/C/man2/futex.2:272
651 msgid "Futex example library, futex-*.tar.bz2 at"
652 msgstr ""
653
654 #. type: Plain text
655 #: build/C/man2/futex.2:274
656 msgid "ftp://ftp.nl.kernel.org/pub/linux/kernel/people/rusty/."
657 msgstr ""
658
659 #. type: TH
660 #: build/C/man2/kexec_load.2:25
661 #, no-wrap
662 msgid "KEXEC_LOAD"
663 msgstr ""
664
665 #. type: TH
666 #: build/C/man2/kexec_load.2:25
667 #, no-wrap
668 msgid "2010-11-04"
669 msgstr ""
670
671 #. type: Plain text
672 #: build/C/man2/kexec_load.2:28
673 msgid "kexec_load - load a new kernel for later execution"
674 msgstr ""
675
676 #. type: Plain text
677 #: build/C/man2/kexec_load.2:30
678 msgid "B<#include E<lt>linux/kexec.hE<gt>>"
679 msgstr ""
680
681 #. type: Plain text
682 #: build/C/man2/kexec_load.2:32
683 msgid ""
684 "B<long kexec_load(unsigned long >I<entry>B<, unsigned long "
685 ">I<nr_segments>B<,>"
686 msgstr ""
687
688 #. type: Plain text
689 #: build/C/man2/kexec_load.2:35
690 msgid "B< struct kexec_segment *>I<segments>B<, unsigned long >I<flags>B<);>"
691 msgstr ""
692
693 #. type: Plain text
694 #: build/C/man2/kexec_load.2:40
695 msgid ""
696 "The B<kexec_load>()  system call loads a new kernel that can be executed "
697 "later by B<reboot>(2)."
698 msgstr ""
699
700 #. type: Plain text
701 #: build/C/man2/kexec_load.2:46
702 msgid ""
703 "The I<flags> argument is a mask whose high-order bits control the operation "
704 "of the call.  The following values can be specified in I<flags>:"
705 msgstr ""
706
707 #. type: TP
708 #: build/C/man2/kexec_load.2:46
709 #, no-wrap
710 msgid "B<KEXEC_ON_CRASH> (since Linux 2.6.13)"
711 msgstr ""
712
713 #.  FIXME figure out how this is really used
714 #. type: Plain text
715 #: build/C/man2/kexec_load.2:50
716 msgid "Execute the new kernel automatically on a system crash."
717 msgstr ""
718
719 #. type: TP
720 #: build/C/man2/kexec_load.2:50
721 #, no-wrap
722 msgid "B<KEXEC_PRESERVE_CONTEXT> (since Linux 2.7.27)"
723 msgstr ""
724
725 #. type: Plain text
726 #: build/C/man2/kexec_load.2:60
727 msgid ""
728 "Preserve the system hardware and software states before executing the new "
729 "kernel.  This could be used for system suspend.  This flag is only available "
730 "if the kernel was configured with B<CONFIG_KEXEC_JUMP>, and is only "
731 "effective if I<nr_segments> is greater than 0."
732 msgstr ""
733
734 #. type: Plain text
735 #: build/C/man2/kexec_load.2:80
736 msgid ""
737 "The low-order bits of I<flags> contain the architecture of the "
738 "to-be-executed kernel.  Specify (OR) the constant B<KEXEC_ARCH_DEFAULT> to "
739 "use the current architecture, or one of the following architecture constants "
740 "B<KEXEC_ARCH_386>, B<KEXEC_ARCH_X86_64>, B<KEXEC_ARCH_PPC>, "
741 "B<KEXEC_ARCH_PPC64>, B<KEXEC_ARCH_IA_64>, B<KEXEC_ARCH_ARM>, "
742 "B<KEXEC_ARCH_S390>, B<KEXEC_ARCH_SH>, B<KEXEC_ARCH_MIPS>, and "
743 "B<KEXEC_ARCH_MIPS_LE>.  The architecture must be executable on the CPU of "
744 "the system."
745 msgstr ""
746
747 #. type: Plain text
748 #: build/C/man2/kexec_load.2:94
749 msgid ""
750 "The I<entry> argument is the physical entry address in the kernel image.  "
751 "The I<nr_segments> argument is the number of segments pointed to by the "
752 "I<segments> pointer.  The I<segments> argument is an array of "
753 "I<kexec_segment> structures which define the kernel layout:"
754 msgstr ""
755
756 #. type: Plain text
757 #: build/C/man2/kexec_load.2:103
758 #, no-wrap
759 msgid ""
760 "struct kexec_segment {\n"
761 "    void   *buf;        /* Buffer in user space */\n"
762 "    size_t  bufsz;      /* Buffer length in user space */\n"
763 "    void   *mem;        /* Physical address of kernel */\n"
764 "    size_t  memsz;      /* Physical address length */\n"
765 "};\n"
766 msgstr ""
767
768 #.  FIXME elaborate on the following:
769 #. type: Plain text
770 #: build/C/man2/kexec_load.2:110
771 msgid ""
772 "The kernel image defined by I<segments> is copied from the calling process "
773 "into previously reserved memory."
774 msgstr ""
775
776 #. type: Plain text
777 #: build/C/man2/kexec_load.2:117
778 msgid ""
779 "On success, B<kexec_load>()  returns 0.  On error, -1 is returned and "
780 "I<errno> is set to indicate the error."
781 msgstr ""
782
783 #. type: TP
784 #: 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
785 #, no-wrap
786 msgid "B<EBUSY>"
787 msgstr ""
788
789 #. type: Plain text
790 #: build/C/man2/kexec_load.2:122
791 msgid ""
792 "Another crash kernel is already being loaded or a crash kernel is already in "
793 "use."
794 msgstr ""
795
796 #.  KEXEC_SEGMENT_MAX == 16
797 #. type: Plain text
798 #: build/C/man2/kexec_load.2:129
799 msgid "I<flags> is invalid; or I<nr_segments> is too large"
800 msgstr ""
801
802 #. type: Plain text
803 #: build/C/man2/kexec_load.2:134
804 msgid "The caller does not have the B<CAP_SYS_BOOT> capability."
805 msgstr ""
806
807 #. type: Plain text
808 #: build/C/man2/kexec_load.2:138
809 msgid "The B<kexec_load>()  system call first appeared in Linux 2.6.13."
810 msgstr ""
811
812 #. type: Plain text
813 #: build/C/man2/kexec_load.2:145
814 msgid ""
815 "Currently, there is no glibc support for B<kexec_load>().  Call it using "
816 "B<syscall>(2)."
817 msgstr ""
818
819 #.  FIXME Andi submitted a patch for this.
820 #.  Check if it got accepted later.
821 #. type: Plain text
822 #: build/C/man2/kexec_load.2:152
823 msgid ""
824 "The required constants are in the kernel source file I<linux/kexec.h>, which "
825 "is not currently exported to glibc.  Therefore, these constants must be "
826 "defined manually."
827 msgstr ""
828
829 #. type: Plain text
830 #: build/C/man2/kexec_load.2:155
831 msgid ""
832 "This system call is only available if the kernel was configured with "
833 "B<CONFIG_KEXEC>."
834 msgstr ""
835
836 #. type: Plain text
837 #: build/C/man2/kexec_load.2:158
838 msgid "B<reboot>(2), B<syscall>(2)"
839 msgstr ""
840
841 #. type: TH
842 #: build/C/man2/lookup_dcookie.2:27
843 #, no-wrap
844 msgid "LOOKUP_DCOOKIE"
845 msgstr ""
846
847 #. type: TH
848 #: build/C/man2/lookup_dcookie.2:27
849 #, no-wrap
850 msgid "2004-06-17"
851 msgstr ""
852
853 #. type: Plain text
854 #: build/C/man2/lookup_dcookie.2:30
855 msgid "lookup_dcookie - return a directory entry's path"
856 msgstr ""
857
858 #. type: Plain text
859 #: build/C/man2/lookup_dcookie.2:32
860 msgid ""
861 "B<int lookup_dcookie(u64 >I<cookie>B<, char *>I<buffer>B<, size_t "
862 ">I<len>B<);>"
863 msgstr ""
864
865 #. type: Plain text
866 #: build/C/man2/lookup_dcookie.2:38
867 msgid ""
868 "Look up the full path of the directory entry specified by the value "
869 "I<cookie>.  The cookie is an opaque identifier uniquely identifying a "
870 "particular directory entry.  The buffer given is filled in with the full "
871 "path of the directory entry."
872 msgstr ""
873
874 #. type: Plain text
875 #: build/C/man2/lookup_dcookie.2:43
876 msgid ""
877 "For B<lookup_dcookie>()  to return successfully, the kernel must still hold "
878 "a cookie reference to the directory entry."
879 msgstr ""
880
881 #. type: Plain text
882 #: build/C/man2/lookup_dcookie.2:50
883 msgid ""
884 "On success, B<lookup_dcookie>()  returns the length of the path string "
885 "copied into the buffer.  On error, -1 is returned, and I<errno> is set "
886 "appropriately."
887 msgstr ""
888
889 #. type: Plain text
890 #: build/C/man2/lookup_dcookie.2:54
891 msgid "The buffer was not valid."
892 msgstr ""
893
894 #. type: Plain text
895 #: build/C/man2/lookup_dcookie.2:58
896 msgid ""
897 "The kernel has no registered cookie/directory entry mappings at the time of "
898 "lookup, or the cookie does not refer to a valid directory entry."
899 msgstr ""
900
901 #. type: TP
902 #: build/C/man2/lookup_dcookie.2:58
903 #, no-wrap
904 msgid "B<ENAMETOOLONG>"
905 msgstr ""
906
907 #. type: Plain text
908 #: build/C/man2/lookup_dcookie.2:61
909 msgid "The name could not fit in the buffer."
910 msgstr ""
911
912 #. type: TP
913 #: 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
914 #, no-wrap
915 msgid "B<ENOMEM>"
916 msgstr ""
917
918 #. type: Plain text
919 #: build/C/man2/lookup_dcookie.2:65
920 msgid ""
921 "The kernel could not allocate memory for the temporary buffer holding the "
922 "path."
923 msgstr ""
924
925 #. type: Plain text
926 #: build/C/man2/lookup_dcookie.2:70
927 msgid ""
928 "The process does not have the capability B<CAP_SYS_ADMIN> required to look "
929 "up cookie values."
930 msgstr ""
931
932 #. type: TP
933 #: build/C/man2/lookup_dcookie.2:70 build/C/man2/quotactl.2:472
934 #, no-wrap
935 msgid "B<ERANGE>"
936 msgstr ""
937
938 #. type: Plain text
939 #: build/C/man2/lookup_dcookie.2:73
940 msgid "The buffer was not large enough to hold the path of the directory entry."
941 msgstr ""
942
943 #. type: Plain text
944 #: build/C/man2/lookup_dcookie.2:78
945 msgid ""
946 "Available since Linux 2.5.43.  The B<ENAMETOOLONG> error return was added in "
947 "2.5.70."
948 msgstr ""
949
950 #. type: Plain text
951 #: build/C/man2/lookup_dcookie.2:81
952 msgid "B<lookup_dcookie>()  is Linux-specific."
953 msgstr ""
954
955 #. type: Plain text
956 #: build/C/man2/lookup_dcookie.2:85
957 msgid ""
958 "B<lookup_dcookie>()  is a special-purpose system call, currently used only "
959 "by the oprofile profiler.  It relies on a kernel driver to register cookies "
960 "for directory entries."
961 msgstr ""
962
963 #. type: Plain text
964 #: build/C/man2/lookup_dcookie.2:88
965 msgid ""
966 "The path returned may be suffixed by the string \" (deleted)\" if the "
967 "directory entry has been removed."
968 msgstr ""
969
970 #. type: TH
971 #: build/C/man2/modify_ldt.2:25
972 #, no-wrap
973 msgid "MODIFY_LDT"
974 msgstr ""
975
976 #. type: TH
977 #: build/C/man2/modify_ldt.2:25 build/C/man2/pivot_root.2:7
978 #, no-wrap
979 msgid "2007-06-01"
980 msgstr ""
981
982 #. type: Plain text
983 #: build/C/man2/modify_ldt.2:28
984 msgid "modify_ldt - get or set ldt"
985 msgstr ""
986
987 #. type: Plain text
988 #: build/C/man2/modify_ldt.2:31
989 #, no-wrap
990 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
991 msgstr ""
992
993 #. type: Plain text
994 #: build/C/man2/modify_ldt.2:33
995 #, no-wrap
996 msgid ""
997 "B<int modify_ldt(int >I<func>B<, void *>I<ptr>B<, unsigned long "
998 ">I<bytecount>B<);>\n"
999 msgstr ""
1000
1001 #. type: Plain text
1002 #: build/C/man2/modify_ldt.2:39
1003 msgid ""
1004 "B<modify_ldt>()  reads or writes the local descriptor table (ldt) for a "
1005 "process.  The ldt is a per-process memory management table used by the i386 "
1006 "processor.  For more information on this table, see an Intel 386 processor "
1007 "handbook."
1008 msgstr ""
1009
1010 #. type: Plain text
1011 #: build/C/man2/modify_ldt.2:49
1012 msgid ""
1013 "When I<func> is 0, B<modify_ldt>()  reads the ldt into the memory pointed to "
1014 "by I<ptr>.  The number of bytes read is the smaller of I<bytecount> and the "
1015 "actual size of the ldt."
1016 msgstr ""
1017
1018 #
1019 #.  FIXME ? say something about func == 2 and func == 0x11?
1020 #.  In Linux 2.4, func == 2 returned "the default ldt"
1021 #.  In Linux 2.6, func == 2 is a nop, returning a zeroed out structure.
1022 #.  Linux 2.4 and 2.6 implement an operation for func == 0x11
1023 #. type: Plain text
1024 #: build/C/man2/modify_ldt.2:67
1025 msgid ""
1026 "When I<func> is 1, B<modify_ldt>()  modifies one ldt entry.  I<ptr> points "
1027 "to a I<user_desc> structure and I<bytecount> must equal the size of this "
1028 "structure."
1029 msgstr ""
1030
1031 #. type: Plain text
1032 #: build/C/man2/modify_ldt.2:71
1033 msgid "The I<user_desc> structure is defined in I<E<lt>asm/ldt.hE<gt>> as:"
1034 msgstr ""
1035
1036 #. type: Plain text
1037 #: build/C/man2/modify_ldt.2:85
1038 #, no-wrap
1039 msgid ""
1040 "struct user_desc {\n"
1041 "    unsigned int  entry_number;\n"
1042 "    unsigned long base_addr;\n"
1043 "    unsigned int  limit;\n"
1044 "    unsigned int  seg_32bit:1;\n"
1045 "    unsigned int  contents:2;\n"
1046 "    unsigned int  read_exec_only:1;\n"
1047 "    unsigned int  limit_in_pages:1;\n"
1048 "    unsigned int  seg_not_present:1;\n"
1049 "    unsigned int  useable:1;\n"
1050 "};\n"
1051 msgstr ""
1052
1053 #.  .PP
1054 #.  The ldt is specific for the calling process. Any attempts to change
1055 #.  the ldt to include the address space of another process or the kernel
1056 #.  will result in a segmentation violation when trying to access the memory
1057 #.  outside of the process address space. The memory protection is enforced
1058 #.  at the paging layer.
1059 #. type: Plain text
1060 #: build/C/man2/modify_ldt.2:96
1061 msgid "In Linux 2.4 and earlier, this structure was named I<modify_ldt_ldt_s>."
1062 msgstr ""
1063
1064 #. type: Plain text
1065 #: build/C/man2/modify_ldt.2:106
1066 msgid ""
1067 "On success, B<modify_ldt>()  returns either the actual number of bytes read "
1068 "(for reading)  or 0 (for writing).  On failure, B<modify_ldt>()  returns -1 "
1069 "and sets I<errno> to indicate the error."
1070 msgstr ""
1071
1072 #. type: Plain text
1073 #: build/C/man2/modify_ldt.2:111
1074 msgid "I<ptr> points outside the address space."
1075 msgstr ""
1076
1077 #. type: Plain text
1078 #: build/C/man2/modify_ldt.2:124
1079 msgid ""
1080 "I<ptr> is 0, or I<func> is 1 and I<bytecount> is not equal to the size of "
1081 "the structure I<modify_ldt_ldt_s>, or I<func> is 1 and the new ldt entry has "
1082 "invalid values."
1083 msgstr ""
1084
1085 #. type: Plain text
1086 #: build/C/man2/modify_ldt.2:128
1087 msgid "I<func> is neither 0 nor 1."
1088 msgstr ""
1089
1090 #. type: Plain text
1091 #: build/C/man2/modify_ldt.2:131
1092 msgid ""
1093 "This call is Linux-specific and should not be used in programs intended to "
1094 "be portable."
1095 msgstr ""
1096
1097 #. type: Plain text
1098 #: build/C/man2/modify_ldt.2:134 build/C/man2/pivot_root.2:128
1099 msgid ""
1100 "Glibc does not provide a wrapper for this system call; call it using "
1101 "B<syscall>(2)."
1102 msgstr ""
1103
1104 #. type: Plain text
1105 #: build/C/man2/modify_ldt.2:136
1106 msgid "B<vm86>(2)"
1107 msgstr ""
1108
1109 #. type: TH
1110 #: build/C/man2/nfsservctl.2:8
1111 #, no-wrap
1112 msgid "NFSSERVCTL"
1113 msgstr ""
1114
1115 #. type: TH
1116 #: build/C/man2/nfsservctl.2:8
1117 #, no-wrap
1118 msgid "2012-03-05"
1119 msgstr ""
1120
1121 #. type: Plain text
1122 #: build/C/man2/nfsservctl.2:11
1123 msgid "nfsservctl - syscall interface to kernel nfs daemon"
1124 msgstr ""
1125
1126 #. type: Plain text
1127 #: build/C/man2/nfsservctl.2:14
1128 #, no-wrap
1129 msgid "B<#include E<lt>linux/nfsd/syscall.hE<gt>>\n"
1130 msgstr ""
1131
1132 #. type: Plain text
1133 #: build/C/man2/nfsservctl.2:17
1134 #, no-wrap
1135 msgid ""
1136 "B<long nfsservctl(int >I<cmd>B<, struct nfsctl_arg *>I<argp>B<,>\n"
1137 "B<                union nfsctl_res *>I<resp>B<);>\n"
1138 msgstr ""
1139
1140 #. type: Plain text
1141 #: build/C/man2/nfsservctl.2:21
1142 msgid "I<Note>: Since Linux 3.1, this system call no longer exists."
1143 msgstr ""
1144
1145 #. type: Plain text
1146 #: build/C/man2/nfsservctl.2:33
1147 #, no-wrap
1148 msgid ""
1149 "/*\n"
1150 " * These are the commands understood by nfsctl().\n"
1151 " */\n"
1152 "#define NFSCTL_SVC          0    /* This is a server process. */\n"
1153 "#define NFSCTL_ADDCLIENT    1    /* Add an NFS client. */\n"
1154 "#define NFSCTL_DELCLIENT    2    /* Remove an NFS client. */\n"
1155 "#define NFSCTL_EXPORT       3    /* export a file system. */\n"
1156 "#define NFSCTL_UNEXPORT     4    /* unexport a file system. */\n"
1157 "#define NFSCTL_UGIDUPDATE   5    /* update a client's UID/GID map. */\n"
1158 "#define NFSCTL_GETFH        6    /* get an fh (used by mountd) */\n"
1159 msgstr ""
1160
1161 #. type: Plain text
1162 #: build/C/man2/nfsservctl.2:45
1163 #, no-wrap
1164 msgid ""
1165 "struct nfsctl_arg {\n"
1166 "    int                       ca_version;     /* safeguard */\n"
1167 "    union {\n"
1168 "        struct nfsctl_svc     u_svc;\n"
1169 "        struct nfsctl_client  u_client;\n"
1170 "        struct nfsctl_export  u_export;\n"
1171 "        struct nfsctl_uidmap  u_umap;\n"
1172 "        struct nfsctl_fhparm  u_getfh;\n"
1173 "        unsigned int          u_debug;\n"
1174 "    } u;\n"
1175 "}\n"
1176 msgstr ""
1177
1178 #. type: Plain text
1179 #: build/C/man2/nfsservctl.2:50
1180 #, no-wrap
1181 msgid ""
1182 "union nfsctl_res {\n"
1183 "        struct knfs_fh          cr_getfh;\n"
1184 "        unsigned int            cr_debug;\n"
1185 "};\n"
1186 msgstr ""
1187
1188 #. type: Plain text
1189 #: build/C/man2/nfsservctl.2:56 build/C/man2/pivot_root.2:99 build/C/man2/vm86.2:57
1190 msgid ""
1191 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
1192 "appropriately."
1193 msgstr ""
1194
1195 #. type: Plain text
1196 #: build/C/man2/nfsservctl.2:58
1197 msgid "This call is Linux-specific."
1198 msgstr ""
1199
1200 #. type: TH
1201 #: build/C/man2/outb.2:28
1202 #, no-wrap
1203 msgid "OUTB"
1204 msgstr ""
1205
1206 #. type: TH
1207 #: build/C/man2/outb.2:28
1208 #, no-wrap
1209 msgid "1995-11-29"
1210 msgstr ""
1211
1212 #. type: Plain text
1213 #: build/C/man2/outb.2:33
1214 msgid ""
1215 "outb, outw, outl, outsb, outsw, outsl, inb, inw, inl, insb, insw, insl, "
1216 "outb_p, outw_p, outl_p, inb_p, inw_p, inl_p - port I/O"
1217 msgstr ""
1218
1219 #. type: Plain text
1220 #: build/C/man2/outb.2:38
1221 msgid ""
1222 "This family of functions is used to do low-level port input and output.  The "
1223 "out* functions do port output, the in* functions do port input; the b-suffix "
1224 "functions are byte-width and the w-suffix functions word-width; the "
1225 "_p-suffix functions pause until the I/O completes."
1226 msgstr ""
1227
1228 #.  , given the following information
1229 #.  in addition to that given in
1230 #.  .BR outb (9).
1231 #. type: Plain text
1232 #: build/C/man2/outb.2:44
1233 msgid ""
1234 "They are primarily designed for internal kernel use, but can be used from "
1235 "user space."
1236 msgstr ""
1237
1238 #. type: Plain text
1239 #: build/C/man2/outb.2:49
1240 msgid ""
1241 "You compile with B<-O> or B<-O2> or similar.  The functions are defined as "
1242 "inline macros, and will not be substituted in without optimization enabled, "
1243 "causing unresolved references at link time."
1244 msgstr ""
1245
1246 #. type: Plain text
1247 #: build/C/man2/outb.2:58
1248 msgid ""
1249 "You use B<ioperm>(2)  or alternatively B<iopl>(2)  to tell the kernel to "
1250 "allow the user space application to access the I/O ports in question.  "
1251 "Failure to do this will cause the application to receive a segmentation "
1252 "fault."
1253 msgstr ""
1254
1255 #. type: Plain text
1256 #: build/C/man2/outb.2:67
1257 msgid ""
1258 "B<outb>()  and friends are hardware-specific.  The I<value> argument is "
1259 "passed first and the I<port> argument is passed second, which is the "
1260 "opposite order from most DOS implementations."
1261 msgstr ""
1262
1263 #. type: Plain text
1264 #: build/C/man2/outb.2:70
1265 msgid "B<ioperm>(2), B<iopl>(2)"
1266 msgstr ""
1267
1268 #. type: TH
1269 #: build/C/man2/pciconfig_read.2:5
1270 #, no-wrap
1271 msgid "PCICONFIG_READ"
1272 msgstr ""
1273
1274 #. type: TH
1275 #: build/C/man2/pciconfig_read.2:5
1276 #, no-wrap
1277 msgid "2003-07-14"
1278 msgstr ""
1279
1280 #. type: Plain text
1281 #: build/C/man2/pciconfig_read.2:8
1282 msgid ""
1283 "pciconfig_read, pciconfig_write, pciconfig_iobase - pci device information "
1284 "handling"
1285 msgstr ""
1286
1287 #. type: Plain text
1288 #: build/C/man2/pciconfig_read.2:11
1289 #, no-wrap
1290 msgid "B<#include E<lt>pci.hE<gt>>\n"
1291 msgstr ""
1292
1293 #. type: Plain text
1294 #: build/C/man2/pciconfig_read.2:18
1295 #, no-wrap
1296 msgid ""
1297 "B<int pciconfig_read(unsigned long >I<bus>B<, unsigned long >I<dfn>B<,>\n"
1298 "B<          unsigned long >I<off>B<, unsigned long >I<len>B<, void "
1299 "*>I<buf>B<);>\n"
1300 "B<int pciconfig_write(unsigned long >I<bus>B<, unsigned long >I<dfn>B<,>\n"
1301 "B<          unsigned long >I<off>B<, unsigned long >I<len>B<, void "
1302 "*>I<buf>B<);>\n"
1303 "B<int pciconfig_iobase(long >I<which>B<, unsigned long >I<bus>B<,>\n"
1304 "B<          unsigned long >I<devfn>B<);>\n"
1305 msgstr ""
1306
1307 #. type: Plain text
1308 #: build/C/man2/pciconfig_read.2:24
1309 msgid ""
1310 "Most of the interaction with PCI devices is already handled by the kernel "
1311 "PCI layer, and thus these calls should not normally need to be accessed from "
1312 "userspace."
1313 msgstr ""
1314
1315 #. type: TP
1316 #: build/C/man2/pciconfig_read.2:24 build/C/man2/pciconfig_read.2:48
1317 #, no-wrap
1318 msgid "B<pciconfig_read>()"
1319 msgstr ""
1320
1321 #. type: Plain text
1322 #: build/C/man2/pciconfig_read.2:33
1323 msgid "Reads to I<buf> from device I<dev> at offset I<off> value."
1324 msgstr ""
1325
1326 #. type: TP
1327 #: build/C/man2/pciconfig_read.2:33 build/C/man2/pciconfig_read.2:54
1328 #, no-wrap
1329 msgid "B<pciconfig_write>()"
1330 msgstr ""
1331
1332 #. type: Plain text
1333 #: build/C/man2/pciconfig_read.2:42
1334 msgid "Writes from I<buf> to device I<dev> at offset I<off> value."
1335 msgstr ""
1336
1337 #. type: TP
1338 #: build/C/man2/pciconfig_read.2:42 build/C/man2/pciconfig_read.2:60
1339 #, no-wrap
1340 msgid "B<pciconfig_iobase>()"
1341 msgstr ""
1342
1343 #. type: Plain text
1344 #: build/C/man2/pciconfig_read.2:47
1345 msgid ""
1346 "You pass it a bus/devfn pair and get a physical address for either the "
1347 "memory offset (for things like prep, this is 0xc0000000), the IO base for "
1348 "PIO cycles, or the ISA holes if any."
1349 msgstr ""
1350
1351 #. type: Plain text
1352 #: build/C/man2/pciconfig_read.2:54 build/C/man2/pciconfig_read.2:60
1353 msgid ""
1354 "On success zero is returned.  On error, -1 is returned and I<errno> is set "
1355 "appropriately."
1356 msgstr ""
1357
1358 #. type: Plain text
1359 #: build/C/man2/pciconfig_read.2:74
1360 msgid ""
1361 "Returns information on locations of various I/O regions in physical memory "
1362 "according to the I<which> value.  Values for I<which> are: "
1363 "B<IOBASE_BRIDGE_NUMBER>, B<IOBASE_MEMORY>, B<IOBASE_IO>, B<IOBASE_ISA_IO>, "
1364 "B<IOBASE_ISA_MEM>."
1365 msgstr ""
1366
1367 #. type: Plain text
1368 #: build/C/man2/pciconfig_read.2:81
1369 msgid "I<len> value is invalid.  This does not apply to B<pciconfig_iobase>()."
1370 msgstr ""
1371
1372 #. type: TP
1373 #: build/C/man2/pciconfig_read.2:81 build/C/man2/ptrace.2:1612 build/C/man2/sendfile.2:130
1374 #, no-wrap
1375 msgid "B<EIO>"
1376 msgstr ""
1377
1378 #. type: Plain text
1379 #: build/C/man2/pciconfig_read.2:84
1380 msgid "I/O error."
1381 msgstr ""
1382
1383 #. type: TP
1384 #: build/C/man2/pciconfig_read.2:84
1385 #, no-wrap
1386 msgid "B<ENODEV>"
1387 msgstr ""
1388
1389 #. type: Plain text
1390 #: build/C/man2/pciconfig_read.2:90
1391 msgid ""
1392 "For B<pciconfig_iobase>(), \"hose\" value is NULL.  For the other calls, "
1393 "could not find a slot."
1394 msgstr ""
1395
1396 #. type: Plain text
1397 #: build/C/man2/pciconfig_read.2:95
1398 msgid "The system has not implemented these calls (B<CONFIG_PCI> not defined)."
1399 msgstr ""
1400
1401 #. type: TP
1402 #: build/C/man2/pciconfig_read.2:95
1403 #, no-wrap
1404 msgid "B<EOPNOTSUPP>"
1405 msgstr ""
1406
1407 #. type: Plain text
1408 #: build/C/man2/pciconfig_read.2:102
1409 msgid ""
1410 "This return value is only valid for B<pciconfig_iobase>().  It is returned "
1411 "if the value for I<which> is invalid."
1412 msgstr ""
1413
1414 #. type: Plain text
1415 #: build/C/man2/pciconfig_read.2:107
1416 msgid ""
1417 "User does not have the B<CAP_SYS_ADMIN> capability.  This does not apply to "
1418 "B<pciconfig_iobase>()."
1419 msgstr ""
1420
1421 #. type: Plain text
1422 #: build/C/man2/pciconfig_read.2:109
1423 msgid "These calls are Linux-specific, available since Linux 2.0.26/2.1.11."
1424 msgstr ""
1425
1426 #. type: Plain text
1427 #: build/C/man2/pciconfig_read.2:111
1428 msgid "B<capabilities>(7)"
1429 msgstr ""
1430
1431 #. type: TH
1432 #: build/C/man2/personality.2:30
1433 #, no-wrap
1434 msgid "PERSONALITY"
1435 msgstr ""
1436
1437 #. type: TH
1438 #: build/C/man2/personality.2:30
1439 #, no-wrap
1440 msgid "2003-01-01"
1441 msgstr ""
1442
1443 #. type: Plain text
1444 #: build/C/man2/personality.2:33
1445 msgid "personality - set the process execution domain"
1446 msgstr ""
1447
1448 #. type: Plain text
1449 #: build/C/man2/personality.2:35
1450 msgid "B<#include E<lt>sys/personality.hE<gt>>"
1451 msgstr ""
1452
1453 #. type: Plain text
1454 #: build/C/man2/personality.2:37
1455 msgid "B<int personality(unsigned long >I<persona>B<);>"
1456 msgstr ""
1457
1458 #. type: Plain text
1459 #: build/C/man2/personality.2:45
1460 msgid ""
1461 "Linux supports different execution domains, or personalities, for each "
1462 "process.  Among other things, execution domains tell Linux how to map signal "
1463 "numbers into signal actions.  The execution domain system allows Linux to "
1464 "provide limited support for binaries compiled under other UNIX-like "
1465 "operating systems."
1466 msgstr ""
1467
1468 #. type: Plain text
1469 #: build/C/man2/personality.2:55
1470 msgid ""
1471 "This function will return the current B<personality>()  when I<persona> "
1472 "equals 0xffffffff.  Otherwise, it will make the execution domain referenced "
1473 "by I<persona> the new execution domain of the calling process."
1474 msgstr ""
1475
1476 #. type: Plain text
1477 #: build/C/man2/personality.2:62
1478 msgid ""
1479 "On success, the previous I<persona> is returned.  On error, -1 is returned, "
1480 "and I<errno> is set appropriately."
1481 msgstr ""
1482
1483 #. type: Plain text
1484 #: build/C/man2/personality.2:66
1485 msgid "The kernel was unable to change the personality."
1486 msgstr ""
1487
1488 #. type: Plain text
1489 #: build/C/man2/personality.2:70
1490 msgid ""
1491 "B<personality>()  is Linux-specific and should not be used in programs "
1492 "intended to be portable."
1493 msgstr ""
1494
1495 #. type: TH
1496 #: build/C/man2/pivot_root.2:7
1497 #, no-wrap
1498 msgid "PIVOT_ROOT"
1499 msgstr ""
1500
1501 #. type: Plain text
1502 #: build/C/man2/pivot_root.2:10
1503 msgid "pivot_root - change the root file system"
1504 msgstr ""
1505
1506 #. type: Plain text
1507 #: build/C/man2/pivot_root.2:12
1508 msgid "B<int pivot_root(const char *>I<new_root>B<, const char *>I<put_old>B<);>"
1509 msgstr ""
1510
1511 #
1512 #.  The
1513 #.  .B CAP_SYS_ADMIN
1514 #.  capability is required.
1515 #. type: Plain text
1516 #: build/C/man2/pivot_root.2:21
1517 msgid ""
1518 "B<pivot_root>()  moves the root file system of the calling process to the "
1519 "directory I<put_old> and makes I<new_root> the new root file system of the "
1520 "calling process."
1521 msgstr ""
1522
1523 #. type: Plain text
1524 #: build/C/man2/pivot_root.2:28
1525 msgid ""
1526 "The typical use of B<pivot_root>()  is during system startup, when the "
1527 "system mounts a temporary root file system (e.g., an B<initrd>), then mounts "
1528 "the real root file system, and eventually turns the latter into the current "
1529 "root of all relevant processes or threads."
1530 msgstr ""
1531
1532 #. type: Plain text
1533 #: build/C/man2/pivot_root.2:40
1534 msgid ""
1535 "B<pivot_root>()  may or may not change the current root and the current "
1536 "working directory of any processes or threads which use the old root "
1537 "directory.  The caller of B<pivot_root>()  must ensure that processes with "
1538 "root or current working directory at the old root operate correctly in "
1539 "either case.  An easy way to ensure this is to change their root and current "
1540 "working directory to I<new_root> before invoking B<pivot_root>()."
1541 msgstr ""
1542
1543 #. type: Plain text
1544 #: build/C/man2/pivot_root.2:58
1545 msgid ""
1546 "The paragraph above is intentionally vague because the implementation of "
1547 "B<pivot_root>()  may change in the future.  At the time of writing, "
1548 "B<pivot_root>()  changes root and current working directory of each process "
1549 "or thread to I<new_root> if they point to the old root directory.  This is "
1550 "necessary in order to prevent kernel threads from keeping the old root "
1551 "directory busy with their root and current working directory, even if they "
1552 "never access the file system in any way.  In the future, there may be a "
1553 "mechanism for kernel threads to explicitly relinquish any access to the file "
1554 "system, such that this fairly intrusive mechanism can be removed from "
1555 "B<pivot_root>()."
1556 msgstr ""
1557
1558 #. type: Plain text
1559 #: build/C/man2/pivot_root.2:66
1560 msgid ""
1561 "Note that this also applies to the calling process: B<pivot_root>()  may or "
1562 "may not affect its current working directory.  It is therefore recommended "
1563 "to call B<chdir(\"/\")> immediately after B<pivot_root>()."
1564 msgstr ""
1565
1566 #. type: Plain text
1567 #: build/C/man2/pivot_root.2:68
1568 msgid "The following restrictions apply to I<new_root> and I<put_old>:"
1569 msgstr ""
1570
1571 #. type: IP
1572 #: build/C/man2/pivot_root.2:68 build/C/man2/pivot_root.2:70 build/C/man2/pivot_root.2:73 build/C/man2/pivot_root.2:77
1573 #, no-wrap
1574 msgid "-"
1575 msgstr ""
1576
1577 #. type: Plain text
1578 #: build/C/man2/pivot_root.2:70
1579 msgid "They must be directories."
1580 msgstr ""
1581
1582 #. type: Plain text
1583 #: build/C/man2/pivot_root.2:73
1584 msgid ""
1585 "I<new_root> and I<put_old> must not be on the same file system as the "
1586 "current root."
1587 msgstr ""
1588
1589 #. type: Plain text
1590 #: build/C/man2/pivot_root.2:77
1591 msgid ""
1592 "I<put_old> must be underneath I<new_root>, that is, adding a nonzero number "
1593 "of I</..> to the string pointed to by I<put_old> must yield the same "
1594 "directory as I<new_root>."
1595 msgstr ""
1596
1597 #. type: Plain text
1598 #: build/C/man2/pivot_root.2:79
1599 msgid "No other file system may be mounted on I<put_old>."
1600 msgstr ""
1601
1602 #. type: Plain text
1603 #: build/C/man2/pivot_root.2:83
1604 msgid "See also B<pivot_root>(8)  for additional usage examples."
1605 msgstr ""
1606
1607 #. type: Plain text
1608 #: build/C/man2/pivot_root.2:90
1609 msgid ""
1610 "If the current root is not a mount point (e.g., after B<chroot>(2)  or "
1611 "B<pivot_root>(), see also below), not the old root directory, but the mount "
1612 "point of that file system is mounted on I<put_old>."
1613 msgstr ""
1614
1615 #. type: Plain text
1616 #: build/C/man2/pivot_root.2:95
1617 msgid ""
1618 "I<new_root> does not have to be a mount point.  In this case, "
1619 "I</proc/mounts> will show the mount point of the file system containing "
1620 "I<new_root> as root (I</>)."
1621 msgstr ""
1622
1623 #. type: Plain text
1624 #: build/C/man2/pivot_root.2:104
1625 msgid ""
1626 "B<pivot_root>()  may return (in I<errno>) any of the errors returned by "
1627 "B<stat>(2).  Additionally, it may return:"
1628 msgstr ""
1629
1630 #. type: Plain text
1631 #: build/C/man2/pivot_root.2:108
1632 msgid ""
1633 "I<new_root> or I<put_old> are on the current root file system, or a file "
1634 "system is already mounted on I<put_old>."
1635 msgstr ""
1636
1637 #. type: Plain text
1638 #: build/C/man2/pivot_root.2:111
1639 msgid "I<put_old> is not underneath I<new_root>."
1640 msgstr ""
1641
1642 #. type: TP
1643 #: build/C/man2/pivot_root.2:111
1644 #, no-wrap
1645 msgid "B<ENOTDIR>"
1646 msgstr ""
1647
1648 #. type: Plain text
1649 #: build/C/man2/pivot_root.2:114
1650 msgid "I<new_root> or I<put_old> is not a directory."
1651 msgstr ""
1652
1653 #. type: Plain text
1654 #: build/C/man2/pivot_root.2:119
1655 msgid "The calling process does not have the B<CAP_SYS_ADMIN> capability."
1656 msgstr ""
1657
1658 #. type: Plain text
1659 #: build/C/man2/pivot_root.2:122
1660 msgid "B<pivot_root>()  was introduced in Linux 2.3.41."
1661 msgstr ""
1662
1663 #. type: Plain text
1664 #: build/C/man2/pivot_root.2:125
1665 msgid "B<pivot_root>()  is Linux-specific and hence is not portable."
1666 msgstr ""
1667
1668 #. type: SH
1669 #: build/C/man2/pivot_root.2:128 build/C/man2/ptrace.2:1675
1670 #, no-wrap
1671 msgid "BUGS"
1672 msgstr ""
1673
1674 #. type: Plain text
1675 #: build/C/man2/pivot_root.2:132
1676 msgid ""
1677 "B<pivot_root>()  should not have to change root and current working "
1678 "directory of all other processes in the system."
1679 msgstr ""
1680
1681 #. type: Plain text
1682 #: build/C/man2/pivot_root.2:137
1683 msgid ""
1684 "Some of the more obscure uses of B<pivot_root>()  may quickly lead to "
1685 "insanity."
1686 msgstr ""
1687
1688 #. type: Plain text
1689 #: build/C/man2/pivot_root.2:143
1690 msgid "B<chdir>(2), B<chroot>(2), B<stat>(2), B<initrd>(4), B<pivot_root>(8)"
1691 msgstr ""
1692
1693 #. type: TH
1694 #: build/C/man2/process_vm_readv.2:27
1695 #, no-wrap
1696 msgid "PROCESS_VM_READV"
1697 msgstr ""
1698
1699 #. type: TH
1700 #: build/C/man2/process_vm_readv.2:27
1701 #, no-wrap
1702 msgid "2012-04-25"
1703 msgstr ""
1704
1705 #. type: Plain text
1706 #: build/C/man2/process_vm_readv.2:30
1707 msgid ""
1708 "process_vm_readv, process_vm_writev - transfer data between process address "
1709 "spaces"
1710 msgstr ""
1711
1712 #. type: Plain text
1713 #: build/C/man2/process_vm_readv.2:33
1714 #, no-wrap
1715 msgid "B<#include E<lt>sys/uio.hE<gt>>\n"
1716 msgstr ""
1717
1718 #. type: Plain text
1719 #: build/C/man2/process_vm_readv.2:40
1720 #, no-wrap
1721 msgid ""
1722 "B<ssize_t process_vm_readv(pid_t >I<pid>B<,>\n"
1723 "B<                         const struct iovec *>I<local_iov>B<,>\n"
1724 "B<                         unsigned long >I<liovcnt>B<,>\n"
1725 "B<                         const struct iovec *>I<remote_iov>B<,>\n"
1726 "B<                         unsigned long >I<riovcnt>B<,>\n"
1727 "B<                         unsigned long >I<flags>B<);>\n"
1728 msgstr ""
1729
1730 #. type: Plain text
1731 #: build/C/man2/process_vm_readv.2:47
1732 #, no-wrap
1733 msgid ""
1734 "B<ssize_t process_vm_writev(pid_t >I<pid>B<,>\n"
1735 "B<                          const struct iovec *>I<local_iov>B<,>\n"
1736 "B<                          unsigned long >I<liovcnt>B<,>\n"
1737 "B<                          const struct iovec *>I<remote_iov>B<,>\n"
1738 "B<                          unsigned long >I<riovcnt>B<,>\n"
1739 "B<                          unsigned long >I<flags>B<);>\n"
1740 msgstr ""
1741
1742 #. type: Plain text
1743 #: build/C/man2/process_vm_readv.2:55
1744 msgid ""
1745 "These system calls transfer data between the address space of the calling "
1746 "process (\"the local process\") and the process identified by I<pid> (\"the "
1747 "remote process\").  The data moves directly between the address spaces of "
1748 "the two processes, without passing through kernel space."
1749 msgstr ""
1750
1751 #. type: Plain text
1752 #: build/C/man2/process_vm_readv.2:80
1753 msgid ""
1754 "The B<process_vm_readv>()  system call transfers data from the remote "
1755 "process to the local process.  The data to be transferred is identified by "
1756 "I<remote_iov> and I<riovcnt>: I<remote_iov> is a pointer to an array "
1757 "describing address ranges in the process I<pid>, and I<riovcnt> specifies "
1758 "the number of elements in I<remote_iov>.  The data is transferred to the "
1759 "locations specified by I<local_iov> and I<liovcnt>: I<local_iov> is a "
1760 "pointer to an array describing address ranges in the calling process, and "
1761 "I<liovcnt> specifies the number of elements in I<local_iov>."
1762 msgstr ""
1763
1764 #. type: Plain text
1765 #: build/C/man2/process_vm_readv.2:94
1766 msgid ""
1767 "The B<process_vm_writev>()  system call is the converse of "
1768 "B<process_vm_readv>()\\(emit transfers data from the local process to the "
1769 "remote process.  Other than the direction of the transfer, the arguments "
1770 "I<liovcnt>, I<local_iov>, I<riovcnt>, and I<remote_iov> have the same "
1771 "meaning as for B<process_vm_readv>()."
1772 msgstr ""
1773
1774 #. type: Plain text
1775 #: build/C/man2/process_vm_readv.2:104
1776 msgid ""
1777 "The I<local_iov> and I<remote_iov> arguments point to an array of I<iovec> "
1778 "structures, defined in I<E<lt>sys/uio.hE<gt>> as:"
1779 msgstr ""
1780
1781 #. type: Plain text
1782 #: build/C/man2/process_vm_readv.2:111
1783 #, no-wrap
1784 msgid ""
1785 "struct iovec {\n"
1786 "    void  *iov_base;    /* Starting address */\n"
1787 "    size_t iov_len;     /* Number of bytes to transfer */\n"
1788 "};\n"
1789 msgstr ""
1790
1791 #. type: Plain text
1792 #: build/C/man2/process_vm_readv.2:127
1793 msgid ""
1794 "Buffers are processed in array order.  This means that B<process_vm_readv>()  "
1795 "completely fills I<local_iov[0]> before proceeding to I<local_iov[1]>, and "
1796 "so on.  Likewise, I<remote_iov[0]> is completely read before proceeding to "
1797 "I<remote_iov[1]>, and so on."
1798 msgstr ""
1799
1800 #. type: Plain text
1801 #: build/C/man2/process_vm_readv.2:138
1802 msgid ""
1803 "Similarly, B<process_vm_writev>()  writes out the entire contents of "
1804 "I<local_iov[0]> before proceeding to I<local_iov[1]>, and it completely "
1805 "fills I<remote_iov[0]> before proceeding to I<remote_iov[1]>."
1806 msgstr ""
1807
1808 #. type: Plain text
1809 #: build/C/man2/process_vm_readv.2:146
1810 msgid ""
1811 "The lengths of I<remote_iov[i].iov_len> and I<local_iov[i].iov_len> do not "
1812 "have to be the same.  Thus, it is possible to split a single local buffer "
1813 "into multiple remote buffers, or vice versa."
1814 msgstr ""
1815
1816 #. type: Plain text
1817 #: build/C/man2/process_vm_readv.2:150
1818 msgid "The I<flags> argument is currently unused and must be set to 0."
1819 msgstr ""
1820
1821 #.  In time, glibc might provide a wrapper that works around this limit,
1822 #.  as is done for readv()/writev()
1823 #. type: Plain text
1824 #: build/C/man2/process_vm_readv.2:163
1825 msgid ""
1826 "The values specified in the I<liovcnt> and I<riovcnt> arguments must be less "
1827 "than or equal to B<IOV_MAX> (defined in I<E<lt>limits.hE<gt>> or accessible "
1828 "via the call I<sysconf(_SC_IOV_MAX)>)."
1829 msgstr ""
1830
1831 #. type: Plain text
1832 #: build/C/man2/process_vm_readv.2:173
1833 msgid ""
1834 "The count arguments and I<local_iov> are checked before doing any "
1835 "transfers.  If the counts are too big, or I<local_iov> is invalid, or the "
1836 "addresses refer to regions that are inaccessible to the local process, none "
1837 "of the vectors will be processed and an error will be returned immediately."
1838 msgstr ""
1839
1840 #. type: Plain text
1841 #: build/C/man2/process_vm_readv.2:193
1842 msgid ""
1843 "Note, however, that these system calls do not check the memory regions in "
1844 "the remote process until just before doing the read/write.  Consequently, a "
1845 "partial read/write (see RETURN VALUE)  may result if one of the "
1846 "I<remote_iov> elements points to an invalid memory region in the remote "
1847 "process.  No further reads/writes will be attempted beyond that point.  Keep "
1848 "this in mind when attempting to read data of unknown length (such as C "
1849 "strings that are null-terminated) from a remote process, by avoiding "
1850 "spanning memory pages (typically 4KiB) in a single remote I<iovec> element.  "
1851 "(Instead, split the remote read into two I<remote_iov> elements and have "
1852 "them merge back into a single write I<local_iov> entry.  The first read "
1853 "entry goes up to the page boundary, while the second starts on the next page "
1854 "boundary.)"
1855 msgstr ""
1856
1857 #. type: Plain text
1858 #: build/C/man2/process_vm_readv.2:207
1859 msgid ""
1860 "In order to read from or write to another process, either the caller must "
1861 "have the capability B<CAP_SYS_PTRACE>, or the real user ID, effective user "
1862 "ID, and saved set-user-ID of the remote process must match the real user ID "
1863 "of the caller I<and> the real group ID, effective group ID, and saved "
1864 "set-group-ID of the remote process must match the real group ID of the "
1865 "caller.  (The permission required is exactly the same as that required to "
1866 "perform a B<ptrace>(2)  B<PTRACE_ATTACH> on the remote process.)"
1867 msgstr ""
1868
1869 #. type: Plain text
1870 #: build/C/man2/process_vm_readv.2:223
1871 msgid ""
1872 "On success, B<process_vm_readv>()  returns the number of bytes read and "
1873 "B<process_vm_writev>()  returns the number of bytes written.  This return "
1874 "value may be less than the total number of requested bytes, if a partial "
1875 "read/write occurred.  (Partial transfers apply at the granularity of "
1876 "I<iovec> elements.  These system calls won't perform a partial transfer that "
1877 "splits a single I<iovec> element.)  The caller should check the return value "
1878 "to determine whether a partial read/write occurred."
1879 msgstr ""
1880
1881 #. type: Plain text
1882 #: build/C/man2/process_vm_readv.2:227
1883 msgid "On error, -1 is returned and I<errno> is set appropriately."
1884 msgstr ""
1885
1886 #. type: Plain text
1887 #: build/C/man2/process_vm_readv.2:239
1888 msgid ""
1889 "The sum of the I<iov_len> values of either I<local_iov> or I<remote_iov> "
1890 "overflows a I<ssize_t> value."
1891 msgstr ""
1892
1893 #. type: Plain text
1894 #: build/C/man2/process_vm_readv.2:243
1895 msgid "I<flags> is not 0."
1896 msgstr ""
1897
1898 #. type: Plain text
1899 #: build/C/man2/process_vm_readv.2:249
1900 msgid "I<liovcnt> or I<riovcnt> is too large."
1901 msgstr ""
1902
1903 #. type: Plain text
1904 #: build/C/man2/process_vm_readv.2:254
1905 msgid ""
1906 "The memory described by I<local_iov> is outside the caller's accessible "
1907 "address space."
1908 msgstr ""
1909
1910 #. type: Plain text
1911 #: build/C/man2/process_vm_readv.2:260
1912 msgid ""
1913 "The memory described by I<remote_iov> is outside the accessible address "
1914 "space of the process I<pid>."
1915 msgstr ""
1916
1917 #. type: Plain text
1918 #: build/C/man2/process_vm_readv.2:265
1919 msgid "Could not allocate memory for internal copies of the I<iovec> structures."
1920 msgstr ""
1921
1922 #. type: Plain text
1923 #: build/C/man2/process_vm_readv.2:269
1924 msgid ""
1925 "The caller does not have permission to access the address space of the "
1926 "process I<pid>."
1927 msgstr ""
1928
1929 #. type: TP
1930 #: 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
1931 #, no-wrap
1932 msgid "B<ESRCH>"
1933 msgstr ""
1934
1935 #. type: Plain text
1936 #: build/C/man2/process_vm_readv.2:274
1937 msgid "No process with ID I<pid> exists."
1938 msgstr ""
1939
1940 #. type: Plain text
1941 #: build/C/man2/process_vm_readv.2:277
1942 msgid ""
1943 "These system calls were added in Linux 3.2.  Support is provided in glibc "
1944 "since version 2.15."
1945 msgstr ""
1946
1947 #. type: Plain text
1948 #: build/C/man2/process_vm_readv.2:279
1949 msgid "These system calls are nonstandard Linux extensions."
1950 msgstr ""
1951
1952 #. type: Plain text
1953 #: build/C/man2/process_vm_readv.2:285
1954 msgid ""
1955 "The data transfers performed by B<process_vm_readv>()  and "
1956 "B<process_vm_writev>()  are not guaranteed to be atomic in any way."
1957 msgstr ""
1958
1959 #.  Original user is MPI, http://www.mcs.anl.gov/research/projects/mpi/
1960 #.  See also some benchmarks at http://lwn.net/Articles/405284/
1961 #.  and http://marc.info/?l=linux-mm&m=130105930902915&w=2
1962 #. type: Plain text
1963 #: build/C/man2/process_vm_readv.2:293
1964 msgid ""
1965 "These system calls were designed to permit fast message passing by allowing "
1966 "messages to be exchanged with a single copy operation (rather than the "
1967 "double copy that would be required when using, for example, shared memory or "
1968 "pipes)."
1969 msgstr ""
1970
1971 #. type: SH
1972 #: build/C/man2/process_vm_readv.2:293 build/C/man2/splice.2:222 build/C/man2/tee.2:129
1973 #, no-wrap
1974 msgid "EXAMPLE"
1975 msgstr ""
1976
1977 #. type: Plain text
1978 #: build/C/man2/process_vm_readv.2:301
1979 msgid ""
1980 "The following code sample demonstrates the use of B<process_vm_readv>().  It "
1981 "reads 20 bytes at the address 0x10000 from the process with PID 10 and "
1982 "writes the first 10 bytes into I<buf1> and the second 10 bytes into I<buf2>."
1983 msgstr ""
1984
1985 #. type: Plain text
1986 #: build/C/man2/process_vm_readv.2:304
1987 #, no-wrap
1988 msgid "#include E<lt>sys/uio.hE<gt>\n"
1989 msgstr ""
1990
1991 #. type: Plain text
1992 #: build/C/man2/process_vm_readv.2:314
1993 #, no-wrap
1994 msgid ""
1995 "int\n"
1996 "main(void)\n"
1997 "{\n"
1998 "    struct iovec local[2];\n"
1999 "    struct iovec remote[1];\n"
2000 "    char buf1[10];\n"
2001 "    char buf2[10];\n"
2002 "    ssize_t nread;\n"
2003 "    pid_t pid = 10;             /* PID of remote process */\n"
2004 msgstr ""
2005
2006 #. type: Plain text
2007 #: build/C/man2/process_vm_readv.2:321
2008 #, no-wrap
2009 msgid ""
2010 "    local[0].iov_base = buf1;\n"
2011 "    local[0].iov_len = 10;\n"
2012 "    local[1].iov_base = buf2;\n"
2013 "    local[1].iov_len = 10;\n"
2014 "    remote[0].iov_base = (void *) 0x10000;\n"
2015 "    remote[1].iov_len = 20;\n"
2016 msgstr ""
2017
2018 #. type: Plain text
2019 #: build/C/man2/process_vm_readv.2:328
2020 #, no-wrap
2021 msgid ""
2022 "    nread = process_vm_readv(pid, local, 2, remote, 1, 0);\n"
2023 "    if (nread != 20)\n"
2024 "        return 1;\n"
2025 "    else\n"
2026 "        return 0;\n"
2027 "}\n"
2028 msgstr ""
2029
2030 #. type: Plain text
2031 #: build/C/man2/process_vm_readv.2:332
2032 msgid "B<readv>(2), B<writev>(2)"
2033 msgstr ""
2034
2035 #. type: TH
2036 #: build/C/man2/ptrace.2:49
2037 #, no-wrap
2038 msgid "PTRACE"
2039 msgstr ""
2040
2041 #. type: TH
2042 #: build/C/man2/ptrace.2:49
2043 #, no-wrap
2044 msgid "2012-04-26"
2045 msgstr ""
2046
2047 #. type: Plain text
2048 #: build/C/man2/ptrace.2:52
2049 msgid "ptrace - process trace"
2050 msgstr ""
2051
2052 #. type: Plain text
2053 #: build/C/man2/ptrace.2:55
2054 #, no-wrap
2055 msgid "B<#include E<lt>sys/ptrace.hE<gt>>\n"
2056 msgstr ""
2057
2058 #. type: Plain text
2059 #: build/C/man2/ptrace.2:58
2060 #, no-wrap
2061 msgid ""
2062 "B<long ptrace(enum __ptrace_request >I<request>B<, pid_t >I<pid>B<, >\n"
2063 "B<            void *>I<addr>B<, void *>I<data>B<);>\n"
2064 msgstr ""
2065
2066 #. type: Plain text
2067 #: build/C/man2/ptrace.2:67
2068 msgid ""
2069 "The B<ptrace>()  system call provides a means by which one process (the "
2070 "\"tracer\")  may observe and control the execution of another process (the "
2071 "\"tracee\"), and examine and change the tracee's memory and registers.  It "
2072 "is primarily used to implement breakpoint debugging and system call tracing."
2073 msgstr ""
2074
2075 #. type: Plain text
2076 #: build/C/man2/ptrace.2:78
2077 msgid ""
2078 "A tracee first needs to be attached to the tracer.  Attachment and "
2079 "subsequent commands are per thread: in a multithreaded process, every thread "
2080 "can be individually attached to a (potentially different) tracer, or left "
2081 "not attached and thus not debugged.  Therefore, \"tracee\" always means "
2082 "\"(one) thread\", never \"a (possibly multithreaded) process\".  Ptrace "
2083 "commands are always sent to a specific tracee using a call of the form"
2084 msgstr ""
2085
2086 #. type: Plain text
2087 #: build/C/man2/ptrace.2:80
2088 #, no-wrap
2089 msgid "    ptrace(PTRACE_foo, pid, ...)\n"
2090 msgstr ""
2091
2092 #. type: Plain text
2093 #: build/C/man2/ptrace.2:84
2094 msgid "where I<pid> is the thread ID of the corresponding Linux thread."
2095 msgstr ""
2096
2097 #. type: Plain text
2098 #: build/C/man2/ptrace.2:90
2099 msgid ""
2100 "(Note that in this page, a \"multithreaded process\" means a thread group "
2101 "consisting of threads created using the B<clone>(2)  B<CLONE_THREAD> flag.)"
2102 msgstr ""
2103
2104 #. type: Plain text
2105 #: build/C/man2/ptrace.2:99
2106 msgid ""
2107 "A process can initiate a trace by calling B<fork>(2)  and having the "
2108 "resulting child do a B<PTRACE_TRACEME>, followed (typically) by an "
2109 "B<execve>(2).  Alternatively, one process may commence tracing another "
2110 "process using B<PTRACE_ATTACH>."
2111 msgstr ""
2112
2113 #. type: Plain text
2114 #: build/C/man2/ptrace.2:116
2115 msgid ""
2116 "While being traced, the tracee will stop each time a signal is delivered, "
2117 "even if the signal is being ignored.  (An exception is B<SIGKILL>, which has "
2118 "its usual effect.)  The tracer will be notified at its next call to "
2119 "B<waitpid>(2)  (or one of the related \"wait\" system calls); that call will "
2120 "return a I<status> value containing information that indicates the cause of "
2121 "the stop in the tracee.  While the tracee is stopped, the tracer can use "
2122 "various ptrace requests to inspect and modify the tracee.  The tracer then "
2123 "causes the tracee to continue, optionally ignoring the delivered signal (or "
2124 "even delivering a different signal instead)."
2125 msgstr ""
2126
2127 #. type: Plain text
2128 #: build/C/man2/ptrace.2:126
2129 msgid ""
2130 "If the B<PTRACE_O_TRACEEXEC> option is not in effect, all successful calls "
2131 "to B<execve>(2)  by the traced process will cause it to be sent a B<SIGTRAP> "
2132 "signal, giving the parent a chance to gain control before the new program "
2133 "begins execution."
2134 msgstr ""
2135
2136 #. type: Plain text
2137 #: build/C/man2/ptrace.2:130
2138 msgid ""
2139 "When the tracer is finished tracing, it can cause the tracee to continue "
2140 "executing in a normal, untraced mode via B<PTRACE_DETACH>."
2141 msgstr ""
2142
2143 #. type: Plain text
2144 #: build/C/man2/ptrace.2:134
2145 msgid "The value of I<request> determines the action to be performed:"
2146 msgstr ""
2147
2148 #. type: TP
2149 #: build/C/man2/ptrace.2:134
2150 #, no-wrap
2151 msgid "B<PTRACE_TRACEME>"
2152 msgstr ""
2153
2154 #. type: Plain text
2155 #: build/C/man2/ptrace.2:144
2156 msgid ""
2157 "Indicate that this process is to be traced by its parent.  A process "
2158 "probably shouldn't make this request if its parent isn't expecting to trace "
2159 "it.  (I<pid>, I<addr>, and I<data> are ignored.)"
2160 msgstr ""
2161
2162 #. type: Plain text
2163 #: build/C/man2/ptrace.2:157
2164 msgid ""
2165 "The B<PTRACE_TRACEME> request is used only by the tracee; the remaining "
2166 "requests are used only by the tracer.  In the following requests, I<pid> "
2167 "specifies the thread ID of the tracee to be acted on.  For requests other "
2168 "than B<PTRACE_ATTACH> and B<PTRACE_KILL>, the tracee must be stopped."
2169 msgstr ""
2170
2171 #. type: TP
2172 #: build/C/man2/ptrace.2:157
2173 #, no-wrap
2174 msgid "B<PTRACE_PEEKTEXT>, B<PTRACE_PEEKDATA>"
2175 msgstr ""
2176
2177 #. type: Plain text
2178 #: build/C/man2/ptrace.2:168
2179 msgid ""
2180 "Read a word at the address I<addr> in the tracee's memory, returning the "
2181 "word as the result of the B<ptrace>()  call.  Linux does not have separate "
2182 "text and data address spaces, so these two requests are currently "
2183 "equivalent.  (I<data> is ignored.)"
2184 msgstr ""
2185
2186 #. type: TP
2187 #: build/C/man2/ptrace.2:168
2188 #, no-wrap
2189 msgid "B<PTRACE_PEEKUSER>"
2190 msgstr ""
2191
2192 #.  PTRACE_PEEKUSR in kernel source, but glibc uses PTRACE_PEEKUSER,
2193 #.  and that is the name that seems common on other systems.
2194 #. type: Plain text
2195 #: build/C/man2/ptrace.2:186
2196 msgid ""
2197 "Read a word at offset I<addr> in the tracee's USER area, which holds the "
2198 "registers and other information about the process (see "
2199 "I<E<lt>sys/user.hE<gt>>).  The word is returned as the result of the "
2200 "B<ptrace>()  call.  Typically, the offset must be word-aligned, though this "
2201 "might vary by architecture.  See NOTES.  (I<data> is ignored.)"
2202 msgstr ""
2203
2204 #. type: TP
2205 #: build/C/man2/ptrace.2:186
2206 #, no-wrap
2207 msgid "B<PTRACE_POKETEXT>, B<PTRACE_POKEDATA>"
2208 msgstr ""
2209
2210 #. type: Plain text
2211 #: build/C/man2/ptrace.2:198
2212 msgid ""
2213 "Copy the word I<data> to the address I<addr> in the tracee's memory.  As for "
2214 "B<PTRACE_PEEKTEXT> and B<PTRACE_PEEKDATA>, these two requests are currently "
2215 "equivalent."
2216 msgstr ""
2217
2218 #. type: TP
2219 #: build/C/man2/ptrace.2:198
2220 #, no-wrap
2221 msgid "B<PTRACE_POKEUSER>"
2222 msgstr ""
2223
2224 #.  PTRACE_POKEUSR in kernel source, but glibc uses PTRACE_POKEUSER,
2225 #.  and that is the name that seems common on other systems.
2226 #.  FIXME In the preceding sentence, which modifications are disallowed,
2227 #.  and when they are disallowed, how does userspace discover that fact?
2228 #. type: Plain text
2229 #: build/C/man2/ptrace.2:214
2230 msgid ""
2231 "Copy the word I<data> to offset I<addr> in the tracee's USER area.  As for "
2232 "B<PTRACE_PEEKUSER>, the offset must typically be word-aligned.  In order to "
2233 "maintain the integrity of the kernel, some modifications to the USER area "
2234 "are disallowed."
2235 msgstr ""
2236
2237 #. type: TP
2238 #: build/C/man2/ptrace.2:214
2239 #, no-wrap
2240 msgid "B<PTRACE_GETREGS>, B<PTRACE_GETFPREGS>"
2241 msgstr ""
2242
2243 #. type: Plain text
2244 #: build/C/man2/ptrace.2:233
2245 msgid ""
2246 "Copy the tracee's general-purpose or floating-point registers, respectively, "
2247 "to the address I<data> in the tracer.  See I<E<lt>sys/user.hE<gt>> for "
2248 "information on the format of this data.  (I<addr> is ignored.)  Note that "
2249 "SPARC systems have the meaning of I<data> and I<addr> reversed; that is, "
2250 "I<data> is ignored and the registers are copied to the address I<addr>."
2251 msgstr ""
2252
2253 #. type: TP
2254 #: build/C/man2/ptrace.2:233
2255 #, no-wrap
2256 msgid "B<PTRACE_GETSIGINFO> (since Linux 2.3.99-pre6)"
2257 msgstr ""
2258
2259 #. type: Plain text
2260 #: build/C/man2/ptrace.2:245
2261 msgid ""
2262 "Retrieve information about the signal that caused the stop.  Copy a "
2263 "I<siginfo_t> structure (see B<sigaction>(2))  from the tracee to the address "
2264 "I<data> in the tracer.  (I<addr> is ignored.)"
2265 msgstr ""
2266
2267 #. type: TP
2268 #: build/C/man2/ptrace.2:245
2269 #, no-wrap
2270 msgid "B<PTRACE_SETREGS>, B<PTRACE_SETFPREGS>"
2271 msgstr ""
2272
2273 #.  FIXME In the preceding sentence, which modifications are disallowed,
2274 #.  and when they are disallowed, how does userspace discover that fact?
2275 #. type: Plain text
2276 #: build/C/man2/ptrace.2:266
2277 msgid ""
2278 "Copy the tracee's general-purpose or floating-point registers, respectively, "
2279 "from the address I<data> in the tracer.  As for B<PTRACE_POKEUSER>, some "
2280 "general-purpose register modifications may be disallowed.  (I<addr> is "
2281 "ignored.)  Note that SPARC systems have the meaning of I<data> and I<addr> "
2282 "reversed; that is, I<data> is ignored and the registers are copied from the "
2283 "address I<addr>."
2284 msgstr ""
2285
2286 #. type: TP
2287 #: build/C/man2/ptrace.2:266
2288 #, no-wrap
2289 msgid "B<PTRACE_SETSIGINFO> (since Linux 2.3.99-pre6)"
2290 msgstr ""
2291
2292 #. type: Plain text
2293 #: build/C/man2/ptrace.2:282
2294 msgid ""
2295 "Set signal information: copy a I<siginfo_t> structure from the address "
2296 "I<data> in the tracer to the tracee.  This will affect only signals that "
2297 "would normally be delivered to the tracee and were caught by the tracer.  It "
2298 "may be difficult to tell these normal signals from synthetic signals "
2299 "generated by B<ptrace>()  itself.  (I<addr> is ignored.)"
2300 msgstr ""
2301
2302 #. type: TP
2303 #: build/C/man2/ptrace.2:282
2304 #, no-wrap
2305 msgid "B<PTRACE_SETOPTIONS> (since Linux 2.4.6; see BUGS for caveats)"
2306 msgstr ""
2307
2308 #. type: Plain text
2309 #: build/C/man2/ptrace.2:291
2310 msgid ""
2311 "Set ptrace options from I<data>.  (I<addr> is ignored.)  I<data> is "
2312 "interpreted as a bit mask of options, which are specified by the following "
2313 "flags:"
2314 msgstr ""
2315
2316 #. type: TP
2317 #: build/C/man2/ptrace.2:292
2318 #, no-wrap
2319 msgid "B<PTRACE_O_TRACESYSGOOD> (since Linux 2.4.6)"
2320 msgstr ""
2321
2322 #. type: Plain text
2323 #: build/C/man2/ptrace.2:301
2324 msgid ""
2325 "When delivering system call traps, set bit 7 in the signal number (i.e., "
2326 "deliver I<SIGTRAP|0x80>).  This makes it easy for the tracer to distinguish "
2327 "normal traps from those caused by a system call.  (B<PTRACE_O_TRACESYSGOOD> "
2328 "may not work on all architectures.)"
2329 msgstr ""
2330
2331 #. type: TP
2332 #: build/C/man2/ptrace.2:301
2333 #, no-wrap
2334 msgid "B<PTRACE_O_TRACEFORK> (since Linux 2.5.46)"
2335 msgstr ""
2336
2337 #. type: Plain text
2338 #: build/C/man2/ptrace.2:313
2339 msgid ""
2340 "Stop the tracee at the next B<fork>(2)  and automatically start tracing the "
2341 "newly forked process, which will start with a B<SIGSTOP>.  A B<waitpid>(2)  "
2342 "by the tracer will return a I<status> value such that"
2343 msgstr ""
2344
2345 #. type: Plain text
2346 #: build/C/man2/ptrace.2:316
2347 #, no-wrap
2348 msgid "  statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_FORKE<lt>E<lt>8))\n"
2349 msgstr ""
2350
2351 #. type: Plain text
2352 #: build/C/man2/ptrace.2:320 build/C/man2/ptrace.2:339 build/C/man2/ptrace.2:358
2353 msgid "The PID of the new process can be retrieved with B<PTRACE_GETEVENTMSG>."
2354 msgstr ""
2355
2356 #. type: TP
2357 #: build/C/man2/ptrace.2:320
2358 #, no-wrap
2359 msgid "B<PTRACE_O_TRACEVFORK> (since Linux 2.5.46)"
2360 msgstr ""
2361
2362 #. type: Plain text
2363 #: build/C/man2/ptrace.2:332
2364 msgid ""
2365 "Stop the tracee at the next B<vfork>(2)  and automatically start tracing the "
2366 "newly vforked process, which will start with a B<SIGSTOP>.  A B<waitpid>(2)  "
2367 "by the tracer will return a I<status> value such that"
2368 msgstr ""
2369
2370 #. type: Plain text
2371 #: build/C/man2/ptrace.2:335
2372 #, no-wrap
2373 msgid "  statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_VFORKE<lt>E<lt>8))\n"
2374 msgstr ""
2375
2376 #. type: TP
2377 #: build/C/man2/ptrace.2:339
2378 #, no-wrap
2379 msgid "B<PTRACE_O_TRACECLONE> (since Linux 2.5.46)"
2380 msgstr ""
2381
2382 #. type: Plain text
2383 #: build/C/man2/ptrace.2:351
2384 msgid ""
2385 "Stop the tracee at the next B<clone>(2)  and automatically start tracing the "
2386 "newly cloned process, which will start with a B<SIGSTOP>.  A B<waitpid>(2)  "
2387 "by the tracer will return a I<status> value such that"
2388 msgstr ""
2389
2390 #. type: Plain text
2391 #: build/C/man2/ptrace.2:354
2392 #, no-wrap
2393 msgid "  statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_CLONEE<lt>E<lt>8))\n"
2394 msgstr ""
2395
2396 #. type: Plain text
2397 #: build/C/man2/ptrace.2:379
2398 msgid ""
2399 "This option may not catch B<clone>(2)  calls in all cases.  If the tracee "
2400 "calls B<clone>(2)  with the B<CLONE_VFORK> flag, B<PTRACE_EVENT_VFORK> will "
2401 "be delivered instead if B<PTRACE_O_TRACEVFORK> is set; otherwise if the "
2402 "tracee calls B<clone>(2)  with the exit signal set to B<SIGCHLD>, "
2403 "B<PTRACE_EVENT_FORK> will be delivered if B<PTRACE_O_TRACEFORK> is set."
2404 msgstr ""
2405
2406 #. type: TP
2407 #: build/C/man2/ptrace.2:379
2408 #, no-wrap
2409 msgid "B<PTRACE_O_TRACEEXEC> (since Linux 2.5.46)"
2410 msgstr ""
2411
2412 #. type: Plain text
2413 #: build/C/man2/ptrace.2:388
2414 msgid ""
2415 "Stop the tracee at the next B<execve>(2).  A B<waitpid>(2)  by the tracer "
2416 "will return a I<status> value such that"
2417 msgstr ""
2418
2419 #. type: Plain text
2420 #: build/C/man2/ptrace.2:391
2421 #, no-wrap
2422 msgid "  statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_EXECE<lt>E<lt>8))\n"
2423 msgstr ""
2424
2425 #. type: Plain text
2426 #: build/C/man2/ptrace.2:397
2427 msgid ""
2428 "If the execing thread is not a thread group leader, the thread ID is reset "
2429 "to thread group leader's ID before this stop.  Since Linux 3.0, the former "
2430 "thread ID can be retrieved with B<PTRACE_GETEVENTMSG>."
2431 msgstr ""
2432
2433 #. type: TP
2434 #: build/C/man2/ptrace.2:397
2435 #, no-wrap
2436 msgid "B<PTRACE_O_TRACEVFORKDONE> (since Linux 2.5.60)"
2437 msgstr ""
2438
2439 #. type: Plain text
2440 #: build/C/man2/ptrace.2:406
2441 msgid ""
2442 "Stop the tracee at the completion of the next B<vfork>(2).  A B<waitpid>(2)  "
2443 "by the tracer will return a I<status> value such that"
2444 msgstr ""
2445
2446 #. type: Plain text
2447 #: build/C/man2/ptrace.2:409
2448 #, no-wrap
2449 msgid "  statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_VFORK_DONEE<lt>E<lt>8))\n"
2450 msgstr ""
2451
2452 #. type: Plain text
2453 #: build/C/man2/ptrace.2:413
2454 msgid ""
2455 "The PID of the new process can (since Linux 2.6.18) be retrieved with "
2456 "B<PTRACE_GETEVENTMSG>."
2457 msgstr ""
2458
2459 #. type: TP
2460 #: build/C/man2/ptrace.2:413
2461 #, no-wrap
2462 msgid "B<PTRACE_O_TRACEEXIT> (since Linux 2.5.60)"
2463 msgstr ""
2464
2465 #. type: Plain text
2466 #: build/C/man2/ptrace.2:421
2467 msgid ""
2468 "Stop the tracee at exit.  A B<waitpid>(2)  by the tracer will return a "
2469 "I<status> value such that"
2470 msgstr ""
2471
2472 #. type: Plain text
2473 #: build/C/man2/ptrace.2:424
2474 #, no-wrap
2475 msgid "  statusE<gt>E<gt>8 == (SIGTRAP | (PTRACE_EVENT_EXITE<lt>E<lt>8))\n"
2476 msgstr ""
2477
2478 #. type: Plain text
2479 #: build/C/man2/ptrace.2:428
2480 msgid "The tracee's exit status can be retrieved with B<PTRACE_GETEVENTMSG>."
2481 msgstr ""
2482
2483 #. type: Plain text
2484 #: build/C/man2/ptrace.2:436
2485 msgid ""
2486 "The tracee is stopped early during process exit, when registers are still "
2487 "available, allowing the tracer to see where the exit occurred, whereas the "
2488 "normal exit notification is done after the process is finished exiting.  "
2489 "Even though context is available, the tracer cannot prevent the exit from "
2490 "happening at this point."
2491 msgstr ""
2492
2493 #. type: TP
2494 #: build/C/man2/ptrace.2:437
2495 #, no-wrap
2496 msgid "B<PTRACE_GETEVENTMSG> (since Linux 2.5.46)"
2497 msgstr ""
2498
2499 #. type: Plain text
2500 #: build/C/man2/ptrace.2:457
2501 msgid ""
2502 "Retrieve a message (as an I<unsigned long>)  about the ptrace event that "
2503 "just happened, placing it at the address I<data> in the tracer.  For "
2504 "B<PTRACE_EVENT_EXIT>, this is the tracee's exit status.  For "
2505 "B<PTRACE_EVENT_FORK>, B<PTRACE_EVENT_VFORK>, B<PTRACE_EVENT_VFORK_DONE>, and "
2506 "B<PTRACE_EVENT_CLONE>, this is the PID of the new process.  (I<addr> is "
2507 "ignored.)"
2508 msgstr ""
2509
2510 #. type: TP
2511 #: build/C/man2/ptrace.2:457
2512 #, no-wrap
2513 msgid "B<PTRACE_CONT>"
2514 msgstr ""
2515
2516 #. type: Plain text
2517 #: build/C/man2/ptrace.2:469
2518 msgid ""
2519 "Restart the stopped tracee process.  If I<data> is nonzero, it is "
2520 "interpreted as the number of a signal to be delivered to the tracee; "
2521 "otherwise, no signal is delivered.  Thus, for example, the tracer can "
2522 "control whether a signal sent to the tracee is delivered or not.  (I<addr> "
2523 "is ignored.)"
2524 msgstr ""
2525
2526 #. type: TP
2527 #: build/C/man2/ptrace.2:469
2528 #, no-wrap
2529 msgid "B<PTRACE_SYSCALL>, B<PTRACE_SINGLESTEP>"
2530 msgstr ""
2531
2532 #. type: Plain text
2533 #: build/C/man2/ptrace.2:493
2534 msgid ""
2535 "Restart the stopped tracee as for B<PTRACE_CONT>, but arrange for the tracee "
2536 "to be stopped at the next entry to or exit from a system call, or after "
2537 "execution of a single instruction, respectively.  (The tracee will also, as "
2538 "usual, be stopped upon receipt of a signal.)  From the tracer's perspective, "
2539 "the tracee will appear to have been stopped by receipt of a B<SIGTRAP>.  So, "
2540 "for B<PTRACE_SYSCALL>, for example, the idea is to inspect the arguments to "
2541 "the system call at the first stop, then do another B<PTRACE_SYSCALL> and "
2542 "inspect the return value of the system call at the second stop.  The I<data> "
2543 "argument is treated as for B<PTRACE_CONT>.  (I<addr> is ignored.)"
2544 msgstr ""
2545
2546 #. type: TP
2547 #: build/C/man2/ptrace.2:493
2548 #, no-wrap
2549 msgid "B<PTRACE_SYSEMU>, B<PTRACE_SYSEMU_SINGLESTEP> (since Linux 2.6.14)"
2550 msgstr ""
2551
2552 #. type: Plain text
2553 #: build/C/man2/ptrace.2:511
2554 msgid ""
2555 "For B<PTRACE_SYSEMU>, continue and stop on entry to the next system call, "
2556 "which will not be executed.  For B<PTRACE_SYSEMU_SINGLESTEP>, do the same "
2557 "but also singlestep if not a system call.  This call is used by programs "
2558 "like User Mode Linux that want to emulate all the tracee's system calls.  "
2559 "The I<data> argument is treated as for B<PTRACE_CONT>.  (I<addr> is ignored; "
2560 "not supported on all architectures.)"
2561 msgstr ""
2562
2563 #. type: TP
2564 #: build/C/man2/ptrace.2:511
2565 #, no-wrap
2566 msgid "B<PTRACE_KILL>"
2567 msgstr ""
2568
2569 #. type: Plain text
2570 #: build/C/man2/ptrace.2:520
2571 msgid ""
2572 "Send the tracee a B<SIGKILL> to terminate it.  (I<addr> and I<data> are "
2573 "ignored.)"
2574 msgstr ""
2575
2576 #.  [Note from Denys Vlasenko:
2577 #.      deprecation suggested by Oleg Nesterov. He prefers to deprecate it
2578 #.      instead of describing (and needing to support) PTRACE_KILL's quirks.]
2579 #. type: Plain text
2580 #: build/C/man2/ptrace.2:539
2581 msgid ""
2582 "I<This operation is deprecated; do not use it!> Instead, send a B<SIGKILL> "
2583 "directly using B<kill>(2)  or B<tgkill>(2).  The problem with B<PTRACE_KILL> "
2584 "is that it requires the tracee to be in signal-delivery-stop, otherwise it "
2585 "may not work (i.e., may complete successfully but won't kill the tracee).  "
2586 "By contrast, sending a B<SIGKILL> directly has no such limitation."
2587 msgstr ""
2588
2589 #. type: TP
2590 #: build/C/man2/ptrace.2:539
2591 #, no-wrap
2592 msgid "B<PTRACE_ATTACH>"
2593 msgstr ""
2594
2595 #.  No longer true (removed by Denys Vlasenko, 2011, who remarks:
2596 #.         "I think it isn't true in non-ancient 2.4 and in 2.6/3.x.
2597 #.          Basically, it's not true for any Linux in practical use.
2598 #.  ; the behavior of the tracee is as if it had done a
2599 #.  .BR PTRACE_TRACEME .
2600 #.  The calling process actually becomes the parent of the tracee
2601 #.  process for most purposes (e.g., it will receive
2602 #.  notification of tracee events and appears in
2603 #.  .BR ps (1)
2604 #.  output as the tracee's parent), but a
2605 #.  .BR getppid (2)
2606 #.  by the tracee will still return the PID of the original parent.
2607 #. type: Plain text
2608 #: build/C/man2/ptrace.2:567
2609 msgid ""
2610 "Attach to the process specified in I<pid>, making it a tracee of the calling "
2611 "process.  The tracee is sent a B<SIGSTOP>, but will not necessarily have "
2612 "stopped by the completion of this call; use B<waitpid>(2)  to wait for the "
2613 "tracee to stop.  See the \"Attaching and detaching\" subsection for "
2614 "additional information.  (I<addr> and I<data> are ignored.)"
2615 msgstr ""
2616
2617 #. type: TP
2618 #: build/C/man2/ptrace.2:567
2619 #, no-wrap
2620 msgid "B<PTRACE_DETACH>"
2621 msgstr ""
2622
2623 #. type: Plain text
2624 #: build/C/man2/ptrace.2:576
2625 msgid ""
2626 "Restart the stopped tracee as for B<PTRACE_CONT>, but first detach from it.  "
2627 "Under Linux, a tracee can be detached in this way regardless of which method "
2628 "was used to initiate tracing.  (I<addr> is ignored.)"
2629 msgstr ""
2630
2631 #. type: SS
2632 #: build/C/man2/ptrace.2:576
2633 #, no-wrap
2634 msgid "Death under ptrace"
2635 msgstr ""
2636
2637 #. type: Plain text
2638 #: build/C/man2/ptrace.2:585
2639 msgid ""
2640 "When a (possibly multithreaded) process receives a killing signal (one whose "
2641 "disposition is set to B<SIG_DFL> and whose default action is to kill the "
2642 "process), all threads exit.  Tracees report their death to their tracer(s).  "
2643 "Notification of this event is delivered via B<waitpid>(2)."
2644 msgstr ""
2645
2646 #. type: Plain text
2647 #: build/C/man2/ptrace.2:594
2648 msgid ""
2649 "Note that the killing signal will first cause signal-delivery-stop (on one "
2650 "tracee only), and only after it is injected by the tracer (or after it was "
2651 "dispatched to a thread which isn't traced), will death from the signal "
2652 "happen on I<all> tracees within a multithreaded process.  (The term "
2653 "\"signal-delivery-stop\" is explained below.)"
2654 msgstr ""
2655
2656 #. type: Plain text
2657 #: build/C/man2/ptrace.2:608
2658 msgid ""
2659 "B<SIGKILL> operates similarly, with exceptions.  No signal-delivery-stop is "
2660 "generated for B<SIGKILL> and therefore the tracer can't suppress it.  "
2661 "B<SIGKILL> kills even within system calls (syscall-exit-stop is not "
2662 "generated prior to death by B<SIGKILL>).  The net effect is that B<SIGKILL> "
2663 "always kills the process (all its threads), even if some threads of the "
2664 "process are ptraced."
2665 msgstr ""
2666
2667 #. type: Plain text
2668 #: build/C/man2/ptrace.2:613
2669 msgid ""
2670 "When the tracee calls B<_exit>(2), it reports its death to its tracer.  "
2671 "Other threads are not affected."
2672 msgstr ""
2673
2674 #. type: Plain text
2675 #: build/C/man2/ptrace.2:617
2676 msgid ""
2677 "When any thread executes B<exit_group>(2), every tracee in its thread group "
2678 "reports its death to its tracer."
2679 msgstr ""
2680
2681 #. type: Plain text
2682 #: build/C/man2/ptrace.2:631
2683 msgid ""
2684 "If the B<PTRACE_O_TRACEEXIT> option is on, B<PTRACE_EVENT_EXIT> will happen "
2685 "before actual death.  This applies to exits via B<exit>(2), "
2686 "B<exit_group>(2), and signal deaths (except B<SIGKILL>), and when threads "
2687 "are torn down on B<execve>(2)  in a multithreaded process."
2688 msgstr ""
2689
2690 #. type: Plain text
2691 #: build/C/man2/ptrace.2:656
2692 msgid ""
2693 "The tracer cannot assume that the ptrace-stopped tracee exists.  There are "
2694 "many scenarios when the tracee may die while stopped (such as B<SIGKILL>).  "
2695 "Therefore, the tracer must be prepared to handle an B<ESRCH> error on any "
2696 "ptrace operation.  Unfortunately, the same error is returned if the tracee "
2697 "exists but is not ptrace-stopped (for commands which require a stopped "
2698 "tracee), or if it is not traced by the process which issued the ptrace "
2699 "call.  The tracer needs to keep track of the stopped/running state of the "
2700 "tracee, and interpret B<ESRCH> as \"tracee died unexpectedly\" only if it "
2701 "knows that the tracee has been observed to enter ptrace-stop.  Note that "
2702 "there is no guarantee that I<waitpid(WNOHANG)> will reliably report the "
2703 "tracee's death status if a ptrace operation returned B<ESRCH>.  "
2704 "I<waitpid(WNOHANG)> may return 0 instead.  In other words, the tracee may be "
2705 "\"not yet fully dead\", but already refusing ptrace requests."
2706 msgstr ""
2707
2708 #. type: Plain text
2709 #: build/C/man2/ptrace.2:670
2710 msgid ""
2711 "The tracer can't assume that the tracee I<always> ends its life by reporting "
2712 "I<WIFEXITED(status)> or I<WIFSIGNALED(status)>; there are cases where this "
2713 "does not occur.  For example, if a thread other than thread group leader "
2714 "does an B<execve>(2), it disappears; its PID will never be seen again, and "
2715 "any subsequent ptrace stops will be reported under the thread group leader's "
2716 "PID."
2717 msgstr ""
2718
2719 #. type: SS
2720 #: build/C/man2/ptrace.2:670
2721 #, no-wrap
2722 msgid "Stopped states"
2723 msgstr ""
2724
2725 #. type: Plain text
2726 #: build/C/man2/ptrace.2:672
2727 msgid "A tracee can be in two states: running or stopped."
2728 msgstr ""
2729
2730 #. type: Plain text
2731 #: build/C/man2/ptrace.2:676
2732 msgid ""
2733 "There are many kinds of states when the tracee is stopped, and in ptrace "
2734 "discussions they are often conflated.  Therefore, it is important to use "
2735 "precise terms."
2736 msgstr ""
2737
2738 #. type: Plain text
2739 #: build/C/man2/ptrace.2:687
2740 msgid ""
2741 "In this manual page, any stopped state in which the tracee is ready to "
2742 "accept ptrace commands from the tracer is called I<ptrace-stop>.  "
2743 "Ptrace-stops can be further subdivided into I<signal-delivery-stop>, "
2744 "I<group-stop>, I<syscall-stop>, and so on.  These stopped states are "
2745 "described in detail below."
2746 msgstr ""
2747
2748 #. type: Plain text
2749 #: build/C/man2/ptrace.2:692
2750 msgid ""
2751 "When the running tracee enters ptrace-stop, it notifies its tracer using "
2752 "B<waitpid>(2)  (or one of the other \"wait\" system calls).  Most of this "
2753 "manual page assumes that the tracer waits with:"
2754 msgstr ""
2755
2756 #. type: Plain text
2757 #: build/C/man2/ptrace.2:694
2758 #, no-wrap
2759 msgid "    pid = waitpid(pid_or_minus_1, &status, __WALL);\n"
2760 msgstr ""
2761
2762 #.  Denys Vlasenko:
2763 #.      Do we require __WALL usage, or will just using 0 be ok? (With 0,
2764 #.      I am not 100% sure there aren't ugly corner cases.) Are the
2765 #.      rules different if user wants to use waitid? Will waitid require
2766 #.      WEXITED?
2767 #. type: Plain text
2768 #: build/C/man2/ptrace.2:706
2769 msgid ""
2770 "Ptrace-stopped tracees are reported as returns with I<pid> greater than 0 "
2771 "and I<WIFSTOPPED(status)> true."
2772 msgstr ""
2773
2774 #. type: Plain text
2775 #: build/C/man2/ptrace.2:714
2776 msgid ""
2777 "The B<__WALL> flag does not include the B<WSTOPPED> and B<WEXITED> flags, "
2778 "but implies their functionality."
2779 msgstr ""
2780
2781 #. type: Plain text
2782 #: build/C/man2/ptrace.2:721
2783 msgid ""
2784 "Setting the B<WCONTINUED> flag when calling B<waitpid>(2)  is not "
2785 "recommended: the \"continued\" state is per-process and consuming it can "
2786 "confuse the real parent of the tracee."
2787 msgstr ""
2788
2789 #. type: Plain text
2790 #: build/C/man2/ptrace.2:729
2791 msgid ""
2792 "Use of the B<WNOHANG> flag may cause B<waitpid>(2)  to return 0 (\"no wait "
2793 "results available yet\")  even if the tracer knows there should be a "
2794 "notification.  Example:"
2795 msgstr ""
2796
2797 #. type: Plain text
2798 #: build/C/man2/ptrace.2:733
2799 #, no-wrap
2800 msgid ""
2801 "    kill(tracee, SIGKILL);\n"
2802 "    waitpid(tracee, &status, __WALL | WNOHANG);\n"
2803 msgstr ""
2804
2805 #. type: Plain text
2806 #: build/C/man2/ptrace.2:756
2807 msgid ""
2808 "The following kinds of ptrace-stops exist: signal-delivery-stops, "
2809 "group-stops, B<PTRACE_EVENT> stops, syscall-stops.  They all are reported by "
2810 "B<waitpid>(2)  with I<WIFSTOPPED(status)> true.  They may be differentiated "
2811 "by examining the value I<statusE<gt>E<gt>8>, and if there is ambiguity in "
2812 "that value, by querying B<PTRACE_GETSIGINFO>.  (Note: the "
2813 "I<WSTOPSIG(status)> macro can't be used to perform this examination, because "
2814 "it returns the value I<(status\\E<gt>E<gt>8)\\ &\\ 0xff>.)"
2815 msgstr ""
2816
2817 #. type: SS
2818 #: build/C/man2/ptrace.2:756
2819 #, no-wrap
2820 msgid "Signal-delivery-stop"
2821 msgstr ""
2822
2823 #. type: Plain text
2824 #: build/C/man2/ptrace.2:776
2825 msgid ""
2826 "When a (possibly multithreaded) process receives any signal except "
2827 "B<SIGKILL>, the kernel selects an arbitrary thread which handles the "
2828 "signal.  (If the signal is generated with B<tgkill>(2), the target thread "
2829 "can be explicitly selected by the caller.)  If the selected thread is "
2830 "traced, it enters signal-delivery-stop.  At this point, the signal is not "
2831 "yet delivered to the process, and can be suppressed by the tracer.  If the "
2832 "tracer doesn't suppress the signal, it passes the signal to the tracee in "
2833 "the next ptrace restart request.  This second step of signal delivery is "
2834 "called I<signal injection> in this manual page.  Note that if the signal is "
2835 "blocked, signal-delivery-stop doesn't happen until the signal is unblocked, "
2836 "with the usual exception that B<SIGSTOP> can't be blocked."
2837 msgstr ""
2838
2839 #. type: Plain text
2840 #: build/C/man2/ptrace.2:790
2841 msgid ""
2842 "Signal-delivery-stop is observed by the tracer as B<waitpid>(2)  returning "
2843 "with I<WIFSTOPPED(status)> true, with the signal returned by "
2844 "I<WSTOPSIG(status)>.  If the signal is B<SIGTRAP>, this may be a different "
2845 "kind of ptrace-stop; see the \"Syscall-stops\" and \"execve\" sections below "
2846 "for details.  If I<WSTOPSIG(status)> returns a stopping signal, this may be "
2847 "a group-stop; see below."
2848 msgstr ""
2849
2850 #. type: SS
2851 #: build/C/man2/ptrace.2:790
2852 #, no-wrap
2853 msgid "Signal injection and suppression"
2854 msgstr ""
2855
2856 #. type: Plain text
2857 #: build/C/man2/ptrace.2:793
2858 msgid ""
2859 "After signal-delivery-stop is observed by the tracer, the tracer should "
2860 "restart the tracee with the call"
2861 msgstr ""
2862
2863 #. type: Plain text
2864 #: build/C/man2/ptrace.2:795
2865 #, no-wrap
2866 msgid "    ptrace(PTRACE_restart, pid, 0, sig)\n"
2867 msgstr ""
2868
2869 #. type: Plain text
2870 #: build/C/man2/ptrace.2:808
2871 msgid ""
2872 "where B<PTRACE_restart> is one of the restarting ptrace requests.  If I<sig> "
2873 "is 0, then a signal is not delivered.  Otherwise, the signal I<sig> is "
2874 "delivered.  This operation is called I<signal injection> in this manual "
2875 "page, to distinguish it from signal-delivery-stop."
2876 msgstr ""
2877
2878 #. type: Plain text
2879 #: build/C/man2/ptrace.2:814
2880 msgid ""
2881 "The I<sig> value may be different from the I<WSTOPSIG(status)> value: the "
2882 "tracer can cause a different signal to be injected."
2883 msgstr ""
2884
2885 #. type: Plain text
2886 #: build/C/man2/ptrace.2:830
2887 msgid ""
2888 "Note that a suppressed signal still causes system calls to return "
2889 "prematurely.  In this case system calls will be restarted: the tracer will "
2890 "observe the tracee to reexecute the interrupted system call (or "
2891 "B<restart_syscall>(2)  system call for a few syscalls which use a different "
2892 "mechanism for restarting) if the tracer uses B<PTRACE_SYSCALL>.  Even system "
2893 "calls (such as B<poll>(2))  which are not restartable after signal are "
2894 "restarted after signal is suppressed; however, kernel bugs exist which cause "
2895 "some syscalls to fail with B<EINTR> even though no observable signal is "
2896 "injected to the tracee."
2897 msgstr ""
2898
2899 #. type: Plain text
2900 #: build/C/man2/ptrace.2:841
2901 msgid ""
2902 "Restarting ptrace commands issued in ptrace-stops other than "
2903 "signal-delivery-stop are not guaranteed to inject a signal, even if I<sig> "
2904 "is nonzero.  No error is reported; a nonzero I<sig> may simply be ignored.  "
2905 "Ptrace users should not try to \"create a new signal\" this way: use "
2906 "B<tgkill>(2)  instead."
2907 msgstr ""
2908
2909 #. type: Plain text
2910 #: build/C/man2/ptrace.2:848
2911 msgid ""
2912 "The fact that signal injection requests may be ignored when restarting the "
2913 "tracee after ptrace stops that are not signal-delivery-stops is a cause of "
2914 "confusion among ptrace users.  One typical scenario is that the tracer "
2915 "observes group-stop, mistakes it for signal-delivery-stop, restarts the "
2916 "tracee with"
2917 msgstr ""
2918
2919 #. type: Plain text
2920 #: build/C/man2/ptrace.2:850
2921 #, no-wrap
2922 msgid "    ptrace(PTRACE_rest, pid, 0, stopsig)\n"
2923 msgstr ""
2924
2925 #. type: Plain text
2926 #: build/C/man2/ptrace.2:856
2927 msgid ""
2928 "with the intention of injecting I<stopsig>, but I<stopsig> gets ignored and "
2929 "the tracee continues to run."
2930 msgstr ""
2931
2932 #. type: Plain text
2933 #: build/C/man2/ptrace.2:876
2934 msgid ""
2935 "The B<SIGCONT> signal has a side effect of waking up (all threads of)  a "
2936 "group-stopped process.  This side effect happens before "
2937 "signal-delivery-stop.  The tracer can't suppress this side effect (it can "
2938 "only suppress signal injection, which only causes the B<SIGCONT> handler to "
2939 "not be executed in the tracee, if such a handler is installed).  In fact, "
2940 "waking up from group-stop may be followed by signal-delivery-stop for "
2941 "signal(s)  I<other than> B<SIGCONT>, if they were pending when B<SIGCONT> "
2942 "was delivered.  In other words, B<SIGCONT> may be not the first signal "
2943 "observed by the tracee after it was sent."
2944 msgstr ""
2945
2946 #. type: Plain text
2947 #: build/C/man2/ptrace.2:880
2948 msgid ""
2949 "Stopping signals cause (all threads of) a process to enter group-stop.  This "
2950 "side effect happens after signal injection, and therefore can be suppressed "
2951 "by the tracer."
2952 msgstr ""
2953
2954 #.  In the Linux 2.4 sources, in arch/i386/kernel/signal.c::do_signal(),
2955 #.  there is:
2956 #
2957 #.              /* The debugger continued.  Ignore SIGSTOP.  */
2958 #.              if (signr == SIGSTOP)
2959 #.                      continue;
2960 #. type: Plain text
2961 #: build/C/man2/ptrace.2:890
2962 msgid "In Linux 2.4 and earlier, the B<SIGSTOP> signal can't be injected."
2963 msgstr ""
2964
2965 #. type: Plain text
2966 #: build/C/man2/ptrace.2:907
2967 msgid ""
2968 "B<PTRACE_GETSIGINFO> can be used to retrieve a I<siginfo_t> structure which "
2969 "corresponds to the delivered signal.  B<PTRACE_SETSIGINFO> may be used to "
2970 "modify it.  If B<PTRACE_SETSIGINFO> has been used to alter I<siginfo_t>, the "
2971 "I<si_signo> field and the I<sig> parameter in the restarting command must "
2972 "match, otherwise the result is undefined."
2973 msgstr ""
2974
2975 #. type: SS
2976 #: build/C/man2/ptrace.2:907
2977 #, no-wrap
2978 msgid "Group-stop"
2979 msgstr ""
2980
2981 #. type: Plain text
2982 #: build/C/man2/ptrace.2:919
2983 msgid ""
2984 "When a (possibly multithreaded) process receives a stopping signal, all "
2985 "threads stop.  If some threads are traced, they enter a group-stop.  Note "
2986 "that the stopping signal will first cause signal-delivery-stop (on one "
2987 "tracee only), and only after it is injected by the tracer (or after it was "
2988 "dispatched to a thread which isn't traced), will group-stop be initiated on "
2989 "I<all> tracees within the multithreaded process.  As usual, every tracee "
2990 "reports its group-stop separately to the corresponding tracer."
2991 msgstr ""
2992
2993 #. type: Plain text
2994 #: build/C/man2/ptrace.2:928
2995 msgid ""
2996 "Group-stop is observed by the tracer as B<waitpid>(2)  returning with "
2997 "I<WIFSTOPPED(status)> true, with the stopping signal available via "
2998 "I<WSTOPSIG(status)>.  The same result is returned by some other classes of "
2999 "ptrace-stops, therefore the recommended practice is to perform the call"
3000 msgstr ""
3001
3002 #. type: Plain text
3003 #: build/C/man2/ptrace.2:930
3004 #, no-wrap
3005 msgid "    ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo)\n"
3006 msgstr ""
3007
3008 #. type: Plain text
3009 #: build/C/man2/ptrace.2:951
3010 msgid ""
3011 "The call can be avoided if the signal is not B<SIGSTOP>, B<SIGTSTP>, "
3012 "B<SIGTTIN>, or B<SIGTTOU>; only these four signals are stopping signals.  If "
3013 "the tracer sees something else, it can't be a group-stop.  Otherwise, the "
3014 "tracer needs to call B<PTRACE_GETSIGINFO>.  If B<PTRACE_GETSIGINFO> fails "
3015 "with B<EINVAL>, then it is definitely a group-stop.  (Other failure codes "
3016 "are possible, such as B<ESRCH> (\"no such process\") if a B<SIGKILL> killed "
3017 "the tracee.)"
3018 msgstr ""
3019
3020 #. type: Plain text
3021 #: build/C/man2/ptrace.2:960
3022 msgid ""
3023 "As of kernel 2.6.38, after the tracer sees the tracee ptrace-stop and until "
3024 "it restarts or kills it, the tracee will not run, and will not send "
3025 "notifications (except B<SIGKILL> death) to the tracer, even if the tracer "
3026 "enters into another B<waitpid>(2)  call."
3027 msgstr ""
3028
3029 #. type: Plain text
3030 #: build/C/man2/ptrace.2:974
3031 msgid ""
3032 "The kernel behavior described in the previous paragraph causes a problem "
3033 "with transparent handling of stopping signals.  If the tracer restarts the "
3034 "tracee after group-stop, the stopping signal is effectively ignored\\(emthe "
3035 "tracee doesn't remain stopped, it runs.  If the tracer doesn't restart the "
3036 "tracee before entering into the next B<waitpid>(2), future B<SIGCONT> "
3037 "signals will not be reported to the tracer; this would cause the B<SIGCONT> "
3038 "signals to have no effect on the tracee."
3039 msgstr ""
3040
3041 #. type: SS
3042 #: build/C/man2/ptrace.2:974
3043 #, no-wrap
3044 msgid "PTRACE_EVENT stops"
3045 msgstr ""
3046
3047 #. type: Plain text
3048 #: build/C/man2/ptrace.2:980
3049 msgid ""
3050 "If the tracer sets B<PTRACE_O_TRACE_*> options, the tracee will enter "
3051 "ptrace-stops called B<PTRACE_EVENT> stops."
3052 msgstr ""
3053
3054 #. type: Plain text
3055 #: build/C/man2/ptrace.2:994
3056 msgid ""
3057 "B<PTRACE_EVENT> stops are observed by the tracer as B<waitpid>(2)  returning "
3058 "with I<WIFSTOPPED(status)>, and I<WSTOPSIG(status)> returns B<SIGTRAP>.  An "
3059 "additional bit is set in the higher byte of the status word: the value "
3060 "I<statusE<gt>E<gt>8> will be"
3061 msgstr ""
3062
3063 #. type: Plain text
3064 #: build/C/man2/ptrace.2:996
3065 #, no-wrap
3066 msgid "    (SIGTRAP | PTRACE_EVENT_foo E<lt>E<lt> 8).\n"
3067 msgstr ""
3068
3069 #. type: Plain text
3070 #: build/C/man2/ptrace.2:998
3071 msgid "The following events exist:"
3072 msgstr ""
3073
3074 #. type: TP
3075 #: build/C/man2/ptrace.2:998
3076 #, no-wrap
3077 msgid "B<PTRACE_EVENT_VFORK>"
3078 msgstr ""
3079
3080 #. type: Plain text
3081 #: build/C/man2/ptrace.2:1011
3082 msgid ""
3083 "Stop before return from B<vfork>(2)  or B<clone>(2)  with the B<CLONE_VFORK> "
3084 "flag.  When the tracee is continued after this stop, it will wait for child "
3085 "to exit/exec before continuing its execution (in other words, the usual "
3086 "behavior on B<vfork>(2))."
3087 msgstr ""
3088
3089 #. type: TP
3090 #: build/C/man2/ptrace.2:1011
3091 #, no-wrap
3092 msgid "B<PTRACE_EVENT_FORK>"
3093 msgstr ""
3094
3095 #. type: Plain text
3096 #: build/C/man2/ptrace.2:1019
3097 msgid ""
3098 "Stop before return from B<fork>(2)  or B<clone>(2)  with the exit signal set "
3099 "to B<SIGCHLD>."
3100 msgstr ""
3101
3102 #. type: TP
3103 #: build/C/man2/ptrace.2:1019
3104 #, no-wrap
3105 msgid "B<PTRACE_EVENT_CLONE>"
3106 msgstr ""
3107
3108 #. type: Plain text
3109 #: build/C/man2/ptrace.2:1023
3110 msgid "Stop before return from B<clone>(2)."
3111 msgstr ""
3112
3113 #. type: TP
3114 #: build/C/man2/ptrace.2:1023
3115 #, no-wrap
3116 msgid "B<PTRACE_EVENT_VFORK_DONE>"
3117 msgstr ""
3118
3119 #. type: Plain text
3120 #: build/C/man2/ptrace.2:1033
3121 msgid ""
3122 "Stop before return from B<vfork>(2)  or B<clone>(2)  with the B<CLONE_VFORK> "
3123 "flag, but after the child unblocked this tracee by exiting or execing."
3124 msgstr ""
3125
3126 #. type: Plain text
3127 #: build/C/man2/ptrace.2:1039
3128 msgid ""
3129 "For all four stops described above, the stop occurs in the parent (i.e., the "
3130 "tracee), not in the newly created thread.  B<PTRACE_GETEVENTMSG> can be used "
3131 "to retrieve the new thread's ID."
3132 msgstr ""
3133
3134 #. type: TP
3135 #: build/C/man2/ptrace.2:1039
3136 #, no-wrap
3137 msgid "B<PTRACE_EVENT_EXEC>"
3138 msgstr ""
3139
3140 #. type: Plain text
3141 #: build/C/man2/ptrace.2:1046
3142 msgid ""
3143 "Stop before return from B<execve>(2).  Since Linux 3.0, "
3144 "B<PTRACE_GETEVENTMSG> returns the former thread ID."
3145 msgstr ""
3146
3147 #. type: TP
3148 #: build/C/man2/ptrace.2:1046
3149 #, no-wrap
3150 msgid "B<PTRACE_EVENT_EXIT>"
3151 msgstr ""
3152
3153 #. type: Plain text
3154 #: build/C/man2/ptrace.2:1062
3155 msgid ""
3156 "Stop before exit (including death from B<exit_group>(2)), signal death, or "
3157 "exit caused by B<execve>(2)  in a multithreaded process.  "
3158 "B<PTRACE_GETEVENTMSG> returns the exit status.  Registers can be examined "
3159 "(unlike when \"real\" exit happens).  The tracee is still alive; it needs to "
3160 "be B<PTRACE_CONT>ed or B<PTRACE_DETACH>ed to finish exiting."
3161 msgstr ""
3162
3163 #. type: Plain text
3164 #: build/C/man2/ptrace.2:1074
3165 msgid ""
3166 "B<PTRACE_GETSIGINFO> on B<PTRACE_EVENT> stops returns B<SIGTRAP> in "
3167 "I<si_signo>, with I<si_code> set to I<(eventE<lt>E<lt>8)\\ |\\ SIGTRAP>."
3168 msgstr ""
3169
3170 #. type: SS
3171 #: build/C/man2/ptrace.2:1074
3172 #, no-wrap
3173 msgid "Syscall-stops"
3174 msgstr ""
3175
3176 #. type: Plain text
3177 #: build/C/man2/ptrace.2:1087
3178 msgid ""
3179 "If the tracee was restarted by B<PTRACE_SYSCALL>, the tracee enters "
3180 "syscall-enter-stop just prior to entering any system call.  If the tracer "
3181 "restarts the tracee with B<PTRACE_SYSCALL>, the tracee enters "
3182 "syscall-exit-stop when the system call is finished, or if it is interrupted "
3183 "by a signal.  (That is, signal-delivery-stop never happens between "
3184 "syscall-enter-stop and syscall-exit-stop; it happens I<after> "
3185 "syscall-exit-stop.)"
3186 msgstr ""
3187
3188 #. type: Plain text
3189 #: build/C/man2/ptrace.2:1101
3190 msgid ""
3191 "Other possibilities are that the tracee may stop in a B<PTRACE_EVENT> stop, "
3192 "exit (if it entered B<_exit>(2)  or B<exit_group>(2)), be killed by "
3193 "B<SIGKILL>, or die silently (if it is a thread group leader, the "
3194 "B<execve>(2)  happened in another thread, and that thread is not traced by "
3195 "the same tracer; this situation is discussed later)."
3196 msgstr ""
3197
3198 #. type: Plain text
3199 #: build/C/man2/ptrace.2:1116
3200 msgid ""
3201 "Syscall-enter-stop and syscall-exit-stop are observed by the tracer as "
3202 "B<waitpid>(2)  returning with I<WIFSTOPPED(status)> true, and "
3203 "I<WSTOPSIG(status)> giving B<SIGTRAP>.  If the B<PTRACE_O_TRACESYSGOOD> "
3204 "option was set by the tracer, then I<WSTOPSIG(status)> will give the value "
3205 "I<(SIGTRAP\\ |\\ 0x80)>."
3206 msgstr ""
3207
3208 #. type: Plain text
3209 #: build/C/man2/ptrace.2:1122
3210 msgid ""
3211 "Syscall-stops can be distinguished from signal-delivery-stop with B<SIGTRAP> "
3212 "by querying B<PTRACE_GETSIGINFO> for the following cases:"
3213 msgstr ""
3214
3215 #. type: TP
3216 #: build/C/man2/ptrace.2:1122
3217 #, no-wrap
3218 msgid "I<si_code> E<lt>= 0"
3219 msgstr ""
3220
3221 #. type: Plain text
3222 #: build/C/man2/ptrace.2:1134
3223 msgid ""
3224 "B<SIGTRAP> was delivered as a result of a userspace action, for example, a "
3225 "system call (B<tgkill>(2), B<kill>(2), B<sigqueue>(3), etc.), expiration of "
3226 "a POSIX timer, change of state on a POSIX message queue, or completion of an "
3227 "asynchronous I/O request."
3228 msgstr ""
3229
3230 #. type: TP
3231 #: build/C/man2/ptrace.2:1134
3232 #, no-wrap
3233 msgid "I<si_code> == SI_KERNEL (0x80)"
3234 msgstr ""
3235
3236 #. type: Plain text
3237 #: build/C/man2/ptrace.2:1138
3238 msgid "B<SIGTRAP> was sent by the kernel."
3239 msgstr ""
3240
3241 #. type: TP
3242 #: build/C/man2/ptrace.2:1138
3243 #, no-wrap
3244 msgid "I<si_code> == SIGTRAP or I<si_code> == (SIGTRAP|0x80)"
3245 msgstr ""
3246
3247 #. type: Plain text
3248 #: build/C/man2/ptrace.2:1141
3249 msgid "This is a syscall-stop."
3250 msgstr ""
3251
3252 #. type: Plain text
3253 #: build/C/man2/ptrace.2:1146
3254 msgid ""
3255 "However, syscall-stops happen very often (twice per system call), and "
3256 "performing B<PTRACE_GETSIGINFO> for every syscall-stop may be somewhat "
3257 "expensive."
3258 msgstr ""
3259
3260 #. type: Plain text
3261 #: build/C/man2/ptrace.2:1169
3262 msgid ""
3263 "Some architectures allow the cases to be distinguished by examining "
3264 "registers.  For example, on x86, I<rax> == -B<ENOSYS> in "
3265 "syscall-enter-stop.  Since B<SIGTRAP> (like any other signal) always happens "
3266 "I<after> syscall-exit-stop, and at this point I<rax> almost never contains "
3267 "-B<ENOSYS>, the B<SIGTRAP> looks like \"syscall-stop which is not "
3268 "syscall-enter-stop\"; in other words, it looks like a \"stray "
3269 "syscall-exit-stop\" and can be detected this way.  But such detection is "
3270 "fragile and is best avoided."
3271 msgstr ""
3272
3273 #. type: Plain text
3274 #: build/C/man2/ptrace.2:1175
3275 msgid ""
3276 "Using the B<PTRACE_O_TRACESYSGOOD> option is the recommended method to "
3277 "distinguish syscall-stops from other kinds of ptrace-stops, since it is "
3278 "reliable and does not incur a performance penalty."
3279 msgstr ""
3280
3281 #. type: Plain text
3282 #: build/C/man2/ptrace.2:1186
3283 msgid ""
3284 "Syscall-enter-stop and syscall-exit-stop are indistinguishable from each "
3285 "other by the tracer.  The tracer needs to keep track of the sequence of "
3286 "ptrace-stops in order to not misinterpret syscall-enter-stop as "
3287 "syscall-exit-stop or vice versa.  The rule is that syscall-enter-stop is "
3288 "always followed by syscall-exit-stop, B<PTRACE_EVENT> stop or the tracee's "
3289 "death; no other kinds of ptrace-stop can occur in between."
3290 msgstr ""
3291
3292 #. type: Plain text
3293 #: build/C/man2/ptrace.2:1191
3294 msgid ""
3295 "If after syscall-enter-stop, the tracer uses a restarting command other than "
3296 "B<PTRACE_SYSCALL>, syscall-exit-stop is not generated."
3297 msgstr ""
3298
3299 #. type: Plain text
3300 #: build/C/man2/ptrace.2:1203
3301 msgid ""
3302 "B<PTRACE_GETSIGINFO> on syscall-stops returns B<SIGTRAP> in I<si_signo>, "
3303 "with I<si_code> set to B<SIGTRAP> or I<(SIGTRAP|0x80)>."
3304 msgstr ""
3305
3306 #. type: SS
3307 #: build/C/man2/ptrace.2:1203
3308 #, no-wrap
3309 msgid "PTRACE_SINGLESTEP, PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP stops"
3310 msgstr ""
3311
3312 #
3313 #.  FIXME
3314 #.  document stops occurring with PTRACE_SINGLESTEP, PTRACE_SYSEMU,
3315 #.  PTRACE_SYSEMU_SINGLESTEP
3316 #. type: Plain text
3317 #: build/C/man2/ptrace.2:1209
3318 msgid "[Details of these kinds of stops are yet to be documented.]"
3319 msgstr ""
3320
3321 #. type: SS
3322 #: build/C/man2/ptrace.2:1209
3323 #, no-wrap
3324 msgid "Informational and restarting ptrace commands"
3325 msgstr ""
3326
3327 #. type: Plain text
3328 #: build/C/man2/ptrace.2:1217
3329 msgid ""
3330 "Most ptrace commands (all except B<PTRACE_ATTACH>, B<PTRACE_TRACEME>, and "
3331 "B<PTRACE_KILL>)  require the tracee to be in a ptrace-stop, otherwise they "
3332 "fail with B<ESRCH>."
3333 msgstr ""
3334
3335 #. type: Plain text
3336 #: build/C/man2/ptrace.2:1222
3337 msgid ""
3338 "When the tracee is in ptrace-stop, the tracer can read and write data to the "
3339 "tracee using informational commands.  These commands leave the tracee in "
3340 "ptrace-stopped state:"
3341 msgstr ""
3342
3343 #. type: Plain text
3344 #: build/C/man2/ptrace.2:1232
3345 #, no-wrap
3346 msgid ""
3347 "    ptrace(PTRACE_PEEKTEXT/PEEKDATA/PEEKUSER, pid, addr, 0);\n"
3348 "    ptrace(PTRACE_POKETEXT/POKEDATA/POKEUSER, pid, addr, long_val);\n"
3349 "    ptrace(PTRACE_GETREGS/GETFPREGS, pid, 0, &struct);\n"
3350 "    ptrace(PTRACE_SETREGS/SETFPREGS, pid, 0, &struct);\n"
3351 "    ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo);\n"
3352 "    ptrace(PTRACE_SETSIGINFO, pid, 0, &siginfo);\n"
3353 "    ptrace(PTRACE_GETEVENTMSG, pid, 0, &long_var);\n"
3354 "    ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_flags);\n"
3355 msgstr ""
3356
3357 #. type: Plain text
3358 #: build/C/man2/ptrace.2:1244
3359 msgid ""
3360 "Note that some errors are not reported.  For example, setting signal "
3361 "information (I<siginfo>)  may have no effect in some ptrace-stops, yet the "
3362 "call may succeed (return 0 and not set I<errno>); querying "
3363 "B<PTRACE_GETEVENTMSG> may succeed and return some random value if current "
3364 "ptrace-stop is not documented as returning a meaningful event message."
3365 msgstr ""
3366
3367 #. type: Plain text
3368 #: build/C/man2/ptrace.2:1246
3369 msgid "The call"
3370 msgstr ""
3371
3372 #. type: Plain text
3373 #: build/C/man2/ptrace.2:1248
3374 #, no-wrap
3375 msgid "    ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_flags);\n"
3376 msgstr ""
3377
3378 #. type: Plain text
3379 #: build/C/man2/ptrace.2:1257
3380 msgid ""
3381 "affects one tracee.  The tracee's current flags are replaced.  Flags are "
3382 "inherited by new tracees created and \"auto-attached\" via active "
3383 "B<PTRACE_O_TRACEFORK>, B<PTRACE_O_TRACEVFORK>, or B<PTRACE_O_TRACECLONE> "
3384 "options."
3385 msgstr ""
3386
3387 #. type: Plain text
3388 #: build/C/man2/ptrace.2:1260
3389 msgid ""
3390 "Another group of commands makes the ptrace-stopped tracee run.  They have "
3391 "the form:"
3392 msgstr ""
3393
3394 #. type: Plain text
3395 #: build/C/man2/ptrace.2:1262
3396 #, no-wrap
3397 msgid "    ptrace(cmd, pid, 0, sig);\n"
3398 msgstr ""
3399
3400 #. type: Plain text
3401 #: build/C/man2/ptrace.2:1282
3402 msgid ""
3403 "where I<cmd> is B<PTRACE_CONT>, B<PTRACE_DETACH>, B<PTRACE_SYSCALL>, "
3404 "B<PTRACE_SINGLESTEP>, B<PTRACE_SYSEMU>, or B<PTRACE_SYSEMU_SINGLESTEP>.  If "
3405 "the tracee is in signal-delivery-stop, I<sig> is the signal to be injected "
3406 "(if it is nonzero).  Otherwise, I<sig> may be ignored.  (When restarting a "
3407 "tracee from a ptrace-stop other than signal-delivery-stop, recommended "
3408 "practice is to always pass 0 in I<sig>.)"
3409 msgstr ""
3410
3411 #. type: SS
3412 #: build/C/man2/ptrace.2:1282
3413 #, no-wrap
3414 msgid "Attaching and detaching"
3415 msgstr ""
3416
3417 #. type: Plain text
3418 #: build/C/man2/ptrace.2:1284
3419 msgid "A thread can be attached to the tracer using the call"
3420 msgstr ""
3421
3422 #. type: Plain text
3423 #: build/C/man2/ptrace.2:1286
3424 #, no-wrap
3425 msgid "    ptrace(PTRACE_ATTACH, pid, 0, 0);\n"
3426 msgstr ""
3427
3428 #
3429 #.  FIXME: Describe how to attach to a thread which is already
3430 #.         group-stopped.
3431 #. type: Plain text
3432 #: build/C/man2/ptrace.2:1310
3433 msgid ""
3434 "This also sends B<SIGSTOP> to this thread.  If the tracer wants this "
3435 "B<SIGSTOP> to have no effect, it needs to suppress it.  Note that if other "
3436 "signals are concurrently sent to this thread during attach, the tracer may "
3437 "see the tracee enter signal-delivery-stop with other signal(s) first! The "
3438 "usual practice is to reinject these signals until B<SIGSTOP> is seen, then "
3439 "suppress B<SIGSTOP> injection.  The design bug here is that a ptrace attach "
3440 "and a concurrently delivered B<SIGSTOP> may race and the concurrent "
3441 "B<SIGSTOP> may be lost."
3442 msgstr ""
3443
3444 #. type: Plain text
3445 #: build/C/man2/ptrace.2:1317
3446 msgid ""
3447 "Since attaching sends B<SIGSTOP> and the tracer usually suppresses it, this "
3448 "may cause a stray B<EINTR> return from the currently executing system call "
3449 "in the tracee, as described in the \"Signal injection and suppression\" "
3450 "section."
3451 msgstr ""
3452
3453 #. type: Plain text
3454 #: build/C/man2/ptrace.2:1319
3455 msgid "The request"
3456 msgstr ""
3457
3458 #. type: Plain text
3459 #: build/C/man2/ptrace.2:1321
3460 #, no-wrap
3461 msgid "    ptrace(PTRACE_TRACEME, 0, 0, 0);\n"
3462 msgstr ""
3463
3464 #. type: Plain text
3465 #: build/C/man2/ptrace.2:1327
3466 msgid ""
3467 "turns the calling thread into a tracee.  The thread continues to run "
3468 "(doesn't enter ptrace-stop).  A common practice is to follow the "
3469 "B<PTRACE_TRACEME> with"
3470 msgstr ""
3471
3472 #. type: Plain text
3473 #: build/C/man2/ptrace.2:1329
3474 #, no-wrap
3475 msgid "    raise(SIGSTOP);\n"
3476 msgstr ""
3477
3478 #. type: Plain text
3479 #: build/C/man2/ptrace.2:1332
3480 msgid ""
3481 "and allow the parent (which is our tracer now) to observe our "
3482 "signal-delivery-stop."
3483 msgstr ""
3484
3485 #. type: Plain text
3486 #: build/C/man2/ptrace.2:1356
3487 msgid ""
3488 "If the B<PTRACE_O_TRACEFORK>, B<PTRACE_O_TRACEVFORK>, or "
3489 "B<PTRACE_O_TRACECLONE> options are in effect, then children created by, "
3490 "respectively, B<vfork>(2)  or B<clone>(2)  with the B<CLONE_VFORK> flag, "
3491 "B<fork>(2)  or B<clone>(2)  with the exit signal set to B<SIGCHLD>, and "
3492 "other kinds of B<clone>(2), are automatically attached to the same tracer "
3493 "which traced their parent.  B<SIGSTOP> is delivered to the children, causing "
3494 "them to enter signal-delivery-stop after they exit the system call which "
3495 "created them."
3496 msgstr ""
3497
3498 #. type: Plain text
3499 #: build/C/man2/ptrace.2:1358
3500 msgid "Detaching of the tracee is performed by:"
3501 msgstr ""
3502
3503 #. type: Plain text
3504 #: build/C/man2/ptrace.2:1360
3505 #, no-wrap
3506 msgid "    ptrace(PTRACE_DETACH, pid, 0, sig);\n"
3507 msgstr ""
3508
3509 #. type: Plain text
3510 #: build/C/man2/ptrace.2:1368
3511 msgid ""
3512 "B<PTRACE_DETACH> is a restarting operation; therefore it requires the tracee "
3513 "to be in ptrace-stop.  If the tracee is in signal-delivery-stop, a signal "
3514 "can be injected.  Otherwise, the I<sig> parameter may be silently ignored."
3515 msgstr ""
3516
3517 #.  FIXME: Describe how to detach from a group-stopped tracee so that it
3518 #.         doesn't run, but continues to wait for SIGCONT.
3519 #. type: Plain text
3520 #: build/C/man2/ptrace.2:1392
3521 msgid ""
3522 "If the tracee is running when the tracer wants to detach it, the usual "
3523 "solution is to send B<SIGSTOP> (using B<tgkill>(2), to make sure it goes to "
3524 "the correct thread), wait for the tracee to stop in signal-delivery-stop for "
3525 "B<SIGSTOP> and then detach it (suppressing B<SIGSTOP> injection).  A design "
3526 "bug is that this can race with concurrent B<SIGSTOP>s.  Another complication "
3527 "is that the tracee may enter other ptrace-stops and needs to be restarted "
3528 "and waited for again, until B<SIGSTOP> is seen.  Yet another complication is "
3529 "to be sure that the tracee is not already ptrace-stopped, because no signal "
3530 "delivery happens while it is\\(emnot even B<SIGSTOP>."
3531 msgstr ""
3532
3533 #. type: Plain text
3534 #: build/C/man2/ptrace.2:1400
3535 msgid ""
3536 "If the tracer dies, all tracees are automatically detached and restarted, "
3537 "unless they were in group-stop.  Handling of restart from group-stop is "
3538 "currently buggy, but the \"as planned\" behavior is to leave tracee stopped "
3539 "and waiting for B<SIGCONT>.  If the tracee is restarted from "
3540 "signal-delivery-stop, the pending signal is injected."
3541 msgstr ""
3542
3543 #. type: SS
3544 #: build/C/man2/ptrace.2:1400
3545 #, no-wrap
3546 msgid "execve(2) under ptrace"
3547 msgstr ""
3548
3549 #.  clone(2) THREAD_CLONE says:
3550 #.      If  any  of the threads in a thread group performs an execve(2),
3551 #.      then all threads other than the thread group leader are terminated,
3552 #.      and the new program is executed in the thread group leader.
3553 #
3554 #.  In kernel 3.1 sources, see fs/exec.c::de_thread()
3555 #. type: Plain text
3556 #: build/C/man2/ptrace.2:1419
3557 msgid ""
3558 "When one thread in a multithreaded process calls B<execve>(2), the kernel "
3559 "destroys all other threads in the process, and resets the thread ID of the "
3560 "execing thread to the thread group ID (process ID).  (Or, to put things "
3561 "another way, when a multithreaded process does an B<execve>(2), at "
3562 "completion of the call, it appears as though the B<execve>(2)  occurred in "
3563 "the thread group leader, regardless of which thread did the B<execve>(2).)  "
3564 "This resetting of the thread ID looks very confusing to tracers:"
3565 msgstr ""
3566
3567 #. type: IP
3568 #: 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
3569 #, no-wrap
3570 msgid "*"
3571 msgstr ""
3572
3573 #. type: Plain text
3574 #: build/C/man2/ptrace.2:1429
3575 msgid ""
3576 "All other threads stop in B<PTRACE_EVENT_EXIT> stop, if the "
3577 "B<PTRACE_O_TRACEEXIT> option was turned on.  Then all other threads except "
3578 "the thread group leader report death as if they exited via B<_exit>(2)  with "
3579 "exit code 0."
3580 msgstr ""
3581
3582 #. type: Plain text
3583 #: build/C/man2/ptrace.2:1437
3584 msgid ""
3585 "The execing tracee changes its thread ID while it is in the B<execve>(2).  "
3586 "(Remember, under ptrace, the \"pid\" returned from B<waitpid>(2), or fed "
3587 "into ptrace calls, is the tracee's thread ID.)  That is, the tracee's thread "
3588 "ID is reset to be the same as its process ID, which is the same as the "
3589 "thread group leader's thread ID."
3590 msgstr ""
3591
3592 #. type: Plain text
3593 #: build/C/man2/ptrace.2:1443
3594 msgid ""
3595 "Then a B<PTRACE_EVENT_EXEC> stop happens, if the B<PTRACE_O_TRACEEXEC> "
3596 "option was turned on."
3597 msgstr ""
3598
3599 #. type: Plain text
3600 #: build/C/man2/ptrace.2:1464
3601 msgid ""
3602 "If the thread group leader has reported its B<PTRACE_EVENT_EXIT> stop by "
3603 "this time, it appears to the tracer that the dead thread leader \"reappears "
3604 "from nowhere\".  (Note: the thread group leader does not report death via "
3605 "I<WIFEXITED(status)> until there is at least one other live thread.  This "
3606 "eliminates the possibility that the tracer will see it dying and then "
3607 "reappearing.)  If the thread group leader was still alive, for the tracer "
3608 "this may look as if thread group leader returns from a different system call "
3609 "than it entered, or even \"returned from a system call even though it was "
3610 "not in any system call\".  If the thread group leader was not traced (or was "
3611 "traced by a different tracer), then during B<execve>(2)  it will appear as "
3612 "if it has become a tracee of the tracer of the execing tracee."
3613 msgstr ""
3614
3615 #. type: Plain text
3616 #: build/C/man2/ptrace.2:1467
3617 msgid ""
3618 "All of the above effects are the artifacts of the thread ID change in the "
3619 "tracee."
3620 msgstr ""
3621
3622 #. type: Plain text
3623 #: build/C/man2/ptrace.2:1487
3624 msgid ""
3625 "The B<PTRACE_O_TRACEEXEC> option is the recommended tool for dealing with "
3626 "this situation.  First, it enables B<PTRACE_EVENT_EXEC> stop, which occurs "
3627 "before B<execve>(2)  returns.  In this stop, the tracer can use "
3628 "B<PTRACE_GETEVENTMSG> to retrieve the tracee's former thread ID.  (This "
3629 "feature was introduced in Linux 3.0).  Second, the B<PTRACE_O_TRACEEXEC> "
3630 "option disables legacy B<SIGTRAP> generation on B<execve>(2)."
3631 msgstr ""
3632
3633 #. type: Plain text
3634 #: build/C/man2/ptrace.2:1493
3635 msgid ""
3636 "When the tracer receives B<PTRACE_EVENT_EXEC> stop notification, it is "
3637 "guaranteed that except this tracee and the thread group leader, no other "
3638 "threads from the process are alive."
3639 msgstr ""
3640
3641 #. type: Plain text
3642 #: build/C/man2/ptrace.2:1501
3643 msgid ""
3644 "On receiving the B<PTRACE_EVENT_EXEC> stop notification, the tracer should "
3645 "clean up all its internal data structures describing the threads of this "
3646 "process, and retain only one data structure\\(emone which describes the "
3647 "single still running tracee, with"
3648 msgstr ""
3649
3650 #. type: Plain text
3651 #: build/C/man2/ptrace.2:1503
3652 #, no-wrap
3653 msgid "    thread ID == thread group ID == process ID.\n"
3654 msgstr ""
3655
3656 #. type: Plain text
3657 #: build/C/man2/ptrace.2:1507
3658 msgid "Example: two threads call B<execve>(2)  at the same time:"
3659 msgstr ""
3660
3661 #. type: Plain text
3662 #: build/C/man2/ptrace.2:1518
3663 #, no-wrap
3664 msgid ""
3665 "*** we get syscall-enter-stop in thread 1: **\n"
3666 "PID1 execve(\"/bin/foo\", \"foo\" E<lt>unfinished ...E<gt>\n"
3667 "*** we issue PTRACE_SYSCALL for thread 1 **\n"
3668 "*** we get syscall-enter-stop in thread 2: **\n"
3669 "PID2 execve(\"/bin/bar\", \"bar\" E<lt>unfinished ...E<gt>\n"
3670 "*** we issue PTRACE_SYSCALL for thread 2 **\n"
3671 "*** we get PTRACE_EVENT_EXEC for PID0, we issue PTRACE_SYSCALL **\n"
3672 "*** we get syscall-exit-stop for PID0: **\n"
3673 "PID0 E<lt>... execve resumedE<gt> )             = 0\n"
3674 msgstr ""
3675
3676 #. type: Plain text
3677 #: build/C/man2/ptrace.2:1541
3678 msgid ""
3679 "If the B<PTRACE_O_TRACEEXEC> option is I<not> in effect for the execing "
3680 "tracee, the kernel delivers an extra B<SIGTRAP> to the tracee after "
3681 "B<execve>(2)  returns.  This is an ordinary signal (similar to one which can "
3682 "be generated by I<kill -TRAP>), not a special kind of ptrace-stop.  "
3683 "Employing B<PTRACE_GETSIGINFO> for this signal returns I<si_code> set to 0 "
3684 "(I<SI_USER>).  This signal may be blocked by signal mask, and thus may be "
3685 "delivered (much) later."
3686 msgstr ""
3687
3688 #. type: Plain text
3689 #: build/C/man2/ptrace.2:1560
3690 msgid ""
3691 "Usually, the tracer (for example, B<strace>(1))  would not want to show this "
3692 "extra post-execve B<SIGTRAP> signal to the user, and would suppress its "
3693 "delivery to the tracee (if B<SIGTRAP> is set to B<SIG_DFL>, it is a killing "
3694 "signal).  However, determining I<which> B<SIGTRAP> to suppress is not easy.  "
3695 "Setting the B<PTRACE_O_TRACEEXEC> option and thus suppressing this extra "
3696 "B<SIGTRAP> is the recommended approach."
3697 msgstr ""
3698
3699 #. type: SS
3700 #: build/C/man2/ptrace.2:1560
3701 #, no-wrap
3702 msgid "Real parent"
3703 msgstr ""
3704
3705 #. type: Plain text
3706 #: build/C/man2/ptrace.2:1567
3707 msgid ""
3708 "The ptrace API (ab)uses the standard UNIX parent/child signaling over "
3709 "B<waitpid>(2).  This used to cause the real parent of the process to stop "
3710 "receiving several kinds of B<waitpid>(2)  notifications when the child "
3711 "process is traced by some other process."
3712 msgstr ""
3713
3714 #. type: Plain text
3715 #: build/C/man2/ptrace.2:1570
3716 msgid ""
3717 "Many of these bugs have been fixed, but as of Linux 2.6.38 several still "
3718 "exist; see BUGS below."
3719 msgstr ""
3720
3721 #. type: Plain text
3722 #: build/C/man2/ptrace.2:1572
3723 msgid "As of Linux 2.6.38, the following is believed to work correctly:"
3724 msgstr ""
3725
3726 #. type: Plain text
3727 #: build/C/man2/ptrace.2:1580
3728 msgid ""
3729 "exit/death by signal is reported first to the tracer, then, when the tracer "
3730 "consumes the B<waitpid>(2)  result, to the real parent (to the real parent "
3731 "only when the whole multithreaded process exits).  If the tracer and the "
3732 "real parent are the same process, the report is sent only once."
3733 msgstr ""
3734
3735 #. type: Plain text
3736 #: build/C/man2/ptrace.2:1594
3737 msgid ""
3738 "On success, B<PTRACE_PEEK*> requests return the requested data, while other "
3739 "requests return zero.  On error, all requests return -1, and I<errno> is set "
3740 "appropriately.  Since the value returned by a successful B<PTRACE_PEEK*> "
3741 "request may be -1, the caller must clear I<errno> before the call, and then "
3742 "check it afterward to determine whether or not an error occurred."
3743 msgstr ""
3744
3745 #. type: Plain text
3746 #: build/C/man2/ptrace.2:1598
3747 msgid "(i386 only) There was an error with allocating or freeing a debug register."
3748 msgstr ""
3749
3750 #. type: Plain text
3751 #: build/C/man2/ptrace.2:1609
3752 msgid ""
3753 "There was an attempt to read from or write to an invalid area in the "
3754 "tracer's or the tracee's memory, probably because the area wasn't mapped or "
3755 "accessible.  Unfortunately, under Linux, different variations of this fault "
3756 "will return B<EIO> or B<EFAULT> more or less arbitrarily."
3757 msgstr ""
3758
3759 #. type: Plain text
3760 #: build/C/man2/ptrace.2:1612
3761 msgid "An attempt was made to set an invalid option."
3762 msgstr ""
3763
3764 #. type: Plain text
3765 #: build/C/man2/ptrace.2:1619
3766 msgid ""
3767 "I<request> is invalid, or an attempt was made to read from or write to an "
3768 "invalid area in the tracer's or the tracee's memory, or there was a "
3769 "word-alignment violation, or an invalid signal was specified during a "
3770 "restart request."
3771 msgstr ""
3772
3773 #. type: Plain text
3774 #: build/C/man2/ptrace.2:1632
3775 msgid ""
3776 "The specified process cannot be traced.  This could be because the tracer "
3777 "has insufficient privileges (the required capability is B<CAP_SYS_PTRACE>); "
3778 "unprivileged processes cannot trace processes that they cannot send signals "
3779 "to or those running set-user-ID/set-group-ID programs, for obvious reasons.  "
3780 "Alternatively, the process may already be being traced, or (on kernels "
3781 "before 2.6.26) be B<init>(8)  (PID 1)."
3782 msgstr ""
3783
3784 #. type: Plain text
3785 #: build/C/man2/ptrace.2:1637
3786 msgid ""
3787 "The specified process does not exist, or is not currently being traced by "
3788 "the caller, or is not stopped (for requests that require a stopped tracee)."
3789 msgstr ""
3790
3791 #. type: Plain text
3792 #: build/C/man2/ptrace.2:1639
3793 msgid "SVr4, 4.3BSD."
3794 msgstr ""
3795
3796 #. type: Plain text
3797 #: build/C/man2/ptrace.2:1652
3798 msgid ""
3799 "Although arguments to B<ptrace>()  are interpreted according to the "
3800 "prototype given, glibc currently declares B<ptrace>()  as a variadic "
3801 "function with only the I<request> argument fixed.  This means that unneeded "
3802 "trailing arguments may be omitted, though doing so makes use of undocumented "
3803 "B<gcc>(1)  behavior."
3804 msgstr ""
3805
3806 #.  See commit 00cd5c37afd5f431ac186dd131705048c0a11fdb
3807 #. type: Plain text
3808 #: build/C/man2/ptrace.2:1657
3809 msgid ""
3810 "In Linux kernels before 2.6.26, B<init>(8), the process with PID 1, may not "
3811 "be traced."
3812 msgstr ""
3813
3814 #.  See http://lkml.org/lkml/2008/5/8/375
3815 #. type: Plain text
3816 #: build/C/man2/ptrace.2:1664
3817 msgid ""
3818 "The layout of the contents of memory and the USER area are quite "
3819 "operating-system- and architecture-specific.  The offset supplied, and the "
3820 "data returned, might not entirely match with the definition of I<struct "
3821 "user>."
3822 msgstr ""
3823
3824 #. type: Plain text
3825 #: build/C/man2/ptrace.2:1667
3826 msgid ""
3827 "The size of a \"word\" is determined by the operating-system variant (e.g., "
3828 "for 32-bit Linux it is 32 bits, etc.)."
3829 msgstr ""
3830
3831 #. type: Plain text
3832 #: build/C/man2/ptrace.2:1675
3833 msgid ""
3834 "This page documents the way the B<ptrace>()  call works currently in Linux.  "
3835 "Its behavior differs noticeably on other flavors of UNIX.  In any case, use "
3836 "of B<ptrace>()  is highly specific to the operating system and architecture."
3837 msgstr ""
3838
3839 #. type: Plain text
3840 #: build/C/man2/ptrace.2:1686
3841 msgid ""
3842 "On hosts with 2.6 kernel headers, B<PTRACE_SETOPTIONS> is declared with a "
3843 "different value than the one for 2.4.  This leads to applications compiled "
3844 "with 2.6 kernel headers failing when run on 2.4 kernels.  This can be worked "
3845 "around by redefining B<PTRACE_SETOPTIONS> to B<PTRACE_OLDSETOPTIONS>, if "
3846 "that is defined."
3847 msgstr ""
3848
3849 #. type: Plain text
3850 #: build/C/man2/ptrace.2:1689
3851 msgid ""
3852 "Group-stop notifications are sent to the tracer, but not to real parent.  "
3853 "Last confirmed on 2.6.38.6."
3854 msgstr ""
3855
3856 #.  Note from Denys Vlasenko:
3857 #.      Here "exits" means any kind of death - _exit, exit_group,
3858 #.      signal death. Signal death and exit_group cases are trivial,
3859 #.      though: since signal death and exit_group kill all other threads
3860 #.      too, "until all other threads exit" thing happens rather soon
3861 #.      in these cases. Therefore, only _exit presents observably
3862 #.      puzzling behavior to ptrace users: thread leader _exit's,
3863 #.      but WIFEXITED isn't reported! We are trying to explain here
3864 #.      why it is so.
3865 #.   FIXME: ^^^ need to test/verify this scenario
3866 #. type: Plain text
3867 #: build/C/man2/ptrace.2:1720
3868 msgid ""
3869 "If a thread group leader is traced and exits by calling B<_exit>(2), a "
3870 "B<PTRACE_EVENT_EXIT> stop will happen for it (if requested), but the "
3871 "subsequent B<WIFEXITED> notification will not be delivered until all other "
3872 "threads exit.  As explained above, if one of other threads calls "
3873 "B<execve>(2), the death of the thread group leader will I<never> be "
3874 "reported.  If the execed thread is not traced by this tracer, the tracer "
3875 "will never know that B<execve>(2)  happened.  One possible workaround is to "
3876 "B<PTRACE_DETACH> the thread group leader instead of restarting it in this "
3877 "case.  Last confirmed on 2.6.38.6."
3878 msgstr ""
3879
3880 #. type: Plain text
3881 #: build/C/man2/ptrace.2:1730
3882 msgid ""
3883 "A B<SIGKILL> signal may still cause a B<PTRACE_EVENT_EXIT> stop before "
3884 "actual signal death.  This may be changed in the future; B<SIGKILL> is meant "
3885 "to always immediately kill tasks even under ptrace.  Last confirmed on "
3886 "2.6.38.6."
3887 msgstr ""
3888
3889 #. type: Plain text
3890 #: build/C/man2/ptrace.2:1746
3891 msgid ""
3892 "Some system calls return with B<EINTR> if a signal was sent to a tracee, but "
3893 "delivery was suppressed by the tracer.  (This is very typical operation: it "
3894 "is usually done by debuggers on every attach, in order to not introduce a "
3895 "bogus B<SIGSTOP>).  As of Linux 3.2.9, the following system calls are "
3896 "affected (this list is likely incomplete): B<epoll_wait>(2), and B<read>(2)  "
3897 "from an B<inotify>(7)  file descriptor."
3898 msgstr ""
3899
3900 #. type: Plain text
3901 #: build/C/man2/ptrace.2:1760
3902 msgid ""
3903 "B<gdb>(1), B<strace>(1), B<clone>(2), B<execve>(2), B<fork>(2), "
3904 "B<gettid>(2), B<sigaction>(2), B<tgkill>(2), B<vfork>(2), B<waitpid>(2), "
3905 "B<exec>(3), B<capabilities>(7), B<signal>(7)"
3906 msgstr ""
3907
3908 #. type: TH
3909 #: build/C/man2/quotactl.2:25
3910 #, no-wrap
3911 msgid "QUOTACTL"
3912 msgstr ""
3913
3914 #. type: TH
3915 #: build/C/man2/quotactl.2:25
3916 #, no-wrap
3917 msgid "2010-06-16"
3918 msgstr ""
3919
3920 #. type: Plain text
3921 #: build/C/man2/quotactl.2:28
3922 msgid "quotactl - manipulate disk quotas"
3923 msgstr ""
3924
3925 #. type: Plain text
3926 #: build/C/man2/quotactl.2:32
3927 #, no-wrap
3928 msgid ""
3929 "B<#include E<lt>sys/quota.hE<gt>>\n"
3930 "B<#include E<lt>xfs/xqm.hE<gt>>\n"
3931 msgstr ""
3932
3933 #. type: Plain text
3934 #: build/C/man2/quotactl.2:35
3935 #, no-wrap
3936 msgid ""
3937 "B<int quotactl(int >I<cmd>B<, const char *>I<special>B<, int >I<id>B<, "
3938 "caddr_t >I<addr>B<);>\n"
3939 msgstr ""
3940
3941 #. type: Plain text
3942 #: build/C/man2/quotactl.2:47
3943 msgid ""
3944 "The quota system can be used to set per-user and per-group limits on the "
3945 "amount of disk space used on a file system.  For each user and/or group, a "
3946 "soft limit and a hard limit can be set for each file system.  The hard limit "
3947 "can't be exceeded.  The soft limit can be exceeded, but warnings will "
3948 "ensue.  Moreover, the user can't exceed the soft limit for more than one "
3949 "week (by default) at a time; after this time, the soft limit counts as a "
3950 "hard limit."
3951 msgstr ""
3952
3953 #. type: Plain text
3954 #: build/C/man2/quotactl.2:72
3955 msgid ""
3956 "The B<quotactl>()  call manipulates disk quotas.  The I<cmd> argument "
3957 "indicates a command to be applied to the user or group ID specified in "
3958 "I<id>.  To initialize the I<cmd> argument, use the I<QCMD(subcmd, type)> "
3959 "macro.  The I<type> value is either B<USRQUOTA>, for user quotas, or "
3960 "B<GRPQUOTA>, for group quotas.  The I<subcmd> value is described below."
3961 msgstr ""
3962
3963 #. type: Plain text
3964 #: build/C/man2/quotactl.2:77
3965 msgid ""
3966 "The I<special> argument is a pointer to a null-terminated string containing "
3967 "the pathname of the (mounted) block special device for the file system being "
3968 "manipulated."
3969 msgstr ""
3970
3971 #. type: Plain text
3972 #: build/C/man2/quotactl.2:85
3973 msgid ""
3974 "The I<addr> argument is the address of an optional, command-specific, data "
3975 "structure that is copied in or out of the system.  The interpretation of "
3976 "I<addr> is given with each command below."
3977 msgstr ""
3978
3979 #. type: Plain text
3980 #: build/C/man2/quotactl.2:89
3981 msgid "The I<subcmd> value is one of the following:"
3982 msgstr ""
3983
3984 #. type: TP
3985 #: build/C/man2/quotactl.2:89
3986 #, no-wrap
3987 msgid "B<Q_QUOTAON>"
3988 msgstr ""
3989
3990 #. type: Plain text
3991 #: build/C/man2/quotactl.2:96
3992 msgid ""
3993 "Turn on quotas for a file system.  The I<id> argument is the identification "
3994 "number of the quota format to be used.  Currently, there are three supported "
3995 "quota formats:"
3996 msgstr ""
3997
3998 #. type: TP
3999 #: build/C/man2/quotactl.2:97
4000 #, no-wrap
4001 msgid "B<QFMT_VFS_OLD>"
4002 msgstr ""
4003
4004 #. type: Plain text
4005 #: build/C/man2/quotactl.2:100
4006 msgid "The original quota format."
4007 msgstr ""
4008
4009 #. type: TP
4010 #: build/C/man2/quotactl.2:100
4011 #, no-wrap
4012 msgid "B<QFMT_VFS_V0>"
4013 msgstr ""
4014
4015 #. type: Plain text
4016 #: build/C/man2/quotactl.2:104
4017 msgid ""
4018 "The standard VFS v0 quota format, which can handle 32-bit UIDs and GIDs and "
4019 "quota limits up to 2^42 bytes and 2^32 inodes."
4020 msgstr ""
4021
4022 #. type: TP
4023 #: build/C/man2/quotactl.2:104
4024 #, no-wrap
4025 msgid "B<QFMT_VFS_V1>"
4026 msgstr ""
4027
4028 #. type: Plain text
4029 #: build/C/man2/quotactl.2:108
4030 msgid ""
4031 "A quota format that can handle 32-bit UIDs and GIDs and quota limits of 2^64 "
4032 "bytes and 2^64 inodes."
4033 msgstr ""
4034
4035 #. type: Plain text
4036 #: build/C/man2/quotactl.2:119
4037 msgid ""
4038 "The I<addr> argument points to the pathname of a file containing the quotas "
4039 "for the file system.  The quota file must exist; it is normally created with "
4040 "the B<quotacheck>(8)  program.  This operation requires privilege "
4041 "(B<CAP_SYS_ADMIN>)."
4042 msgstr ""
4043
4044 #. type: TP
4045 #: build/C/man2/quotactl.2:119
4046 #, no-wrap
4047 msgid "B<Q_QUOTAOFF>"
4048 msgstr ""
4049
4050 #. type: Plain text
4051 #: build/C/man2/quotactl.2:129
4052 msgid ""
4053 "Turn off quotas for a file system.  The I<addr> and I<id> arguments are "
4054 "ignored.  This operation requires privilege (B<CAP_SYS_ADMIN>)."
4055 msgstr ""
4056
4057 #. type: TP
4058 #: build/C/man2/quotactl.2:129
4059 #, no-wrap
4060 msgid "B<Q_GETQUOTA>"
4061 msgstr ""
4062
4063 #. type: Plain text
4064 #: build/C/man2/quotactl.2:140
4065 msgid ""
4066 "Get disk quota limits and current usage for user or group I<id>.  The "
4067 "I<addr> argument is a pointer to a I<dqblk> structure defined in "
4068 "I<E<lt>sys/quota.hE<gt>> as follows:"
4069 msgstr ""
4070
4071 #. type: Plain text
4072 #: build/C/man2/quotactl.2:145 build/C/man2/quotactl.2:232
4073 #, no-wrap
4074 msgid ""
4075 "/* uint64_t is an unsigned 64-bit integer;\n"
4076 "   uint32_t is an unsigned 32-bit integer */\n"
4077 msgstr ""
4078
4079 #. type: Plain text
4080 #: build/C/man2/quotactl.2:165
4081 #, no-wrap
4082 msgid ""
4083 "struct dqblk {          /* Definition since Linux 2.4.22 */\n"
4084 "    uint64_t dqb_bhardlimit;   /* absolute limit on disk\n"
4085 "                                  quota blocks alloc */\n"
4086 "    uint64_t dqb_bsoftlimit;   /* preferred limit on\n"
4087 "                                  disk quota blocks */\n"
4088 "    uint64_t dqb_curspace;     /* current quota block\n"
4089 "                                  count */\n"
4090 "    uint64_t dqb_ihardlimit;   /* maximum number of\n"
4091 "                                  allocated inodes */\n"
4092 "    uint64_t dqb_isoftlimit;   /* preferred inode limit */\n"
4093 "    uint64_t dqb_curinodes;    /* current number of\n"
4094 "                                  allocated inodes */\n"
4095 "    uint64_t dqb_btime;        /* time limit for excessive\n"
4096 "                                  disk use */\n"
4097 "    uint64_t dqb_itime;        /* time limit for excessive\n"
4098 "                                  files */\n"
4099 "    uint32_t dqb_valid;        /* bit mask of QIF_*\n"
4100 "                                  constants */\n"
4101 "};\n"
4102 msgstr ""
4103
4104 #. type: Plain text
4105 #: build/C/man2/quotactl.2:168
4106 #, no-wrap
4107 msgid ""
4108 "/* Flags in dqb_valid that indicate which fields in\n"
4109 "   dqblk structure are valid. */\n"
4110 msgstr ""
4111
4112 #. type: Plain text
4113 #: build/C/man2/quotactl.2:179
4114 #, no-wrap
4115 msgid ""
4116 "#define QIF_BLIMITS   1\n"
4117 "#define QIF_SPACE     2\n"
4118 "#define QIF_ILIMITS   4\n"
4119 "#define QIF_INODES    8\n"
4120 "#define QIF_BTIME     16\n"
4121 "#define QIF_ITIME     32\n"
4122 "#define QIF_LIMITS    (QIF_BLIMITS | QIF_ILIMITS)\n"
4123 "#define QIF_USAGE     (QIF_SPACE | QIF_INODES)\n"
4124 "#define QIF_TIMES     (QIF_BTIME | QIF_ITIME)\n"
4125 "#define QIF_ALL       (QIF_LIMITS | QIF_USAGE | QIF_TIMES)\n"
4126 msgstr ""
4127
4128 #. type: Plain text
4129 #: build/C/man2/quotactl.2:196
4130 msgid ""
4131 "The I<dqb_valid> field is a bit mask that is set to indicate the entries in "
4132 "the I<dqblk> structure that are valid.  Currently, the kernel fills in all "
4133 "entries of the I<dqblk> structure and marks them as valid in the "
4134 "I<dqb_valid> field.  Unprivileged users may retrieve only their own quotas; "
4135 "a privileged user (B<CAP_SYS_ADMIN>)  can retrieve the quotas of any user."
4136 msgstr ""
4137
4138 #. type: TP
4139 #: build/C/man2/quotactl.2:196
4140 #, no-wrap
4141 msgid "B<Q_SETQUOTA>"
4142 msgstr ""
4143
4144 #. type: Plain text
4145 #: build/C/man2/quotactl.2:216
4146 msgid ""
4147 "Set quota information for user or group I<id>, using the information "
4148 "supplied in the I<dqblk> structure pointed to by I<addr>.  The I<dqb_valid> "
4149 "field of the I<dqblk> structure indicates which entries in the structure "
4150 "have been set by the caller.  This operation supersedes the B<Q_SETQLIM> and "
4151 "B<Q_SETUSE> operations in the previous quota interfaces.  This operation "
4152 "requires privilege (B<CAP_SYS_ADMIN>)."
4153 msgstr ""
4154
4155 #. type: TP
4156 #: build/C/man2/quotactl.2:216
4157 #, no-wrap
4158 msgid "B<Q_GETINFO>"
4159 msgstr ""
4160
4161 #. type: Plain text
4162 #: build/C/man2/quotactl.2:227
4163 msgid ""
4164 "Get information (like grace times) about quotafile.  The I<addr> argument "
4165 "should be a pointer to a I<dqinfo> structure.  This structure is defined in "
4166 "I<E<lt>sys/quota.hE<gt>> as follows:"
4167 msgstr ""
4168
4169 #. type: Plain text
4170 #: build/C/man2/quotactl.2:236
4171 #, no-wrap
4172 msgid ""
4173 "struct dqinfo {         /* Defined since kernel 2.4.22 */\n"
4174 "    uint64_t dqi_bgrace;    /* Time before block soft limit\n"
4175 "                               becomes hard limit */\n"
4176 msgstr ""
4177
4178 #. type: Plain text
4179 #: build/C/man2/quotactl.2:243
4180 #, no-wrap
4181 msgid ""
4182 "    uint64_t dqi_igrace;    /* Time before inode soft limit\n"
4183 "                               becomes hard limit */\n"
4184 "    uint32_t dqi_flags;     /* Flags for quotafile\n"
4185 "                               (DQF_*) */\n"
4186 "    uint32_t dqi_valid;\n"
4187 "};\n"
4188 msgstr ""
4189
4190 #. type: Plain text
4191 #: build/C/man2/quotactl.2:245
4192 #, no-wrap
4193 msgid "/* Bits for dqi_flags */\n"
4194 msgstr ""
4195
4196 #. type: Plain text
4197 #: build/C/man2/quotactl.2:247
4198 #, no-wrap
4199 msgid "/* Quota format QFMT_VFS_OLD */\n"
4200 msgstr ""
4201
4202 #. type: Plain text
4203 #: build/C/man2/quotactl.2:249
4204 #, no-wrap
4205 msgid "#define V1_DQF_RSQUASH\t1   /* Root squash enabled */\n"
4206 msgstr ""
4207
4208 #. type: Plain text
4209 #: build/C/man2/quotactl.2:251
4210 #, no-wrap
4211 msgid "/* Other quota formats have no dqi_flags bits defined */\n"
4212 msgstr ""
4213
4214 #. type: Plain text
4215 #: build/C/man2/quotactl.2:254
4216 #, no-wrap
4217 msgid ""
4218 "/* Flags in dqi_valid that indicate which fields in\n"
4219 "   dqinfo structure are valid. */\n"
4220 msgstr ""
4221
4222 #. type: Plain text
4223 #: build/C/man2/quotactl.2:259
4224 #, no-wrap
4225 msgid ""
4226 "# define IIF_BGRACE\t1\n"
4227 "# define IIF_IGRACE\t2\n"
4228 "# define IIF_FLAGS\t4\n"
4229 "# define IIF_ALL\t(IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)\n"
4230 msgstr ""
4231
4232 #. type: Plain text
4233 #: build/C/man2/quotactl.2:275
4234 msgid ""
4235 "The I<dqi_valid> field in the I<dqinfo> structure indicates the entries in "
4236 "the structure that are valid.  Currently, the kernel fills in all entries of "
4237 "the I<dqinfo> structure and marks them all as valid in the I<dqi_valid> "
4238 "field.  The I<id> argument is ignored."
4239 msgstr ""
4240
4241 #. type: TP
4242 #: build/C/man2/quotactl.2:275
4243 #, no-wrap
4244 msgid "B<Q_SETINFO>"
4245 msgstr ""
4246
4247 #. type: Plain text
4248 #: build/C/man2/quotactl.2:299
4249 msgid ""
4250 "Set information about quotafile.  The I<addr> argument should be a pointer "
4251 "to a I<dqinfo> structure.  The I<dqi_valid> field of the I<dqinfo> structure "
4252 "indicates the entries in the structure that have been set by the caller.  "
4253 "This operation supersedes the B<Q_SETGRACE> and B<Q_SETFLAGS> operations in "
4254 "the previous quota interfaces.  The I<id> argument is ignored.  This "
4255 "operation requires privilege (B<CAP_SYS_ADMIN>)."
4256 msgstr ""
4257
4258 #. type: TP
4259 #: build/C/man2/quotactl.2:299
4260 #, no-wrap
4261 msgid "B<Q_GETFMT>"
4262 msgstr ""
4263
4264 #. type: Plain text
4265 #: build/C/man2/quotactl.2:306
4266 msgid ""
4267 "Get quota format used on the specified file system.  The I<addr> argument "
4268 "should be a pointer to a 4-byte buffer where the format number will be "
4269 "stored."
4270 msgstr ""
4271
4272 #. type: TP
4273 #: build/C/man2/quotactl.2:306
4274 #, no-wrap
4275 msgid "B<Q_SYNC>"
4276 msgstr ""
4277
4278 #. type: Plain text
4279 #: build/C/man2/quotactl.2:317
4280 msgid ""
4281 "Update the on-disk copy of quota usages for a file system.  If I<special> is "
4282 "NULL, then all file systems with active quotas are sync'ed.  The I<addr> and "
4283 "I<id> arguments are ignored."
4284 msgstr ""
4285
4286 #. type: TP
4287 #: build/C/man2/quotactl.2:317
4288 #, no-wrap
4289 msgid "B<Q_GETSTATS>"
4290 msgstr ""
4291
4292 #.  Q_GETSTATS was removed in kernel 2.4.22.
4293 #. type: Plain text
4294 #: build/C/man2/quotactl.2:337
4295 msgid ""
4296 "Get statistics and other generic information about the quota subsystem.  The "
4297 "I<addr> argument should be a pointer to a I<dqstats> structure in which data "
4298 "should be stored.  This structure is defined in I<E<lt>sys/quota.hE<gt>.> "
4299 "The I<special> and I<id> arguments are ignored.  This operation is obsolete "
4300 "and not supported by recent kernels.  Files in I</proc/sys/fs/quota/> carry "
4301 "the information instead."
4302 msgstr ""
4303
4304 #. type: Plain text
4305 #: build/C/man2/quotactl.2:340
4306 msgid ""
4307 "For XFS file systems making use of the XFS Quota Manager (XQM), the above "
4308 "commands are bypassed and the following commands are used:"
4309 msgstr ""
4310
4311 #. type: TP
4312 #: build/C/man2/quotactl.2:340
4313 #, no-wrap
4314 msgid "B<Q_XQUOTAON>"
4315 msgstr ""
4316
4317 #. type: Plain text
4318 #: build/C/man2/quotactl.2:361
4319 msgid ""
4320 "Turn on quotas for an XFS file system.  XFS provides the ability to turn "
4321 "on/off quota limit enforcement with quota accounting.  Therefore, XFS "
4322 "expects I<addr> to be a pointer to an I<unsigned int> that contains either "
4323 "the flags B<XFS_QUOTA_UDQ_ACCT> and/or B<XFS_QUOTA_UDQ_ENFD> (for user "
4324 "quota), or B<XFS_QUOTA_GDQ_ACCT> and/or B<XFS_QUOTA_GDQ_ENFD> (for group "
4325 "quota), as defined in I<E<lt>xfs/xqm.hE<gt>>.  This operation requires "
4326 "privilege (B<CAP_SYS_ADMIN>)."
4327 msgstr ""
4328
4329 #. type: TP
4330 #: build/C/man2/quotactl.2:361
4331 #, no-wrap
4332 msgid "B<Q_XQUOTAOFF>"
4333 msgstr ""
4334
4335 #. type: Plain text
4336 #: build/C/man2/quotactl.2:372
4337 msgid ""
4338 "Turn off quotas for an XFS file system.  As with B<Q_QUOTAON>, XFS file "
4339 "systems expect a pointer to an I<unsigned int> that specifies whether quota "
4340 "accounting and/or limit enforcement need to be turned off.  This operation "
4341 "requires privilege (B<CAP_SYS_ADMIN>)."
4342 msgstr ""
4343
4344 #. type: TP
4345 #: build/C/man2/quotactl.2:372
4346 #, no-wrap
4347 msgid "B<Q_XGETQUOTA>"
4348 msgstr ""
4349
4350 #. type: Plain text
4351 #: build/C/man2/quotactl.2:386
4352 msgid ""
4353 "Get disk quota limits and current usage for user I<id>.  The I<addr> "
4354 "argument is a pointer to an I<fs_disk_quota> structure (defined in "
4355 "I<E<lt>xfs/xqm.hE<gt>>).  Unprivileged users may retrieve only their own "
4356 "quotas; a privileged user (B<CAP_SYS_ADMIN>)  may retrieve the quotas of any "
4357 "user."
4358 msgstr ""
4359
4360 #. type: TP
4361 #: build/C/man2/quotactl.2:386
4362 #, no-wrap
4363 msgid "B<Q_XSETQLIM>"
4364 msgstr ""
4365
4366 #. type: Plain text
4367 #: build/C/man2/quotactl.2:398
4368 msgid ""
4369 "Set disk quota limits for user I<id>.  The I<addr> argument is a pointer to "
4370 "an I<fs_disk_quota> structure (defined in I<E<lt>xfs/xqm.hE<gt>>).  This "
4371 "operation requires privilege (B<CAP_SYS_ADMIN>)."
4372 msgstr ""
4373
4374 #. type: TP
4375 #: build/C/man2/quotactl.2:398
4376 #, no-wrap
4377 msgid "B<Q_XGETQSTAT>"
4378 msgstr ""
4379
4380 #. type: Plain text
4381 #: build/C/man2/quotactl.2:406
4382 msgid ""
4383 "Returns an I<fs_quota_stat> structure containing XFS file system specific "
4384 "quota information.  This is useful for finding out how much space is used to "
4385 "store quota information, and also to get quotaon/off status of a given local "
4386 "XFS file system."
4387 msgstr ""
4388
4389 #. type: TP
4390 #: build/C/man2/quotactl.2:406
4391 #, no-wrap
4392 msgid "B<Q_XQUOTARM>"
4393 msgstr ""
4394
4395 #. type: Plain text
4396 #: build/C/man2/quotactl.2:410
4397 msgid ""
4398 "Free the disk space taken by disk quotas.  Quotas must have already been "
4399 "turned off."
4400 msgstr ""
4401
4402 #. type: Plain text
4403 #: build/C/man2/quotactl.2:417
4404 msgid ""
4405 "There is no command equivalent to B<Q_SYNC> for XFS since B<sync>(1)  writes "
4406 "quota information to disk (in addition to the other file system metadata "
4407 "that it writes out)."
4408 msgstr ""
4409
4410 #. type: SH
4411 #: build/C/man2/quotactl.2:417
4412 #, no-wrap
4413 msgid "RETURN VALUES"
4414 msgstr ""
4415
4416 #. type: Plain text
4417 #: build/C/man2/quotactl.2:425
4418 msgid ""
4419 "On success, B<quotactl>()  returns 0; on error -1 is returned, and I<errno> "
4420 "is set to indicate the error."
4421 msgstr ""
4422
4423 #. type: Plain text
4424 #: build/C/man2/quotactl.2:432
4425 msgid "I<addr> or I<special> is invalid."
4426 msgstr ""
4427
4428 #. type: Plain text
4429 #: build/C/man2/quotactl.2:438
4430 msgid "I<cmd> or I<type> is invalid."
4431 msgstr ""
4432
4433 #. type: TP
4434 #: build/C/man2/quotactl.2:438
4435 #, no-wrap
4436 msgid "B<ENOENT>"
4437 msgstr ""
4438
4439 #. type: Plain text
4440 #: build/C/man2/quotactl.2:445
4441 msgid "The file specified by I<special> or I<addr> does not exist."
4442 msgstr ""
4443
4444 #. type: Plain text
4445 #: build/C/man2/quotactl.2:450
4446 msgid "The kernel has not been compiled with the B<CONFIG_QUOTA> option."
4447 msgstr ""
4448
4449 #. type: TP
4450 #: build/C/man2/quotactl.2:450
4451 #, no-wrap
4452 msgid "B<ENOTBLK>"
4453 msgstr ""
4454
4455 #. type: Plain text
4456 #: build/C/man2/quotactl.2:454
4457 msgid "I<special> is not a block device."
4458 msgstr ""
4459
4460 #. type: Plain text
4461 #: build/C/man2/quotactl.2:459
4462 msgid ""
4463 "The caller lacked the required privilege (B<CAP_SYS_ADMIN>)  for the "
4464 "specified operation."
4465 msgstr ""
4466
4467 #. type: Plain text
4468 #: build/C/man2/quotactl.2:463
4469 msgid ""
4470 "No disk quota is found for the indicated user.  Quotas have not been turned "
4471 "on for this file system."
4472 msgstr ""
4473
4474 #. type: Plain text
4475 #: build/C/man2/quotactl.2:472
4476 msgid "If I<cmd> is B<Q_SETQUOTA>, B<quotactl>()  may also set I<errno> to:"
4477 msgstr ""
4478
4479 #. type: Plain text
4480 #: build/C/man2/quotactl.2:475
4481 msgid "Specified limits are out of range allowed by quota format."
4482 msgstr ""
4483
4484 #. type: Plain text
4485 #: build/C/man2/quotactl.2:484
4486 msgid "If I<cmd> is B<Q_QUOTAON>, B<quotactl>()  may also set I<errno> to:"
4487 msgstr ""
4488
4489 #. type: Plain text
4490 #: build/C/man2/quotactl.2:493
4491 msgid ""
4492 "The quota file pointed to by I<addr> exists, but is not a regular file; or, "
4493 "the quota file pointed to by I<addr> exists, but is not on the file system "
4494 "pointed to by I<special>."
4495 msgstr ""
4496
4497 #. type: Plain text
4498 #: build/C/man2/quotactl.2:499
4499 msgid "B<Q_QUOTAON> attempted, but another B<Q_QUOTAON> had already been performed."
4500 msgstr ""
4501
4502 #. type: Plain text
4503 #: build/C/man2/quotactl.2:502
4504 msgid "The quota file is corrupted."
4505 msgstr ""
4506
4507 #. type: Plain text
4508 #: build/C/man2/quotactl.2:505
4509 msgid "Specified quota format was not found."
4510 msgstr ""
4511
4512 #. type: Plain text
4513 #: build/C/man2/quotactl.2:510
4514 msgid "B<quota>(1), B<getrlimit>(2), B<quotacheck>(8), B<quotaon>(8)"
4515 msgstr ""
4516
4517 #. type: TH
4518 #: build/C/man2/sendfile.2:15
4519 #, no-wrap
4520 msgid "SENDFILE"
4521 msgstr ""
4522
4523 #. type: TH
4524 #: build/C/man2/sendfile.2:15
4525 #, no-wrap
4526 msgid "2011-09-14"
4527 msgstr ""
4528
4529 #. type: Plain text
4530 #: build/C/man2/sendfile.2:18
4531 msgid "sendfile - transfer data between file descriptors"
4532 msgstr ""
4533
4534 #. type: Plain text
4535 #: build/C/man2/sendfile.2:20
4536 msgid "B<#include E<lt>sys/sendfile.hE<gt>>"
4537 msgstr ""
4538
4539 #.  The below is too ugly. Comments about glibc versions belong
4540 #.  in the notes, not in the header.
4541 #
4542 #.  .B #include <features.h>
4543 #.  .br
4544 #.  .B #if (__GLIBC__==2 && __GLIBC_MINOR__>=1) || __GLIBC__>2
4545 #.  .br
4546 #.  .B #include <sys/sendfile.h>
4547 #.  .br
4548 #.  #else
4549 #.  .br
4550 #.  .B #include <sys/types.h>
4551 #.  .br
4552 #.  .B /* No system prototype before glibc 2.1. */
4553 #.  .br
4554 #.  .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \
4555 #.                        offset ", size_t" " count" )
4556 #.  .br
4557 #.  .B #endif
4558 #. type: Plain text
4559 #: build/C/man2/sendfile.2:43
4560 msgid ""
4561 "B<ssize_t sendfile(int>I< out_fd>B<, int>I< in_fd>B<, off_t *>I<offset>B<, "
4562 "size_t>I< count>B<);>"
4563 msgstr ""
4564
4565 #. type: Plain text
4566 #: build/C/man2/sendfile.2:53
4567 msgid ""
4568 "B<sendfile>()  copies data between one file descriptor and another.  Because "
4569 "this copying is done within the kernel, B<sendfile>()  is more efficient "
4570 "than the combination of B<read>(2)  and B<write>(2), which would require "
4571 "transferring data to and from user space."
4572 msgstr ""
4573
4574 #. type: Plain text
4575 #: build/C/man2/sendfile.2:58
4576 msgid ""
4577 "I<in_fd> should be a file descriptor opened for reading and I<out_fd> should "
4578 "be a descriptor opened for writing."
4579 msgstr ""
4580
4581 #. type: Plain text
4582 #: build/C/man2/sendfile.2:79
4583 msgid ""
4584 "If I<offset> is not NULL, then it points to a variable holding the file "
4585 "offset from which B<sendfile>()  will start reading data from I<in_fd>.  "
4586 "When B<sendfile>()  returns, this variable will be set to the offset of the "
4587 "byte following the last byte that was read.  If I<offset> is not NULL, then "
4588 "B<sendfile>()  does not modify the current file offset of I<in_fd>; "
4589 "otherwise the current file offset is adjusted to reflect the number of bytes "
4590 "read from I<in_fd>."
4591 msgstr ""
4592
4593 #. type: Plain text
4594 #: build/C/man2/sendfile.2:86
4595 msgid ""
4596 "If I<offset> is NULL, then data will be read from I<in_fd> starting at the "
4597 "current file offset, and the file offset will be updated by the call."
4598 msgstr ""
4599
4600 #. type: Plain text
4601 #: build/C/man2/sendfile.2:89
4602 msgid "I<count> is the number of bytes to copy between the file descriptors."
4603 msgstr ""
4604
4605 #. type: Plain text
4606 #: build/C/man2/sendfile.2:96
4607 msgid ""
4608 "The I<in_fd> argument must correspond to a file which supports "
4609 "B<mmap>(2)-like operations (i.e., it cannot be a socket)."
4610 msgstr ""
4611
4612 #. type: Plain text
4613 #: build/C/man2/sendfile.2:104
4614 msgid ""
4615 "In Linux kernels before 2.6.33, I<out_fd> must refer to a socket.  Since "
4616 "Linux 2.6.33 it can be any file.  If it is a regular file, then "
4617 "B<sendfile>()  changes the file offset appropriately."
4618 msgstr ""
4619
4620 #. type: Plain text
4621 #: build/C/man2/sendfile.2:111
4622 msgid ""
4623 "If the transfer was successful, the number of bytes written to I<out_fd> is "
4624 "returned.  On error, -1 is returned, and I<errno> is set appropriately."
4625 msgstr ""
4626
4627 #. type: Plain text
4628 #: build/C/man2/sendfile.2:117
4629 msgid ""
4630 "Nonblocking I/O has been selected using B<O_NONBLOCK> and the write would "
4631 "block."
4632 msgstr ""
4633
4634 #. type: TP
4635 #: build/C/man2/sendfile.2:117 build/C/man2/splice.2:143 build/C/man2/vmsplice.2:123
4636 #, no-wrap
4637 msgid "B<EBADF>"
4638 msgstr ""
4639
4640 #. type: Plain text
4641 #: build/C/man2/sendfile.2:121
4642 msgid ""
4643 "The input file was not opened for reading or the output file was not opened "
4644 "for writing."
4645 msgstr ""
4646
4647 #. type: Plain text
4648 #: build/C/man2/sendfile.2:124
4649 msgid "Bad address."
4650 msgstr ""
4651
4652 #. type: Plain text
4653 #: build/C/man2/sendfile.2:130
4654 msgid ""
4655 "Descriptor is not valid or locked, or an B<mmap>(2)-like operation is not "
4656 "available for I<in_fd>."
4657 msgstr ""
4658
4659 #. type: Plain text
4660 #: build/C/man2/sendfile.2:134
4661 msgid "Unspecified error while reading from I<in_fd>."
4662 msgstr ""
4663
4664 #. type: Plain text
4665 #: build/C/man2/sendfile.2:138
4666 msgid "Insufficient memory to read from I<in_fd>."
4667 msgstr ""
4668
4669 #. type: Plain text
4670 #: build/C/man2/sendfile.2:144
4671 msgid ""
4672 "B<sendfile>()  is a new feature in Linux 2.2.  The include file "
4673 "I<E<lt>sys/sendfile.hE<gt>> is present since glibc 2.1."
4674 msgstr ""
4675
4676 #. type: Plain text
4677 #: build/C/man2/sendfile.2:146
4678 msgid "Not specified in POSIX.1-2001, or other standards."
4679 msgstr ""
4680
4681 #. type: Plain text
4682 #: build/C/man2/sendfile.2:151
4683 msgid ""
4684 "Other UNIX systems implement B<sendfile>()  with different semantics and "
4685 "prototypes.  It should not be used in portable programs."
4686 msgstr ""
4687
4688 #. type: Plain text
4689 #: build/C/man2/sendfile.2:161
4690 msgid ""
4691 "If you plan to use B<sendfile>()  for sending files to a TCP socket, but "
4692 "need to send some header data in front of the file contents, you will find "
4693 "it useful to employ the B<TCP_CORK> option, described in B<tcp>(7), to "
4694 "minimize the number of packets and to tune performance."
4695 msgstr ""
4696
4697 #. type: Plain text
4698 #: build/C/man2/sendfile.2:167
4699 msgid ""
4700 "In Linux 2.4 and earlier, I<out_fd> could also refer to a regular file, and "
4701 "B<sendfile>()  changed the current offset of that file."
4702 msgstr ""
4703
4704 #. type: Plain text
4705 #: build/C/man2/sendfile.2:179
4706 msgid ""
4707 "The original Linux B<sendfile>()  system call was not designed to handle "
4708 "large file offsets.  Consequently, Linux 2.4 added B<sendfile64>(), with a "
4709 "wider type for the I<offset> argument.  The glibc B<sendfile>()  wrapper "
4710 "function transparently deals with the kernel differences."
4711 msgstr ""
4712
4713 #. type: Plain text
4714 #: build/C/man2/sendfile.2:188
4715 msgid ""
4716 "Applications may wish to fall back to B<read>(2)/B<write>(2)  in the case "
4717 "where B<sendfile>()  fails with B<EINVAL> or B<ENOSYS>."
4718 msgstr ""
4719
4720 #. type: Plain text
4721 #: build/C/man2/sendfile.2:193
4722 msgid ""
4723 "The Linux-specific B<splice>(2)  call supports transferring data between "
4724 "arbitrary files (e.g., a pair of sockets)."
4725 msgstr ""
4726
4727 #. type: Plain text
4728 #: build/C/man2/sendfile.2:198
4729 msgid "B<mmap>(2), B<open>(2), B<socket>(2), B<splice>(2)"
4730 msgstr ""
4731
4732 #. type: TH
4733 #: build/C/man2/set_tid_address.2:23
4734 #, no-wrap
4735 msgid "SET_TID_ADDRESS"
4736 msgstr ""
4737
4738 #. type: TH
4739 #: build/C/man2/set_tid_address.2:23
4740 #, no-wrap
4741 msgid "2004-09-10"
4742 msgstr ""
4743
4744 #. type: Plain text
4745 #: build/C/man2/set_tid_address.2:26
4746 msgid "set_tid_address - set pointer to thread ID"
4747 msgstr ""
4748
4749 #. type: Plain text
4750 #: build/C/man2/set_tid_address.2:29
4751 #, no-wrap
4752 msgid "B<#include E<lt>linux/unistd.hE<gt>>\n"
4753 msgstr ""
4754
4755 #. type: Plain text
4756 #: build/C/man2/set_tid_address.2:31
4757 #, no-wrap
4758 msgid "B<long set_tid_address(int *>I<tidptr>B<);>\n"
4759 msgstr ""
4760
4761 #. type: Plain text
4762 #: build/C/man2/set_tid_address.2:38
4763 msgid ""
4764 "The kernel keeps for each process two values called I<set_child_tid> and "
4765 "I<clear_child_tid> that are NULL by default."
4766 msgstr ""
4767
4768 #. type: SS
4769 #: build/C/man2/set_tid_address.2:38
4770 #, no-wrap
4771 msgid "set_child_tid"
4772 msgstr ""
4773
4774 #. type: Plain text
4775 #: build/C/man2/set_tid_address.2:48
4776 msgid ""
4777 "If a process is started using B<clone>(2)  with the B<CLONE_CHILD_SETTID> "
4778 "flag, I<set_child_tid> is set to I<child_tidptr>, the fifth argument of that "
4779 "system call."
4780 msgstr ""
4781
4782 #. type: Plain text
4783 #: build/C/man2/set_tid_address.2:53
4784 msgid ""
4785 "When I<set_child_tid> is set, the very first thing the new process does is "
4786 "writing its PID at this address."
4787 msgstr ""
4788
4789 #. type: SS
4790 #: build/C/man2/set_tid_address.2:53
4791 #, no-wrap
4792 msgid "clear_child_tid"
4793 msgstr ""
4794
4795 #. type: Plain text
4796 #: build/C/man2/set_tid_address.2:63
4797 msgid ""
4798 "If a process is started using B<clone>(2)  with the B<CLONE_CHILD_CLEARTID> "
4799 "flag, I<clear_child_tid> is set to I<child_tidptr>, the fifth argument of "
4800 "that system call."
4801 msgstr ""
4802
4803 #. type: Plain text
4804 #: build/C/man2/set_tid_address.2:70
4805 msgid ""
4806 "The system call B<set_tid_address>()  sets the I<clear_child_tid> value for "
4807 "the calling process to I<tidptr>."
4808 msgstr ""
4809
4810 #. type: Plain text
4811 #: build/C/man2/set_tid_address.2:80
4812 msgid ""
4813 "When I<clear_child_tid> is set, and the process exits, and the process was "
4814 "sharing memory with other processes or threads, then 0 is written at this "
4815 "address, and a I<futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0);> call is "
4816 "done.  (That is, wake a single process waiting on this futex.)  Errors are "
4817 "ignored."
4818 msgstr ""
4819
4820 #. type: Plain text
4821 #: build/C/man2/set_tid_address.2:83
4822 msgid "B<set_tid_address>()  always returns the PID of the calling process."
4823 msgstr ""
4824
4825 #. type: Plain text
4826 #: build/C/man2/set_tid_address.2:86
4827 msgid "B<set_tid_address>()  always succeeds."
4828 msgstr ""
4829
4830 #. type: Plain text
4831 #: build/C/man2/set_tid_address.2:89
4832 msgid ""
4833 "This call is present since Linux 2.5.48.  Details as given here are valid "
4834 "since Linux 2.5.49."
4835 msgstr ""
4836
4837 #. type: Plain text
4838 #: build/C/man2/set_tid_address.2:94
4839 msgid "B<clone>(2), B<futex>(2)"
4840 msgstr ""
4841
4842 #. type: TH
4843 #: build/C/man2/splice.2:26
4844 #, no-wrap
4845 msgid "SPLICE"
4846 msgstr ""
4847
4848 #. type: TH
4849 #: build/C/man2/splice.2:26 build/C/man2/tee.2:26 build/C/man2/vmsplice.2:26
4850 #, no-wrap
4851 msgid "2009-09-15"
4852 msgstr ""
4853
4854 #. type: Plain text
4855 #: build/C/man2/splice.2:29
4856 msgid "splice - splice data to/from a pipe"
4857 msgstr ""
4858
4859 #. type: Plain text
4860 #: build/C/man2/splice.2:33 build/C/man2/tee.2:33
4861 #, no-wrap
4862 msgid ""
4863 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
4864 "B<#include E<lt>fcntl.hE<gt>>\n"
4865 msgstr ""
4866
4867 #.  Return type was long before glibc 2.7
4868 #. type: Plain text
4869 #: build/C/man2/splice.2:38
4870 #, no-wrap
4871 msgid ""
4872 "B<ssize_t splice(int >I<fd_in>B<, loff_t *>I<off_in>B<, int >I<fd_out>B<,>\n"
4873 "B<               loff_t *>I<off_out>B<, size_t >I<len>B<, unsigned int "
4874 ">I<flags>B<);>\n"
4875 msgstr ""
4876
4877 #. type: Plain text
4878 #: build/C/man2/splice.2:50
4879 msgid ""
4880 "B<splice>()  moves data between two file descriptors without copying between "
4881 "kernel address space and user address space.  It transfers up to I<len> "
4882 "bytes of data from the file descriptor I<fd_in> to the file descriptor "
4883 "I<fd_out>, where one of the descriptors must refer to a pipe."
4884 msgstr ""
4885
4886 #. type: Plain text
4887 #: build/C/man2/splice.2:80
4888 msgid ""
4889 "If I<fd_in> refers to a pipe, then I<off_in> must be NULL.  If I<fd_in> does "
4890 "not refer to a pipe and I<off_in> is NULL, then bytes are read from I<fd_in> "
4891 "starting from the current file offset, and the current file offset is "
4892 "adjusted appropriately.  If I<fd_in> does not refer to a pipe and I<off_in> "
4893 "is not NULL, then I<off_in> must point to a buffer which specifies the "
4894 "starting offset from which bytes will be read from I<fd_in>; in this case, "
4895 "the current file offset of I<fd_in> is not changed.  Analogous statements "
4896 "apply for I<fd_out> and I<off_out>."
4897 msgstr ""
4898
4899 #. type: Plain text
4900 #: build/C/man2/splice.2:85 build/C/man2/vmsplice.2:78
4901 msgid ""
4902 "The I<flags> argument is a bit mask that is composed by ORing together zero "
4903 "or more of the following values:"
4904 msgstr ""
4905
4906 #. type: TP
4907 #: build/C/man2/splice.2:85 build/C/man2/tee.2:62 build/C/man2/vmsplice.2:78
4908 #, no-wrap
4909 msgid "B<SPLICE_F_MOVE>"
4910 msgstr ""
4911
4912 #. type: Plain text
4913 #: build/C/man2/splice.2:98
4914 msgid ""
4915 "Attempt to move pages instead of copying.  This is only a hint to the "
4916 "kernel: pages may still be copied if the kernel cannot move the pages from "
4917 "the pipe, or if the pipe buffers don't refer to full pages.  The initial "
4918 "implementation of this flag was buggy: therefore starting in Linux 2.6.21 it "
4919 "is a no-op (but is still permitted in a B<splice>()  call); in the future, a "
4920 "correct implementation may be restored."
4921 msgstr ""
4922
4923 #. type: TP
4924 #: build/C/man2/splice.2:98 build/C/man2/tee.2:68 build/C/man2/vmsplice.2:84
4925 #, no-wrap
4926 msgid "B<SPLICE_F_NONBLOCK>"
4927 msgstr ""
4928
4929 #. type: Plain text
4930 #: build/C/man2/splice.2:107
4931 msgid ""
4932 "Do not block on I/O.  This makes the splice pipe operations nonblocking, but "
4933 "B<splice>()  may nevertheless block because the file descriptors that are "
4934 "spliced to/from may block (unless they have the B<O_NONBLOCK> flag set)."
4935 msgstr ""
4936
4937 #. type: TP
4938 #: build/C/man2/splice.2:107 build/C/man2/tee.2:73 build/C/man2/vmsplice.2:91
4939 #, no-wrap
4940 msgid "B<SPLICE_F_MORE>"
4941 msgstr ""
4942
4943 #. type: Plain text
4944 #: build/C/man2/splice.2:121
4945 msgid ""
4946 "More data will be coming in a subsequent splice.  This is a helpful hint "
4947 "when the I<fd_out> refers to a socket (see also the description of "
4948 "B<MSG_MORE> in B<send>(2), and the description of B<TCP_CORK> in B<tcp>(7))"
4949 msgstr ""
4950
4951 #. type: TP
4952 #: build/C/man2/splice.2:121 build/C/man2/tee.2:79 build/C/man2/vmsplice.2:97
4953 #, no-wrap
4954 msgid "B<SPLICE_F_GIFT>"
4955 msgstr ""
4956
4957 #. type: Plain text
4958 #: build/C/man2/splice.2:127
4959 msgid "Unused for B<splice>(); see B<vmsplice>(2)."
4960 msgstr ""
4961
4962 #. type: Plain text
4963 #: build/C/man2/splice.2:136
4964 msgid ""
4965 "Upon successful completion, B<splice>()  returns the number of bytes spliced "
4966 "to or from the pipe.  A return value of 0 means that there was no data to "
4967 "transfer, and it would not make sense to block, because there are no writers "
4968 "connected to the write end of the pipe referred to by I<fd_in>."
4969 msgstr ""
4970
4971 #. type: Plain text
4972 #: build/C/man2/splice.2:142
4973 msgid "On error, B<splice>()  returns -1 and I<errno> is set to indicate the error."
4974 msgstr ""
4975
4976 #. type: Plain text
4977 #: build/C/man2/splice.2:147
4978 msgid ""
4979 "One or both file descriptors are not valid, or do not have proper read-write "
4980 "mode."
4981 msgstr ""
4982
4983 #.  The append-mode error is given since 2.6.27; in earlier kernels,
4984 #.  splice() in append mode was broken
4985 #. type: Plain text
4986 #: build/C/man2/splice.2:155
4987 msgid ""
4988 "Target file system doesn't support splicing; target file is opened in append "
4989 "mode; neither of the descriptors refers to a pipe; or offset given for "
4990 "nonseekable device."
4991 msgstr ""
4992
4993 #. type: Plain text
4994 #: build/C/man2/splice.2:158 build/C/man2/tee.2:114 build/C/man2/vmsplice.2:138
4995 msgid "Out of memory."
4996 msgstr ""
4997
4998 #. type: TP
4999 #: build/C/man2/splice.2:158
5000 #, no-wrap
5001 msgid "B<ESPIPE>"
5002 msgstr ""
5003
5004 #. type: Plain text
5005 #: build/C/man2/splice.2:165
5006 msgid ""
5007 "Either I<off_in> or I<off_out> was not NULL, but the corresponding file "
5008 "descriptor refers to a pipe."
5009 msgstr ""
5010
5011 #. type: Plain text
5012 #: build/C/man2/splice.2:169
5013 msgid "The B<splice>()  system call first appeared in Linux 2.6.17."
5014 msgstr ""
5015
5016 #. type: Plain text
5017 #: build/C/man2/splice.2:181
5018 msgid ""
5019 "The three system calls B<splice>(), B<vmsplice>(2), and B<tee>(2), provide "
5020 "userspace programs with full control over an arbitrary kernel buffer, "
5021 "implemented within the kernel using the same type of buffer that is used for "
5022 "a pipe.  In overview, these system calls perform the following tasks:"
5023 msgstr ""
5024
5025 #. type: TP
5026 #: build/C/man2/splice.2:181
5027 #, no-wrap
5028 msgid "B<splice>()"
5029 msgstr ""
5030
5031 #. type: Plain text
5032 #: build/C/man2/splice.2:185
5033 msgid ""
5034 "moves data from the buffer to an arbitrary file descriptor, or vice versa, "
5035 "or from one buffer to another."
5036 msgstr ""
5037
5038 #. type: TP
5039 #: build/C/man2/splice.2:185
5040 #, no-wrap
5041 msgid "B<tee>(2)"
5042 msgstr ""
5043
5044 #. type: Plain text
5045 #: build/C/man2/splice.2:188
5046 msgid "\"copies\" the data from one buffer to another."
5047 msgstr ""
5048
5049 #. type: TP
5050 #: build/C/man2/splice.2:188
5051 #, no-wrap
5052 msgid "B<vmsplice>(2)"
5053 msgstr ""
5054
5055 #. type: Plain text
5056 #: build/C/man2/splice.2:191
5057 msgid "\"copies\" data from user space into the buffer."
5058 msgstr ""
5059
5060 #
5061 #.  Linus: Now, imagine using the above in a media server, for example.
5062 #.  Let's say that a year or two has passed, so that the video drivers
5063 #.  have been updated to be able to do the splice thing, and what can
5064 #.  you do? You can:
5065 #
5066 #.  - splice from the (mpeg or whatever - let's just assume that the video
5067 #.    input is either digital or does the encoding on its own - like they
5068 #.    pretty much all do) video input into a pipe (remember: no copies - the
5069 #.    video input will just DMA directly into memory, and splice will just
5070 #.    set up the pages in the pipe buffer)
5071 #.  - tee that pipe to split it up
5072 #.  - splice one end to a file (ie "save the compressed stream to disk")
5073 #.  - splice the other end to a real-time video decoder window for your
5074 #.    real-time viewing pleasure.
5075 #
5076 #.  Linus: Now, the advantage of splice()/tee() is that you can
5077 #.  do zero-copy movement of data, and unlike sendfile() you can
5078 #.  do it on _arbitrary_ data (and, as shown by "tee()", it's more
5079 #.  than just sending the data to somebody else: you can duplicate
5080 #.  the data and choose to forward it to two or more different
5081 #.  users - for things like logging etc.).
5082 #. type: Plain text
5083 #: build/C/man2/splice.2:222
5084 msgid ""
5085 "Though we talk of copying, actual copies are generally avoided.  The kernel "
5086 "does this by implementing a pipe buffer as a set of reference-counted "
5087 "pointers to pages of kernel memory.  The kernel creates \"copies\" of pages "
5088 "in a buffer by creating new pointers (for the output buffer) referring to "
5089 "the pages, and increasing the reference counts for the pages: only pointers "
5090 "are copied, not the pages of the buffer."
5091 msgstr ""
5092
5093 #. type: Plain text
5094 #: build/C/man2/splice.2:225
5095 msgid "See B<tee>(2)."
5096 msgstr ""
5097
5098 #. type: Plain text
5099 #: build/C/man2/splice.2:229
5100 msgid "B<sendfile>(2), B<tee>(2), B<vmsplice>(2)"
5101 msgstr ""
5102
5103 #. type: TH
5104 #: build/C/man2/tee.2:26
5105 #, no-wrap
5106 msgid "TEE"
5107 msgstr ""
5108
5109 #. type: Plain text
5110 #: build/C/man2/tee.2:29
5111 msgid "tee - duplicating pipe content"
5112 msgstr ""
5113
5114 #. type: Plain text
5115 #: build/C/man2/tee.2:36
5116 #, no-wrap
5117 msgid ""
5118 "B<ssize_t tee(int >I<fd_in>B<, int >I<fd_out>B<, size_t >I<len>B<, unsigned "
5119 "int >I<flags>B<);>\n"
5120 msgstr ""
5121
5122 #.  Example programs http://brick.kernel.dk/snaps
5123 #
5124 #
5125 #.  add a "tee(in, out1, out2)" system call that duplicates the pages
5126 #.  (again, incrementing their reference count, not copying the data) from
5127 #.  one pipe to two other pipes.
5128 #. type: Plain text
5129 #: build/C/man2/tee.2:56
5130 msgid ""
5131 "B<tee>()  duplicates up to I<len> bytes of data from the pipe referred to by "
5132 "the file descriptor I<fd_in> to the pipe referred to by the file descriptor "
5133 "I<fd_out>.  It does not consume the data that is duplicated from I<fd_in>; "
5134 "therefore, that data can be copied by a subsequent B<splice>(2)."
5135 msgstr ""
5136
5137 #. type: Plain text
5138 #: build/C/man2/tee.2:62
5139 msgid ""
5140 "I<flags> is a series of modifier flags, which share the name space with "
5141 "B<splice>(2)  and B<vmsplice>(2):"
5142 msgstr ""
5143
5144 #. type: Plain text
5145 #: build/C/man2/tee.2:68
5146 msgid "Currently has no effect for B<tee>(); see B<splice>(2)."
5147 msgstr ""
5148
5149 #.  Not used for vmsplice
5150 #.  May be in the future -- therefore EAGAIN
5151 #. type: Plain text
5152 #: build/C/man2/tee.2:73 build/C/man2/vmsplice.2:91
5153 msgid "Do not block on I/O; see B<splice>(2)  for further details."
5154 msgstr ""
5155
5156 #. type: Plain text
5157 #: build/C/man2/tee.2:79
5158 msgid ""
5159 "Currently has no effect for B<tee>(), but may be implemented in the future; "
5160 "see B<splice>(2)."
5161 msgstr ""
5162
5163 #. type: Plain text
5164 #: build/C/man2/tee.2:85
5165 msgid "Unused for B<tee>(); see B<vmsplice>(2)."
5166 msgstr ""
5167
5168 #. type: Plain text
5169 #: build/C/man2/tee.2:94
5170 msgid ""
5171 "Upon successful completion, B<tee>()  returns the number of bytes that were "
5172 "duplicated between the input and output.  A return value of 0 means that "
5173 "there was no data to transfer, and it would not make sense to block, because "
5174 "there are no writers connected to the write end of the pipe referred to by "
5175 "I<fd_in>."
5176 msgstr ""
5177
5178 #. type: Plain text
5179 #: build/C/man2/tee.2:100
5180 msgid "On error, B<tee>()  returns -1 and I<errno> is set to indicate the error."
5181 msgstr ""
5182
5183 #. type: Plain text
5184 #: build/C/man2/tee.2:111
5185 msgid ""
5186 "I<fd_in> or I<fd_out> does not refer to a pipe; or I<fd_in> and I<fd_out> "
5187 "refer to the same pipe."
5188 msgstr ""
5189
5190 #. type: Plain text
5191 #: build/C/man2/tee.2:118
5192 msgid "The B<tee>()  system call first appeared in Linux 2.6.17."
5193 msgstr ""
5194
5195 #. type: Plain text
5196 #: build/C/man2/tee.2:129
5197 msgid ""
5198 "Conceptually, B<tee>()  copies the data between the two pipes.  In reality "
5199 "no real data copying takes place though: under the covers, B<tee>()  assigns "
5200 "data in the output by merely grabbing a reference to the input."
5201 msgstr ""
5202
5203 #. type: Plain text
5204 #: build/C/man2/tee.2:135
5205 msgid ""
5206 "The following example implements a basic B<tee>(1)  program using the "
5207 "B<tee>()  system call."
5208 msgstr ""
5209
5210 #. type: Plain text
5211 #: build/C/man2/tee.2:144
5212 #, no-wrap
5213 msgid ""
5214 "#define _GNU_SOURCE\n"
5215 "#include E<lt>fcntl.hE<gt>\n"
5216 "#include E<lt>stdio.hE<gt>\n"
5217 "#include E<lt>stdlib.hE<gt>\n"
5218 "#include E<lt>unistd.hE<gt>\n"
5219 "#include E<lt>errno.hE<gt>\n"
5220 "#include E<lt>limits.hE<gt>\n"
5221 msgstr ""
5222
5223 #. type: Plain text
5224 #: build/C/man2/tee.2:150
5225 #, no-wrap
5226 msgid ""
5227 "int\n"
5228 "main(int argc, char *argv[])\n"
5229 "{\n"
5230 "    int fd;\n"
5231 "    int len, slen;\n"
5232 msgstr ""
5233
5234 #. type: Plain text
5235 #: build/C/man2/tee.2:155
5236 #, no-wrap
5237 msgid ""
5238 "    if (argc != 2) {\n"
5239 "        fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
5240 "        exit(EXIT_FAILURE);\n"
5241 "    }\n"
5242 msgstr ""
5243
5244 #. type: Plain text
5245 #: build/C/man2/tee.2:161
5246 #, no-wrap
5247 msgid ""
5248 "    fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);\n"
5249 "    if (fd == -1) {\n"
5250 "        perror(\"open\");\n"
5251 "        exit(EXIT_FAILURE);\n"
5252 "    }\n"
5253 msgstr ""
5254
5255 #. type: Plain text
5256 #: build/C/man2/tee.2:168
5257 #, no-wrap
5258 msgid ""
5259 "    do {\n"
5260 "        /*\n"
5261 "         * tee stdin to stdout.\n"
5262 "         */\n"
5263 "        len = tee(STDIN_FILENO, STDOUT_FILENO,\n"
5264 "                  INT_MAX, SPLICE_F_NONBLOCK);\n"
5265 msgstr ""
5266
5267 #. type: Plain text
5268 #: build/C/man2/tee.2:177
5269 #, no-wrap
5270 msgid ""
5271 "        if (len E<lt> 0) {\n"
5272 "            if (errno == EAGAIN)\n"
5273 "                continue;\n"
5274 "            perror(\"tee\");\n"
5275 "            exit(EXIT_FAILURE);\n"
5276 "        } else\n"
5277 "            if (len == 0)\n"
5278 "                break;\n"
5279 msgstr ""
5280
5281 #. type: Plain text
5282 #: build/C/man2/tee.2:191
5283 #, no-wrap
5284 msgid ""
5285 "        /*\n"
5286 "         * Consume stdin by splicing it to a file.\n"
5287 "         */\n"
5288 "        while (len E<gt> 0) {\n"
5289 "            slen = splice(STDIN_FILENO, NULL, fd, NULL,\n"
5290 "                          len, SPLICE_F_MOVE);\n"
5291 "            if (slen E<lt> 0) {\n"
5292 "                perror(\"splice\");\n"
5293 "                break;\n"
5294 "            }\n"
5295 "            len -= slen;\n"
5296 "        }\n"
5297 "    } while (1);\n"
5298 msgstr ""
5299
5300 #. type: Plain text
5301 #: build/C/man2/tee.2:195
5302 #, no-wrap
5303 msgid ""
5304 "    close(fd);\n"
5305 "    exit(EXIT_SUCCESS);\n"
5306 "}\n"
5307 msgstr ""
5308
5309 #. type: Plain text
5310 #: build/C/man2/tee.2:199
5311 msgid "B<splice>(2), B<vmsplice>(2)"
5312 msgstr ""
5313
5314 #. type: TH
5315 #: build/C/man2/vm86.2:26
5316 #, no-wrap
5317 msgid "VM86"
5318 msgstr ""
5319
5320 #. type: TH
5321 #: build/C/man2/vm86.2:26
5322 #, no-wrap
5323 msgid "2009-02-20"
5324 msgstr ""
5325
5326 #. type: Plain text
5327 #: build/C/man2/vm86.2:29
5328 msgid "vm86old, vm86 - enter virtual 8086 mode"
5329 msgstr ""
5330
5331 #. type: Plain text
5332 #: build/C/man2/vm86.2:31
5333 msgid "B<#include E<lt>sys/vm86.hE<gt>>"
5334 msgstr ""
5335
5336 #. type: Plain text
5337 #: build/C/man2/vm86.2:33
5338 msgid "B<int vm86old(struct vm86_struct *>I<info>B<);>"
5339 msgstr ""
5340
5341 #. type: Plain text
5342 #: build/C/man2/vm86.2:35
5343 msgid "B<int vm86(unsigned long >I<fn>B<, struct vm86plus_struct *>I<v86>B<);>"
5344 msgstr ""
5345
5346 #. type: Plain text
5347 #: build/C/man2/vm86.2:46
5348 msgid ""
5349 "The system call B<vm86>()  was introduced in Linux 0.97p2.  In Linux 2.1.15 "
5350 "and 2.0.28 it was renamed to B<vm86old>(), and a new B<vm86>()  was "
5351 "introduced.  The definition of I<struct vm86_struct> was changed in 1.1.8 "
5352 "and 1.1.9."
5353 msgstr ""
5354
5355 #. type: Plain text
5356 #: build/C/man2/vm86.2:50
5357 msgid ""
5358 "These calls cause the process to enter VM86 mode (virtual-8086 in Intel "
5359 "literature), and are used by B<dosemu>."
5360 msgstr ""
5361
5362 #. type: Plain text
5363 #: build/C/man2/vm86.2:52
5364 msgid "VM86 mode is an emulation of real mode within a protected mode task."
5365 msgstr ""
5366
5367 #. type: Plain text
5368 #: build/C/man2/vm86.2:62
5369 msgid ""
5370 "This return value is specific to i386 and indicates a problem with getting "
5371 "userspace data."
5372 msgstr ""
5373
5374 #. type: Plain text
5375 #: build/C/man2/vm86.2:66
5376 msgid ""
5377 "This return value indicates the call is not implemented on the present "
5378 "architecture."
5379 msgstr ""
5380
5381 #. type: Plain text
5382 #: build/C/man2/vm86.2:71
5383 msgid ""
5384 "Saved kernel stack exists.  (This is a kernel sanity check; the saved stack "
5385 "should only exist within vm86 mode itself.)"
5386 msgstr ""
5387
5388 #. type: Plain text
5389 #: build/C/man2/vm86.2:74
5390 msgid ""
5391 "This call is specific to Linux on 32-bit Intel processors, and should not be "
5392 "used in programs intended to be portable."
5393 msgstr ""
5394
5395 #. type: TH
5396 #: build/C/man2/vmsplice.2:26
5397 #, no-wrap
5398 msgid "VMSPLICE"
5399 msgstr ""
5400
5401 #. type: Plain text
5402 #: build/C/man2/vmsplice.2:29
5403 msgid "vmsplice - splice user pages into a pipe"
5404 msgstr ""
5405
5406 #. type: Plain text
5407 #: build/C/man2/vmsplice.2:34
5408 #, no-wrap
5409 msgid ""
5410 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
5411 "B<#include E<lt>fcntl.hE<gt>>\n"
5412 "B<#include E<lt>sys/uio.hE<gt>>\n"
5413 msgstr ""
5414
5415 #. type: Plain text
5416 #: build/C/man2/vmsplice.2:37
5417 #, no-wrap
5418 msgid ""
5419 "B<ssize_t vmsplice(int >I<fd>B<, const struct iovec *>I<iov>B<,>\n"
5420 "B<                 unsigned long >I<nr_segs>B<, unsigned int "
5421 ">I<flags>B<);>\n"
5422 msgstr ""
5423
5424 #.  Linus: vmsplice() system call to basically do a "write to
5425 #.  the buffer", but using the reference counting and VM traversal
5426 #.  to actually fill the buffer. This means that the user needs to
5427 #.  be careful not to reuse the user-space buffer it spliced into
5428 #.  the kernel-space one (contrast this to "write()", which copies
5429 #.  the actual data, and you can thus reuse the buffer immediately
5430 #.  after a successful write), but that is often easy to do.
5431 #. type: Plain text
5432 #: build/C/man2/vmsplice.2:57
5433 msgid ""
5434 "The B<vmsplice>()  system call maps I<nr_segs> ranges of user memory "
5435 "described by I<iov> into a pipe.  The file descriptor I<fd> must refer to a "
5436 "pipe."
5437 msgstr ""
5438
5439 #. type: Plain text
5440 #: build/C/man2/vmsplice.2:64
5441 msgid ""
5442 "The pointer I<iov> points to an array of I<iovec> structures as defined in "
5443 "I<E<lt>sys/uio.hE<gt>>:"
5444 msgstr ""
5445
5446 #. type: Plain text
5447 #: build/C/man2/vmsplice.2:71
5448 #, no-wrap
5449 msgid ""
5450 "struct iovec {\n"
5451 "    void  *iov_base;            /* Starting address */\n"
5452 "    size_t iov_len;             /* Number of bytes */\n"
5453 "};\n"
5454 msgstr ""
5455
5456 #. type: Plain text
5457 #: build/C/man2/vmsplice.2:84
5458 msgid "Unused for B<vmsplice>(); see B<splice>(2)."
5459 msgstr ""
5460
5461 #. type: Plain text
5462 #: build/C/man2/vmsplice.2:97
5463 msgid ""
5464 "Currently has no effect for B<vmsplice>(), but may be implemented in the "
5465 "future; see B<splice>(2)."
5466 msgstr ""
5467
5468 #.  FIXME Explain the following line in a little more detail:
5469 #.  .... if we expect to later SPLICE_F_MOVE to the cache.
5470 #. type: Plain text
5471 #: build/C/man2/vmsplice.2:113
5472 msgid ""
5473 "The user pages are a gift to the kernel.  The application may not modify "
5474 "this memory ever, or page cache and on-disk data may differ.  Gifting pages "
5475 "to the kernel means that a subsequent B<splice>(2)  B<SPLICE_F_MOVE> can "
5476 "successfully move the pages; if this flag is not specified, then a "
5477 "subsequent B<splice>(2)  B<SPLICE_F_MOVE> must copy the pages.  Data must "
5478 "also be properly page aligned, both in memory and length."
5479 msgstr ""
5480
5481 #. type: Plain text
5482 #: build/C/man2/vmsplice.2:122
5483 msgid ""
5484 "Upon successful completion, B<vmsplice>()  returns the number of bytes "
5485 "transferred to the pipe.  On error, B<vmsplice>()  returns -1 and I<errno> "
5486 "is set to indicate the error."
5487 msgstr ""
5488
5489 #. type: Plain text
5490 #: build/C/man2/vmsplice.2:127
5491 msgid "I<fd> either not valid, or doesn't refer to a pipe."
5492 msgstr ""
5493
5494 #. type: Plain text
5495 #: build/C/man2/vmsplice.2:135
5496 msgid ""
5497 "I<nr_segs> is 0 or greater than B<IOV_MAX>; or memory not aligned if "
5498 "B<SPLICE_F_GIFT> set."
5499 msgstr ""
5500
5501 #. type: Plain text
5502 #: build/C/man2/vmsplice.2:142
5503 msgid "The B<vmsplice>()  system call first appeared in Linux 2.6.17."
5504 msgstr ""
5505
5506 #. type: Plain text
5507 #: build/C/man2/vmsplice.2:153
5508 msgid ""
5509 "B<vmsplice>()  follows the other vectorized read/write type functions when "
5510 "it comes to limitations on number of segments being passed in.  This limit "
5511 "is B<IOV_MAX> as defined in I<E<lt>limits.hE<gt>>.  At the time of this "
5512 "writing, that limit is 1024."
5513 msgstr ""
5514
5515 #. type: Plain text
5516 #: build/C/man2/vmsplice.2:156
5517 msgid "B<splice>(2), B<tee>(2)"
5518 msgstr ""