From owner-freebsd-questions Wed Jul 14 7:11: 2 1999 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 8109C14CC9 for ; Wed, 14 Jul 1999 07:10:44 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from rainbow5.scientia.demon.co.uk ([192.168.1.2] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.02 #1) id 114Mdq-000EpD-00; Wed, 14 Jul 1999 11:51:58 +0100 (envelope-from ben@rainbow5.scientia.demon.co.uk) Received: from rainbow5.scientia.demon.co.uk (ident=ben) by rainbow5.scientia.demon.co.uk with local (Exim 3.02 #1) id 114Mdq-000Jix-00; Wed, 14 Jul 1999 11:51:58 +0100 (envelope-from ben@rainbow5.scientia.demon.co.uk) Date: Wed, 14 Jul 1999 11:51:58 +0100 From: Ben Smithurst To: Mikhail Teterin Cc: questions@freebsd.org Subject: Re: result of pclose Message-ID: <19990714115158.A75763@rainbow5.scientia.demon.co.uk> References: <199907140430.AAA30964@kot.ne.mediaone.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="ikeVEW9yuYc//A+q"; micalg=pgp-md5; protocol="application/pgp-signature" X-Mailer: Mutt 0.95.4i In-Reply-To: <199907140430.AAA30964@kot.ne.mediaone.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mikhail Teterin wrote: > Produces: > /usr/bin/false's result was 256 > /usr/bin/true's result was 0 >=20 > I checked and rechecked -- false(1) returns 1 Yes, see wait(2). The value returned is (exit_code << 8) with the low 7 bits specifying the signal number the process died from and the other bit specifying if the process dumped core or not. Just use (code >> 8) to get the exit status, or see the W* macros documented in wait(2). --=20 Ben Smithurst | PGP: 0x99392F7D ben@scientia.demon.co.uk | key available from keyservers and | ben+pgp@scientia.demon.co.uk --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: 2.6.3i iQCVAwUBN4xrzSsPVtiZOS99AQFOagP/QNX1CPiHVrGMmO42/zsr9OJbH1m/ntwr bxjbPJ0V2mxRexzCr+pTe5BFKIzpwJH7ZYny0KXa5PbK5KVHvNIy0qAkeucK2eHO 41iyVXL7WnT58dLSBXgXXVYQDyM1MZ+hsQtEBEfeqPxRXq9Q3lh3N3vTAAjFKfaJ eqqRQHF+xAw= =rB4I -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message