summaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2017-01-07 03:41:25 +0000
committerkamil <kamil@NetBSD.org>2017-01-07 03:41:25 +0000
commitccd950e0dd617b88fef412643db3d40656fee5c8 (patch)
tree711ca84e884eddc99a347a1b1e8cda92912c0767 /lib/libc/sys
parent0bbe28ba0f4a6d46fa93af004ee17e51e2730a21 (diff)
Document PT_SET_SIGINFO and PT_GET_SIGINFO in ptrace(2)
PT_SET_SIGINFO - fake signal information emitted to tracee PT_GET_SIGINFO - read signal information routed to tracee Sponsored by <The NetBSD Foundation>
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/ptrace.253
1 files changed, 52 insertions, 1 deletions
diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2
index c012df1f2f5..b8e27085059 100644
--- a/lib/libc/sys/ptrace.2
+++ b/lib/libc/sys/ptrace.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: ptrace.2,v 1.48 2017/01/07 01:32:35 kamil Exp $
+.\" $NetBSD: ptrace.2,v 1.49 2017/01/07 03:41:25 kamil Exp $
.\"
.\" This file is in the public domain.
.Dd January 7, 2016
@@ -329,6 +329,57 @@ The
.Fa data
argument should be set to
.Li sizeof(struct ptrace_state) .
+.It Dv PT_SET_SIGINFO
+This request can be used to specify signal information emitted to tracee.
+This signal information is specified in
+.Dq Li "struct ptrace_siginfo"
+defined as:
+.Bd -literal -offset indentq
+typedef struct ptrace_siginfo {
+ siginfo_t psi_siginfo;
+ lwpid_t psi_lwpid;
+} ptrace_siginfo_t;
+.Ed
+.Pp
+Where
+.Fa psi_siginfo
+is the set to signal information structure.
+The
+.Fa psi_lwpid
+field describes LWP address of the signal.
+Value
+.Dv 0
+means the whole process
+(route signal to all LWPs).
+.Pp
+A pointer to this structure is passed in
+.Fa addr .
+The
+.Fa data
+argument should be set to
+.Li sizeof(struct ptrace_siginfo) .
+.Pp
+In order to pass faked signal to the tracee,
+the siginal type must match the signal passed to process with
+.Dv PT_CONTINUE ,
+.Dv PT_DETACH
+or
+.Dv PT_STEP .
+.It Dv PT_GET_SIGINFO
+This request can be used to determine signal information that was received by
+a debugger
+.Po
+see
+.Xr siginfo 2
+.Pc .
+The information is read into the
+.Dq Li struct ptrace_siginfo
+pointed to by
+.Fa addr .
+The
+.Fa data
+argument should be set to
+.Li sizeof(struct ptrace_siginfo) .
.El
.Pp
Additionally, the following requests exist but are