From owner-svn-src-stable@FreeBSD.ORG Mon Oct 10 12:07:05 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35D96106566B; Mon, 10 Oct 2011 12:07:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C72B58FC19; Mon, 10 Oct 2011 12:07:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9AC74Vo059247; Mon, 10 Oct 2011 12:07:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9AC74WW059244; Mon, 10 Oct 2011 12:07:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110101207.p9AC74WW059244@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 Oct 2011 12:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226199 - in stable/9/sys: kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2011 12:07:05 -0000 Author: kib Date: Mon Oct 10 12:07:04 2011 New Revision: 226199 URL: http://svn.freebsd.org/changeset/base/226199 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. Approved by: re (bz) Modified: stable/9/sys/kern/kern_sig.c stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/kern_sig.c ============================================================================== --- stable/9/sys/kern/kern_sig.c Mon Oct 10 12:06:36 2011 (r226198) +++ stable/9/sys/kern/kern_sig.c Mon Oct 10 12:07:04 2011 (r226199) @@ -1094,6 +1094,8 @@ sys_sigwait(struct thread *td, struct si 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/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Mon Oct 10 12:06:36 2011 (r226198) +++ stable/9/sys/sys/param.h Mon Oct 10 12:07:04 2011 (r226199) @@ -61,6 +61,7 @@ #define __FreeBSD_version 900044 /* Master, propagated to newvers */ #ifdef _KERNEL +#define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 #endif