From owner-freebsd-arch@FreeBSD.ORG Thu Mar 15 09:34:33 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AF56106566C for ; Thu, 15 Mar 2012 09:34:33 +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 E85978FC15 for ; Thu, 15 Mar 2012 09:34:32 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q2F9XOEO002782; Thu, 15 Mar 2012 11:33:24 +0200 (EET) (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.5/8.14.5) with ESMTP id q2F9XNVN072812; Thu, 15 Mar 2012 11:33:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q2F9XNcM072811; Thu, 15 Mar 2012 11:33:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 15 Mar 2012 11:33:23 +0200 From: Konstantin Belousov To: Ed Schouten Message-ID: <20120315093323.GL75778@deviant.kiev.zoral.com.ua> References: <20120314234348.GL27469@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Xu/gmhi9npES5AGc" Content-Disposition: inline In-Reply-To: <20120314234348.GL27469@hoeg.nl> 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=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: arch@freebsd.org Subject: Re: kill(2) man page: ESRCH X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 09:34:33 -0000 --Xu/gmhi9npES5AGc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 15, 2012 at 12:43:48AM +0100, Ed Schouten wrote: > Hi all, >=20 > Just a quick question. The kill(2) man page says: >=20 > The kill() system call will fail and no signal will be sent if: >=20 > [ESRCH] The process id was given as 0 but the sending pro= cess > does not have a process group. >=20 > My question is: is this possible? I thought all processes have a process > group. POSIX also doesn't mention anything about this case specifically. > Shall I zap this? I think this is a bad wording in the man page, up to the point of error. If the kill pid argument is negative, and corresponding process group cannot be found, then ERSCH is returned, look at the killpg1(9) implementation. The case of pgrp =3D=3D 0 indeed cannot result in ESRCH. The later loop over pg_members shall find at least the sender itself, if pgrp =3D=3D 0. --Xu/gmhi9npES5AGc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9ht2MACgkQC3+MBN1Mb4iGuwCfQTq2tRKHcpBVhQwcJNKxbimV B2sAoM0aU2Ux6Yi1mBw1P/dM9Wg/fAU3 =jiX0 -----END PGP SIGNATURE----- --Xu/gmhi9npES5AGc--