| @@ -1,17 +1,17 @@ | | | @@ -1,17 +1,17 @@ |
1 | .\" $NetBSD: ptrace.2,v 1.56 2017/01/15 22:18:11 kamil Exp $ | | 1 | .\" $NetBSD: ptrace.2,v 1.57 2017/01/25 17:12:56 kamil Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" This file is in the public domain. | | 3 | .\" This file is in the public domain. |
4 | .Dd January 14, 2016 | | 4 | .Dd January 25, 2016 |
5 | .Dt PTRACE 2 | | 5 | .Dt PTRACE 2 |
6 | .Os | | 6 | .Os |
7 | .Sh NAME | | 7 | .Sh NAME |
8 | .Nm ptrace | | 8 | .Nm ptrace |
9 | .Nd process tracing and debugging | | 9 | .Nd process tracing and debugging |
10 | .Sh LIBRARY | | 10 | .Sh LIBRARY |
11 | .Lb libc | | 11 | .Lb libc |
12 | .Sh SYNOPSIS | | 12 | .Sh SYNOPSIS |
13 | .In sys/types.h | | 13 | .In sys/types.h |
14 | .In sys/ptrace.h | | 14 | .In sys/ptrace.h |
15 | .Ft int | | 15 | .Ft int |
16 | .Fn ptrace "int request" "pid_t pid" "void *addr" "int data" | | 16 | .Fn ptrace "int request" "pid_t pid" "void *addr" "int data" |
17 | .Sh DESCRIPTION | | 17 | .Sh DESCRIPTION |
| @@ -275,29 +275,36 @@ field specifies which type of I/O operat | | | @@ -275,29 +275,36 @@ field specifies which type of I/O operat |
275 | Possible values are: | | 275 | Possible values are: |
276 | .Pp | | 276 | .Pp |
277 | .Bl -tag -width 18n -offset indent -compact | | 277 | .Bl -tag -width 18n -offset indent -compact |
278 | .It Dv PIOD_READ_D | | 278 | .It Dv PIOD_READ_D |
279 | .It Dv PIOD_WRITE_D | | 279 | .It Dv PIOD_WRITE_D |
280 | .It Dv PIOD_READ_I | | 280 | .It Dv PIOD_READ_I |
281 | .It Dv PIOD_WRITE_I | | 281 | .It Dv PIOD_WRITE_I |
282 | .It Dv PIOD_READ_AUXV | | 282 | .It Dv PIOD_READ_AUXV |
283 | .El | | 283 | .El |
284 | .Pp | | 284 | .Pp |
285 | See the description of | | 285 | See the description of |
286 | .Dv PT_READ_I | | 286 | .Dv PT_READ_I |
287 | for the difference between I and D spaces. | | 287 | for the difference between I and D spaces. |
| | | 288 | .Pp |
288 | The | | 289 | The |
289 | .Dv PIOD_READ_AUXV | | 290 | .Dv PIOD_READ_AUXV |
290 | operation can be used to read from the ELF auxiliary vector. | | 291 | operation can be used to read from the ELF auxiliary vector. |
| | | 292 | The |
| | | 293 | .Fa piod_offs |
| | | 294 | argument sets offset withing the tracee's vector. |
| | | 295 | To read from the beginning of it, this value must be set to 0 and casted to |
| | | 296 | .Dv (void *) . |
| | | 297 | .Pp |
291 | A pointer to the I/O descriptor is passed in the | | 298 | A pointer to the I/O descriptor is passed in the |
292 | .Fa addr | | 299 | .Fa addr |
293 | argument to | | 300 | argument to |
294 | .Fn ptrace . | | 301 | .Fn ptrace . |
295 | On return, the | | 302 | On return, the |
296 | .Fa piod_len | | 303 | .Fa piod_len |
297 | field in the I/O descriptor will be updated with the actual number of | | 304 | field in the I/O descriptor will be updated with the actual number of |
298 | bytes transferred. | | 305 | bytes transferred. |
299 | If the requested I/O could not be successfully performed, | | 306 | If the requested I/O could not be successfully performed, |
300 | .Fn ptrace | | 307 | .Fn ptrace |
301 | will return | | 308 | will return |
302 | .Li \-1 | | 309 | .Li \-1 |
303 | and set | | 310 | and set |