Skip to content

Commit

Permalink
ptrace: renumber PTRACE_EVENT_STOP so that future new options and eve…
Browse files Browse the repository at this point in the history
…nts 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>
  • Loading branch information
Denys Vlasenko authored and Linus Torvalds committed Mar 23, 2012
1 parent aa9147c commit 5cdf389
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
#define PTRACE_EVENT_EXEC 4
#define PTRACE_EVENT_VFORK_DONE 5
#define PTRACE_EVENT_EXIT 6
#define PTRACE_EVENT_STOP 7
/* Extended result codes which enabled by means other than options. */
#define PTRACE_EVENT_STOP 128

/* options set using PTRACE_SETOPTIONS */
#define PTRACE_O_TRACESYSGOOD 1
Expand Down

0 comments on commit 5cdf389

Please sign in to comment.