From 77c3cd3d303099ad2d819725741f948ad5ff37d8 Mon Sep 17 00:00:00 2001 From: marcel Date: Fri, 15 Aug 2003 05:25:06 +0000 Subject: Add or finish support for machine dependent ptrace requests. When we check for permissions, do it for all requests, not the known requests. Later when we actually service the request we deal with the invalid requests we previously caught earlier. This commit changes the behaviour of the ptrace(2) interface for boundary cases such as an unknown request without proper permissions. Previously we would return EINVAL. Now we return EBUSY or EPERM. Platforms need to define __HAVE_PTRACE_MACHDEP when they have MD requests. This makes the prototype of cpu_ptrace() visible and introduces a call to this function for all requests greater or equal to PT_FIRSTMACH. Silence on: audit --- sys/sys/ptrace.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/sys/ptrace.h') diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 09d8742..ef7262a 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -81,6 +81,10 @@ struct ptrace_io_desc { int ptrace_set_pc(struct thread *_td, unsigned long _addr); int ptrace_single_step(struct thread *_td); +#ifdef __HAVE_PTRACE_MACHDEP +int cpu_ptrace(struct thread *_td, int _req, void *_addr, int _data); +#endif + /* * These are prototypes for functions that implement some of the * debugging functionality exported by procfs / linprocfs and by the -- cgit v1.1