Date: Wed, 14 Jul 1999 11:51:58 +0100 From: Ben Smithurst <ben@scientia.demon.co.uk> To: Mikhail Teterin <mi@kot.ne.mediaone.net> Cc: questions@freebsd.org Subject: Re: result of pclose Message-ID: <19990714115158.A75763@rainbow5.scientia.demon.co.uk> In-Reply-To: <199907140430.AAA30964@kot.ne.mediaone.net> References: <199907140430.AAA30964@kot.ne.mediaone.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990714115158.A75763>
