From patchwork Tue Feb 7 08:06:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kir Kolyshkin X-Patchwork-Id: 19136 Received: (qmail 649 invoked by alias); 7 Feb 2017 08:06:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 631 invoked by uid 89); 7 Feb 2017 08:06:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Extended, Hx-languages-length:6946, H*r:Unknown, Mozilla X-HELO: sacred.ru From: Kir Kolyshkin To: libc-alpha@sourceware.org Cc: Kir Kolyshkin Subject: [PATCH] Add Linux PTRACE_EVENT_STOP Date: Tue, 7 Feb 2017 00:06:05 -0800 Message-Id: <20170207080605.563-1-kir@openvz.org> Add PTRACE_EVENT_STOP value to Linux's sys/ptrace.h, modify related comments accordingly. This constant initially appeared in Linux 3.1 (kernel commit 3544d72a, "ptrace: implement PTRACE_SEIZE") but its value has changed later in Linux 3.4 (kernel commit 5cdf389a, "ptrace: renumber PTRACE_EVENT_STOP so that future new options and events can match"). The comment is also taken from the above commit. This constant is used by e.g. strace, CRIU, Mozilla RR. 2017-02-06 Kir Kolyshkin * sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h: Add PTRACE_EVENT_STOP. * sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/s390/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/tile/sys/ptrace.h: Likewise. --- sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h | 6 ++++-- sysdeps/unix/sysv/linux/ia64/sys/ptrace.h | 6 ++++-- sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h | 6 ++++-- sysdeps/unix/sysv/linux/s390/sys/ptrace.h | 6 ++++-- sysdeps/unix/sysv/linux/sparc/sys/ptrace.h | 6 ++++-- sysdeps/unix/sysv/linux/sys/ptrace.h | 6 ++++-- sysdeps/unix/sysv/linux/tile/sys/ptrace.h | 6 ++++-- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h index 922346c..c8ca9e3 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h @@ -163,16 +163,18 @@ enum __ptrace_setoptions PTRACE_O_MASK = 0x003000ff }; -/* Wait extended result codes for the above trace options. */ enum __ptrace_eventcodes { +/* Wait extended result codes for the above trace options. */ PTRACE_EVENT_FORK = 1, PTRACE_EVENT_VFORK = 2, PTRACE_EVENT_CLONE = 3, PTRACE_EVENT_EXEC = 4, PTRACE_EVENT_VFORK_DONE = 5, PTRACE_EVENT_EXIT = 6, - PTRACE_EVENT_SECCOMP = 7 + PTRACE_EVENT_SECCOMP = 7, +/* Extended result codes enabled by means other than options. */ + PTRACE_EVENT_STOP = 128 }; /* Arguments for PTRACE_PEEKSIGINFO. */ diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h index 47f1aad..c77e6dc 100644 --- a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h @@ -183,16 +183,18 @@ enum __ptrace_setoptions PTRACE_O_MASK = 0x003000ff }; -/* Wait extended result codes for the above trace options. */ enum __ptrace_eventcodes { +/* Wait extended result codes for the above trace options. */ PTRACE_EVENT_FORK = 1, PTRACE_EVENT_VFORK = 2, PTRACE_EVENT_CLONE = 3, PTRACE_EVENT_EXEC = 4, PTRACE_EVENT_VFORK_DONE = 5, PTRACE_EVENT_EXIT = 6, - PTRACE_EVENT_SECCOMP = 7 + PTRACE_EVENT_SECCOMP = 7, +/* Extended result codes enabled by means other than options. */ + PTRACE_EVENT_STOP = 128 }; /* Arguments for PTRACE_PEEKSIGINFO. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h index cf32fa3..ed1ed63 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h @@ -155,16 +155,18 @@ enum __ptrace_setoptions PTRACE_O_MASK = 0x003000ff }; -/* Wait extended result codes for the above trace options. */ enum __ptrace_eventcodes { +/* Wait extended result codes for the above trace options. */ PTRACE_EVENT_FORK = 1, PTRACE_EVENT_VFORK = 2, PTRACE_EVENT_CLONE = 3, PTRACE_EVENT_EXEC = 4, PTRACE_EVENT_VFORK_DONE = 5, PTRACE_EVENT_EXIT = 6, - PTRACE_EVENT_SECCOMP = 7 + PTRACE_EVENT_SECCOMP = 7, +/* Extended result codes enabled by means other than options. */ + PTRACE_EVENT_STOP = 128 }; /* Arguments for PTRACE_PEEKSIGINFO. */ diff --git a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h index 60e8cec..7caf101 100644 --- a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h @@ -194,16 +194,18 @@ enum __ptrace_setoptions PTRACE_O_MASK = 0x003000ff }; -/* Wait extended result codes for the above trace options. */ enum __ptrace_eventcodes { +/* Wait extended result codes for the above trace options. */ PTRACE_EVENT_FORK = 1, PTRACE_EVENT_VFORK = 2, PTRACE_EVENT_CLONE = 3, PTRACE_EVENT_EXEC = 4, PTRACE_EVENT_VFORK_DONE = 5, PTRACE_EVENT_EXIT = 6, - PTRACE_EVENT_SECCOMP = 7 + PTRACE_EVENT_SECCOMP = 7, +/* Extended result codes enabled by means other than options. */ + PTRACE_EVENT_STOP = 128 }; /* Arguments for PTRACE_PEEKSIGINFO. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h index 1c07f36..f605494 100644 --- a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h @@ -237,16 +237,18 @@ enum __ptrace_setoptions PTRACE_O_MASK = 0x003000ff }; -/* Wait extended result codes for the above trace options. */ enum __ptrace_eventcodes { +/* Wait extended result codes for the above trace options. */ PTRACE_EVENT_FORK = 1, PTRACE_EVENT_VFORK = 2, PTRACE_EVENT_CLONE = 3, PTRACE_EVENT_EXEC = 4, PTRACE_EVENT_VFORK_DONE = 5, PTRACE_EVENT_EXIT = 6, - PTRACE_EVENT_SECCOMP = 7 + PTRACE_EVENT_SECCOMP = 7, +/* Extended result codes enabled by means other than options. */ + PTRACE_EVENT_STOP = 128 }; /* Arguments for PTRACE_PEEKSIGINFO. */ diff --git a/sysdeps/unix/sysv/linux/sys/ptrace.h b/sysdeps/unix/sysv/linux/sys/ptrace.h index 6900eef..1daadd1 100644 --- a/sysdeps/unix/sysv/linux/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/sys/ptrace.h @@ -185,16 +185,18 @@ enum __ptrace_setoptions PTRACE_O_MASK = 0x003000ff }; -/* Wait extended result codes for the above trace options. */ enum __ptrace_eventcodes { +/* Wait extended result codes for the above trace options. */ PTRACE_EVENT_FORK = 1, PTRACE_EVENT_VFORK = 2, PTRACE_EVENT_CLONE = 3, PTRACE_EVENT_EXEC = 4, PTRACE_EVENT_VFORK_DONE = 5, PTRACE_EVENT_EXIT = 6, - PTRACE_EVENT_SECCOMP = 7 + PTRACE_EVENT_SECCOMP = 7, +/* Extended result codes enabled by means other than options. */ + PTRACE_EVENT_STOP = 128 }; /* Arguments for PTRACE_PEEKSIGINFO. */ diff --git a/sysdeps/unix/sysv/linux/tile/sys/ptrace.h b/sysdeps/unix/sysv/linux/tile/sys/ptrace.h index a710ee9..6287e42 100644 --- a/sysdeps/unix/sysv/linux/tile/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/tile/sys/ptrace.h @@ -152,16 +152,18 @@ enum __ptrace_setoptions PTRACE_O_MASK = 0x003000ff }; -/* Wait extended result codes for the above trace options. */ enum __ptrace_eventcodes { +/* Wait extended result codes for the above trace options. */ PTRACE_EVENT_FORK = 1, PTRACE_EVENT_VFORK = 2, PTRACE_EVENT_CLONE = 3, PTRACE_EVENT_EXEC = 4, PTRACE_EVENT_VFORK_DONE = 5, PTRACE_EVENT_EXIT = 6, - PTRACE_EVENT_SECCOMP = 7 + PTRACE_EVENT_SECCOMP = 7, +/* Extended result codes enabled by means other than options. */ + PTRACE_EVENT_STOP = 128 }; /* Arguments for PTRACE_PEEKSIGINFO. */