OSDN Git Service

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