Wed Jan 25 17:12:56 2017 UTC ()
Make the PIOD_READ_AUXV operation more clear

Describe how to set piod_offs.

Sponsored by <The NetBSD Foundation>


(kamil)
diff -r1.56 -r1.57 src/lib/libc/sys/ptrace.2

cvs diff -r1.56 -r1.57 src/lib/libc/sys/ptrace.2 (expand / switch to unified diff)

--- src/lib/libc/sys/ptrace.2 2017/01/15 22:18:11 1.56
+++ src/lib/libc/sys/ptrace.2 2017/01/25 17:12:56 1.57
@@ -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
275Possible values are: 275Possible 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
285See the description of 285See the description of
286.Dv PT_READ_I 286.Dv PT_READ_I
287for the difference between I and D spaces. 287for the difference between I and D spaces.
 288.Pp
288The 289The
289.Dv PIOD_READ_AUXV 290.Dv PIOD_READ_AUXV
290operation can be used to read from the ELF auxiliary vector. 291operation can be used to read from the ELF auxiliary vector.
 292The
 293.Fa piod_offs
 294argument sets offset withing the tracee's vector.
 295To read from the beginning of it, this value must be set to 0 and casted to
 296.Dv (void *) .
 297.Pp
291A pointer to the I/O descriptor is passed in the 298A pointer to the I/O descriptor is passed in the
292.Fa addr 299.Fa addr
293argument to 300argument to
294.Fn ptrace . 301.Fn ptrace .
295On return, the 302On return, the
296.Fa piod_len 303.Fa piod_len
297field in the I/O descriptor will be updated with the actual number of 304field in the I/O descriptor will be updated with the actual number of
298bytes transferred. 305bytes transferred.
299If the requested I/O could not be successfully performed, 306If the requested I/O could not be successfully performed,
300.Fn ptrace 307.Fn ptrace
301will return 308will return
302.Li \-1 309.Li \-1
303and set 310and set