Date: Mon, 10 Oct 2011 13:03:14 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r226205 - in stable/8/sys: kern sys Message-ID: <201110101303.p9AD3E4H061325@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Oct 10 13:03:14 2011 New Revision: 226205 URL: http://svn.freebsd.org/changeset/base/226205 Log: MFC r225894: The sigwait(3) function shall not return EINTR, according to the POSIX/SUSvN. The sigwait(2) syscall does return EINTR, and libc.so.7 contains the wrapper sigwait(3) which hides EINTR from callers. The EINTR return is used by libthr to handle required cancellation point in the sigwait(3). To help the binaries linked against pre-libc.so.7, i.e. RELENG_6 and earlier, to have right ABI for sigwait(3), transform EINTR return from sigwait(2) into ERESTART. Modified: stable/8/sys/kern/kern_sig.c stable/8/sys/sys/param.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Mon Oct 10 12:30:16 2011 (r226204) +++ stable/8/sys/kern/kern_sig.c Mon Oct 10 13:03:14 2011 (r226205) @@ -1102,6 +1102,8 @@ sigwait(struct thread *td, struct sigwai error = kern_sigtimedwait(td, set, &ksi, NULL); if (error) { + if (error == EINTR && td->td_proc->p_osrel < P_OSREL_SIGWAIT) + error = ERESTART; if (error == ERESTART) return (error); td->td_retval[0] = error; Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Mon Oct 10 12:30:16 2011 (r226204) +++ stable/8/sys/sys/param.h Mon Oct 10 13:03:14 2011 (r226205) @@ -61,6 +61,7 @@ #define __FreeBSD_version 802512 /* Master, propagated to newvers */ #ifdef _KERNEL +#define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110101303.p9AD3E4H061325>