public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: Elvira Khabirova <lineprinter@altlinux.org>, linux-man@vger.kernel.org
Subject: [PATCH] ptrace.2: document struct ptrace_syscall_info
Date: Wed, 11 Sep 2019 20:38:08 +0300	[thread overview]
Message-ID: <20190911173807.GA25385@altlinux.org> (raw)
In-Reply-To: <0eb09cbc-8035-ee82-9c75-6525d91e7138@gmail.com>

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 man2/ptrace.2 | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)

diff --git a/man2/ptrace.2 b/man2/ptrace.2
index ff897bb19..b030247e6 100644
--- a/man2/ptrace.2
+++ b/man2/ptrace.2
@@ -1026,7 +1026,56 @@ If the size of the data to be written by the kernel exceeds the size
 specified by the
 .I addr
 argument, the output data is truncated.
-.\" FIXME Document 'struct ptrace_syscall_info'
+.IP
+The
+.I ptrace_syscall_info
+structure contains the following fields:
+.IP
+.in
+.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 */
+    __u64 stack_pointer;        /* CPU stack pointer */
+    union {
+        struct {
+            __u64 nr;           /* System call number */
+            __u64 args[6];      /* System call arguments */
+        } entry;                /* Information specific to
+                                   system call entry stops */
+        struct {
+            __s64 rval;         /* System call return value */
+            __u8 is_error;      /* System call error flag */
+        } exit;                 /* Information specific to
+                                   system call exit stops */
+        struct {
+            __u64 nr;           /* System call number */
+            __u64 args[6];      /* System call arguments */
+            __u32 ret_data;     /* The SECCOMP_RET_DATA portion
+                                   of SECCOMP_RET_TRACE return
+                                   value */
+        } seccomp;              /* Information specific to
+                                   PTRACE_EVENT_SECCOMP stops */
+    };
+};
+.EE
+.in
+.IP
+.IR op ,
+.IR arch ,
+.IR instruction_pointer ,
+and
+.I stack_pointer
+fields are defined for all kinds of ptrace system call stops.
+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.
 .\"
 .SS Death under ptrace
 When a (possibly multithreaded) process receives a killing signal
-- 
ldv

  reply	other threads:[~2019-09-11 17:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02 12:38 [PATCH] ptrace.2: document PTRACE_GET_SYSCALL_INFO Dmitry V. Levin
2019-09-10 10:51 ` Michael Kerrisk (man-pages)
2019-09-11 17:38   ` Dmitry V. Levin [this message]
2019-09-12  9:17     ` [PATCH] ptrace.2: document struct ptrace_syscall_info Michael Kerrisk (man-pages)
2019-09-13 15:40       ` Dmitry V. Levin
2019-09-13 18:48         ` Michael Kerrisk (man-pages)
2019-09-13 19:37           ` Dmitry V. Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190911173807.GA25385@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=lineprinter@altlinux.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox