Index: sys/amd64/linux/linux_ptrace.c =================================================================== --- sys/amd64/linux/linux_ptrace.c +++ sys/amd64/linux/linux_ptrace.c @@ -71,6 +71,7 @@ #define LINUX_PTRACE_GETSIGINFO 0x4202 #define LINUX_PTRACE_GETREGSET 0x4204 #define LINUX_PTRACE_SEIZE 0x4206 +#define LINUX_PTRACE_GET_SYSCALL_INFO 0x420e #define LINUX_PTRACE_EVENT_EXIT 6 @@ -557,6 +558,14 @@ return (EINVAL); } +static int +linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) +{ + + linux_msg(td, "PTRACE_GET_SYSCALL_INFO not implemented; returning EINVAL"); + return (EINVAL); +} + int linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) { @@ -641,6 +650,9 @@ break; case LINUX_PTRACE_SEIZE: error = linux_ptrace_seize(td, pid, uap->addr, uap->data); + break; + case LINUX_PTRACE_GET_SYSCALL_INFO: + error = linux_ptrace_get_syscall_info(td, pid, uap->addr, uap->data); break; default: linux_msg(td, "ptrace(%ld, ...) not implemented; " Index: sys/amd64/linux/linux_sysvec.c =================================================================== --- sys/amd64/linux/linux_sysvec.c +++ sys/amd64/linux/linux_sysvec.c @@ -207,6 +207,7 @@ linux_set_syscall_retval(struct thread *td, int error) { struct trapframe *frame = td->td_frame; + u_int code; /* * On Linux only %rcx and %r11 values are not preserved across @@ -216,6 +217,9 @@ if (error != EJUSTRETURN) frame->tf_r10 = frame->tf_rcx; + code = td->td_sa.code; + if (error == ERESTART) + printf("%s: syscall %d -> ERESTART\n", __func__, code); cpu_set_syscall_retval(td, error); if (__predict_false(error != 0)) { @@ -673,6 +677,7 @@ } regs->tf_rsp = (long)sfp; + // tukej regs->tf_rip = linux_rt_sigcode; regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel;