Index: sys/compat/linux/linux_mib.h =================================================================== --- sys/compat/linux/linux_mib.h +++ sys/compat/linux/linux_mib.h @@ -67,5 +67,6 @@ extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; extern bool linux_map_sched_prio; +extern bool linux_ignore_erestart; #endif /* _LINUX_MIB_H_ */ Index: sys/compat/linux/linux_mib.c =================================================================== --- sys/compat/linux/linux_mib.c +++ sys/compat/linux/linux_mib.c @@ -85,6 +85,11 @@ &linux_map_sched_prio, 0, "Map scheduler priorities to Linux priorities " "(not POSIX compliant)"); +bool linux_ignore_erestart = false; +SYSCTL_BOOL(_compat_linux, OID_AUTO, ignore_erestart, CTLFLAG_RWTUN, + &linux_ignore_erestart, 0, + "Disable Linux-specific signal restart semantics adjustments"); + static int linux_set_osname(struct thread *td, char *osname); static int linux_set_osrelease(struct thread *td, char *osrelease); static int linux_set_oss_version(struct thread *td, int oss_version); Index: sys/compat/linux/linux_misc.c =================================================================== --- sys/compat/linux/linux_misc.c +++ sys/compat/linux/linux_misc.c @@ -532,6 +532,7 @@ error = kern_select(td, args->nfds, args->readfds, args->writefds, args->exceptfds, tvp, LINUX_NFDBITS); + error = linux_erestart2eintr(td, error); if (error) goto select_out; @@ -2198,6 +2199,7 @@ error = kern_pselect(td, args->nfds, args->readfds, args->writefds, args->exceptfds, tvp, ssp, LINUX_NFDBITS); + error = linux_erestart2eintr(td, error); if (error == 0 && args->tsp != NULL) { if (td->td_retval[0] != 0) { @@ -2261,6 +2263,7 @@ tsp = NULL; error = kern_poll(td, args->fds, args->nfds, tsp, ssp); + error = linux_erestart2eintr(td, error); if (error == 0 && args->tsp != NULL) { if (td->td_retval[0]) { Index: sys/compat/linux/linux_signal.c =================================================================== --- sys/compat/linux/linux_signal.c +++ sys/compat/linux/linux_signal.c @@ -432,6 +432,7 @@ tsa = &ts; } error = kern_sigtimedwait(td, bset, &info, tsa); + error = linux_erestart2eintr(td, error); if (error) return (error); Index: sys/compat/linux/linux_util.h =================================================================== --- sys/compat/linux/linux_util.h +++ sys/compat/linux/linux_util.h @@ -122,6 +122,7 @@ int linux_driver_get_major_minor(const char *node, int *major, int *minor); char *linux_get_char_devices(void); void linux_free_get_char_devices(char *string); +int linux_erestart2eintr(struct thread *td, int error); #if defined(KTR) Index: sys/compat/linux/linux_util.c =================================================================== --- sys/compat/linux/linux_util.c +++ sys/compat/linux/linux_util.c @@ -280,3 +280,11 @@ return (EINVAL); } + +int +linux_erestart2eintr(struct thread *td, int error) +{ + if (error == ERESTART && !linux_ignore_erestart) + return (EINTR); + return (error); +}