From owner-freebsd-current@FreeBSD.ORG Mon Jul 11 17:24:18 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 167C61065670; Mon, 11 Jul 2011 17:24:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 0DA7A8FC0C; Mon, 11 Jul 2011 17:24:16 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p6BHO8Mr006955 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 11 Jul 2011 20:24:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p6BHO8pA054637; Mon, 11 Jul 2011 20:24:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p6BHO8wJ054636; Mon, 11 Jul 2011 20:24:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 11 Jul 2011 20:24:08 +0300 From: Kostik Belousov To: Petr Salinger Message-ID: <20110711172408.GX43872@deviant.kiev.zoral.com.ua> References: <20110711123332.GS43872@deviant.kiev.zoral.com.ua> <20110711133342.GT43872@deviant.kiev.zoral.com.ua> <20110711142232.GU43872@deviant.kiev.zoral.com.ua> <20110711150614.GV43872@deviant.kiev.zoral.com.ua> <20110711154102.GW43872@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TOkWJigZa0YodlBE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Robert Millan , current@freebsd.org Subject: Re: [PATCH] Improve LinuxThreads compatibility in rfork() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2011 17:24:18 -0000 --TOkWJigZa0YodlBE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 11, 2011 at 06:12:15PM +0200, Petr Salinger wrote: > >I would instead use a new flag to specify a signal sent on the child > >death. Like RFTSIGZMB. If flag is not set, SIGCHLD is used. If it is > >set, the bit slice is used as signal number, 0 means do not send any > >signal. > > > >Please note that the signal should be checked for validity, it must be > ><=3D _SIG_MAXSIG). >=20 > We used this: >=20 > #define RFTHPNSHIFT 24 /* reserve bits 24-30 */ > #define RFTHPNMASK 0x7F /* for compatibility with=20 > linuxthreads/clone() */ > /* allow to specify "clone exit parent=20 > notification" signal */ > #define RFTHPNSIGNUM(flags) (((flags) >> RFTHPNSHIFT) & RFTHPNMASK) >=20 > Therefore signal #128 (_SIG_MAXSIG) cannot be selected. >=20 > Should the bit slice be 7 or 8 bits ? I propose to go 8 bits, and add the check to be future-proof. It seems that we already parse GNU/kFreeBSD brandnote. I think this could be used to distinguish between old behaviour, that is currently used by your libc, and proposed new interface, if __FreeBSD_version is bumped and honored by glibc. You might need to store the brandinfo somewhere in struct proc or use the separate struct sysentvec. --TOkWJigZa0YodlBE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk4bMbgACgkQC3+MBN1Mb4gEcACfdj7xc3GIUFHXKmc7JIeohaMR zcMAn2rCwH7+ioEK42bpY+4iDFftWu2j =bNtr -----END PGP SIGNATURE----- --TOkWJigZa0YodlBE--