From owner-freebsd-hackers@freebsd.org Fri Mar 3 22:23:39 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD480CF7FF3 for ; Fri, 3 Mar 2017 22:23:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A5B41FE1 for ; Fri, 3 Mar 2017 22:23:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22b.google.com with SMTP id w189so37130980pfb.0 for ; Fri, 03 Mar 2017 14:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=95zFBnbnrt3Puv5KlnbJByxkWvRWDW9kQD5ge1jvwfM=; b=vC6KbNisDzsbXpdxQXCYmyB6YAhRhOJWd/FWtjutCKVcbizZmkkuUM/8OEZ4eg1//e FJI+WnSWxrQ60R9do79ZdNJSud7deKbMrEJm8i1BJGVGmDqIWaCjPXatA73PkW9PL3Vt i5vca/aISifloINLu2AxdSGig8nNYC0MymjLhBfWZicheWMgQOSXbKBCo3CGyz00dBAk hoB7SD3YANFzWBZme2D4UHD5jQWLr0PbPlCvbf5iOe1ynZqcMCFzUPKvJjyLDVjYGZJ+ ytzVghjUpoFLHyfLe8Oq3rQYEqpFxTlqqRHWg/aYEGa1JkRki6p8Kx+jzLy2+8HfxuOW mOTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=95zFBnbnrt3Puv5KlnbJByxkWvRWDW9kQD5ge1jvwfM=; b=GGCASmMB22TkfXxyP2LCP/05H1gjKo7Qj1qV0T9Fxt0lGyCaOvNdNASEeew7EbX2D+ hdlPTdRqo/F0qGnHGzMr6eBYw9MoqJlL1WBhMpG1QxBbc5t9hvzFQ+pvlffncmU8wJIo ecm8iS6FrDr3VqxGvL2iQrPH0m3PTyGQ37VvbGHtlvY9Y9us40G1s+h9NAauaeQd2dEl hc/QBQUUHlrAbf1y1Wp/3ggX1ZT173+KCLcZAvkjW2aEqjtw/GR62mUryjay1SFfRL3I AUYCGVVrdAuAxa7xTqLZKL4OxxxQCeye/i3pC/p2T/l7NC/swZud0v27znnMEwnFAMm8 JLoA== X-Gm-Message-State: AMke39lcsVj4UnQfRkL2bgNAtv6xjNcgxq8Q4W/Jr8oiL49+SBA5si4F9bsxGtO8j2ZUDw== X-Received: by 10.99.115.68 with SMTP id d4mr5747327pgn.146.1488579819170; Fri, 03 Mar 2017 14:23:39 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m12sm25416842pgc.46.2017.03.03.14.23.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Mar 2017 14:23:38 -0800 (PST) Subject: Re: kill -0 --- side effect or supported Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B6209A18-6EFA-43A5-9E7A-668EBE964B54"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <23F3BAC3-0D8B-4290-8DC2-818D67A0B6A9@webweaving.org> Date: Fri, 3 Mar 2017 14:23:37 -0800 Cc: freebsd-hackers@freebsd.org Message-Id: <11A4B6AB-E51D-4754-8E80-4503687E0F84@gmail.com> References: <23F3BAC3-0D8B-4290-8DC2-818D67A0B6A9@webweaving.org> To: Dirk-Willem van Gulik X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 22:23:39 -0000 --Apple-Mail=_B6209A18-6EFA-43A5-9E7A-668EBE964B54 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 3, 2017, at 14:12, Dirk-Willem van Gulik = wrote: >=20 > I regularly use 'kill -0 ' on FreeBSD as a way to test if a = certain process is still running (but without actually sending the = signal). And I think it has worked reliably since the mid 80's. >=20 > Is it actually a properly supported use - as I recently happened to = notice that it does not seem to be all that documented in kill( It better work. I have code that relies on it :)=E2=80=A6 It does work as you noted, according to truss: # sudo truss -ff kill -0 1 2>&1 ... 79940: kill(1,0) =3D 0 (0x0) =E2=80=A6 # As noted in kill(2), this is one of the valid values: a group of processes. The sig argument may be one of the signals specified in sigaction(2) or it may be 0, in which case error = checking is performed but no signal is actually sent. This can be used to = check the validity of pid. So, the manpage for kill(1) is just lacking in the sense that -0 is = supported. Cheers! -Ngie --Apple-Mail=_B6209A18-6EFA-43A5-9E7A-668EBE964B54 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYuezpAAoJEPWDqSZpMIYVy1QP/i03Kw+09Ofra9eOH/kjjFd8 IvSTEvV8AQDYRTpqSWFw+IX0zRKe7U6kh/eBJohRZz9s/V9oA2E7WVI7rpW20Coo F/ft3Pot+5svUcr55i0kX0qVzbo2Gx/Jyna0oU5t/jmNNhWCfew/oYAZtZI/2/+O vSancpX5oFHa6I934mFjb1a9e0w9iiTTFp29xEMmsKZbkU1vNC5pLZY5tQuyI64k x0zT4JhDSPIUL1Ab62AJJWCVdtB4ZUgCFu2BqftLFzl5NEnh5u0luFteKTqzsYZX VSp+teCs2CzXAdBdWiQUQtvp4bqja5TerUdq6CfMmt3Z4HyWQ7aW0M4mmkCLAWfn bGPNtdo+yqmE9apNZDVoPbU+H8jCcHhjeogdSBqDFPL4j4lRYC9QWfIEwb2DrYGw OTL6mRnbJYE6Gh9gRlREpyMRMCH+fk8YkKkmx6gYAY07FFwC/wATl8JU1i0FdSit yBh14HApI0GhUXnXyZWadPYKa/KvuUviMV5Ot/DNCxIa+Vx5qJ6agAQRtQBdPF9n kAw4qCInQyVfoyq3BbbZpZUOOnNLazdJzv9AqF8yKvDMmv0+SmMXie43e16ia1hI bDUDU2h1u50qOTj9D3kRNZITfM6r0fTo8qnvXLsHUg37DZadBMSE1aK8GpNLj8wU XbYjgKp8uAy28GpyKb+/ =AyPk -----END PGP SIGNATURE----- --Apple-Mail=_B6209A18-6EFA-43A5-9E7A-668EBE964B54--