summaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/process.c')
-rw-r--r--arch/um/os-Linux/process.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index 7f5e2dac2a35..d261888f39c4 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -19,6 +19,7 @@
#include "irq_user.h"
#include "kern_util.h"
#include "longjmp.h"
+#include "skas_ptrace.h"
#define ARBITRARY_ADDR -1
#define FAILURE_PID -1
@@ -100,6 +101,21 @@ void os_kill_process(int pid, int reap_child)
}
+/* This is here uniquely to have access to the userspace errno, i.e. the one
+ * used by ptrace in case of error.
+ */
+
+long os_ptrace_ldt(long pid, long addr, long data)
+{
+ int ret;
+
+ ret = ptrace(PTRACE_LDT, pid, addr, data);
+
+ if (ret < 0)
+ return -errno;
+ return ret;
+}
+
/* Kill off a ptraced child by all means available. kill it normally first,
* then PTRACE_KILL it, then PTRACE_CONT it in case it's in a run state from
* which it can't exit directly.