diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -639,6 +640,9 @@ * the ptracing process fall back to another method. */ si.op = LINUX_PTRACE_SYSCALL_INFO_NONE; + } else if (sr.sr_error == ERESTART) { + si.exit.rval = -LINUX_ERESTARTSYS; + si.exit.is_error = 1; } else { si.exit.rval = bsd_to_linux_errno(sr.sr_error); si.exit.is_error = 1; diff --git a/sys/compat/linux/linux_errno.h b/sys/compat/linux/linux_errno.h --- a/sys/compat/linux/linux_errno.h +++ b/sys/compat/linux/linux_errno.h @@ -182,4 +182,10 @@ #define LINUX_ELAST LINUX_EHWPOISON +/* + * This is a special "internal" errno that must never be returned + * to a Linux process, but might be observed via ptrace(2). + */ +#define LINUX_ERESTARTSYS 512 + #endif /* _LINUX_ERRNO_H_ */