]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
ptrace.2: Describe the PTRACE_GET_SYSCALL_INFO 'op' value in more detail
authorMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 12 Sep 2019 08:30:57 +0000 (10:30 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 12 Sep 2019 08:49:56 +0000 (10:49 +0200)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/ptrace.2

index 4d9a9c67e61d6b2d97b0c49951404985f3cd87a9..d84e07d6871d8b1e5694e7a73f5ca9131abd259a 100644 (file)
@@ -1034,33 +1034,26 @@ structure contains the following fields:
 .in +4n
 .EX
 struct ptrace_syscall_info {
-    __u8 op;                /* PTRACE_SYSCALL_INFO_* value
-                               describing the kind
-                               of system call stop,
-                               see <linux/ptrace.h> */
-    __u32 arch;             /* AUDIT_ARCH_* value,
-                               see seccomp(2) */
-    __u64 instruction_pointer;  /* CPU instruction pointer */
+    __u8 op;        /* Type of system call stop */
+    __u32 arch;     /* AUDIT_ARCH_* value; see seccomp(2) */
+    __u64 instruction_pointer; /* CPU instruction pointer */
     __u64 stack_pointer;    /* CPU stack pointer */
     union {
-        struct {
+        struct {    /* op == PTRACE_SYSCALL_INFO_ENTRY */
             __u64 nr;       /* System call number */
             __u64 args[6];  /* System call arguments */
-        } entry;            /* Information specific to
-                               system call entry stops */
-        struct {
+        } entry;
+        struct {    /* op == PTRACE_SYSCALL_INFO_EXIT */
             __s64 rval;     /* System call return value */
             __u8 is_error;  /* System call error flag */
-        } exit;             /* Information specific to
-                               system call exit stops */
-        struct {
+        } exit;
+        struct {    /* op == PTRACE_SYSCALL_INFO_SECCOMP */
             __u64 nr;       /* System call number */
             __u64 args[6];  /* System call arguments */
-            __u32 ret_data; /* The SECCOMP_RET_DATA portion
+            __u32 ret_data; /* SECCOMP_RET_DATA portion
                                of SECCOMP_RET_TRACE return
                                value */
-        } seccomp;          /* Information specific to
-                               PTRACE_EVENT_SECCOMP stops */
+        } seccomp;
     };
 };
 .EE
@@ -1077,6 +1070,37 @@ The rest of the structure is a union; one should read only those fields
 that are meaningful for the kind of system call stop specified by the
 .IR op
 field.
+.IP
+The
+.I op
+field has one of the following values (defined in
+.IR <linux/ptrace.h>)
+indicating what type of stop occurred and
+which part of the union is filled:
+.RS
+.TP
+.BR PTRACE_SYSCALL_INFO_ENTRY
+The
+.I entry
+component of the union contains information relating to a
+system call entry stop.
+.TP
+.BR PTRACE_SYSCALL_INFO_EXIT
+The
+.I exit
+component of the union contains information relating to a
+system call exit stop.
+.TP
+.BR PTRACE_SYSCALL_INFO_SECCOMP
+The
+.I exit
+component of the union contains information relating to a
+.B PTRACE_EVENT_SECCOMP
+stop.
+.TP
+.BR PTRACE_SYSCALL_INFO_NONE
+No component of the union contains relevant information.
+.RE
 .\"
 .SS Death under ptrace
 When a (possibly multithreaded) process receives a killing signal