Skip to content

Commit 5cdf389

Browse files
Denys Vlasenkotorvalds
authored andcommitted
ptrace: renumber PTRACE_EVENT_STOP so that future new options and events can match
PTRACE_EVENT_foo and PTRACE_O_TRACEfoo used to match. New PTRACE_EVENT_STOP is the first event which has no corresponding PTRACE_O_TRACE option. If we will ever want to add another such option, its PTRACE_EVENT's value will collide with PTRACE_EVENT_STOP's value. This patch changes PTRACE_EVENT_STOP value to prevent this. While at it, added a comment - the one atop PTRACE_EVENT block, saying "Wait extended result codes for the above trace options", is not true for PTRACE_EVENT_STOP. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Cc: Tejun Heo <tj@kernel.org> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Cc: Pedro Alves <palves@redhat.com> Cc: Jan Kratochvil <jan.kratochvil@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent aa9147c commit 5cdf389

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/linux/ptrace.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
#define PTRACE_EVENT_EXEC 4
6262
#define PTRACE_EVENT_VFORK_DONE 5
6363
#define PTRACE_EVENT_EXIT 6
64-
#define PTRACE_EVENT_STOP 7
64+
/* Extended result codes which enabled by means other than options. */
65+
#define PTRACE_EVENT_STOP 128
6566

6667
/* options set using PTRACE_SETOPTIONS */
6768
#define PTRACE_O_TRACESYSGOOD 1

0 commit comments

Comments
 (0)