Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jul 1999 07:52:55 -0400
From:      "Mikhail V. Evstiounin" <evs@telerama.com>
To:        <questions@FreeBSD.ORG>
Subject:   Re: result of pclose
Message-ID:  <005f01becdef$71bc5b80$6f27abcd@mvehpc.evs.slip.lm.com>

next in thread | raw e-mail | index | archive | help

-----Original Message-----
From: Thomas David Rivers <rivers@dignus.com>
To: mi@kot.ne.mediaone.net <mi@kot.ne.mediaone.net>; questions@FreeBSD.ORG
<questions@FreeBSD.ORG>
Date: Wednesday, July 14, 1999 7:08 AM
Subject: Re: result of pclose


>> According to pclose(3), its result must be the exit code of the process.
>> Is this a bug, or do I misunderstand the manual? Thanks!
>>
>> -mi
>>
>
> That is the exit code of the process.
>
> The exit code returns is in a format called the `status area',
> and is exactly the same as that returned by the wait(2)
> system call.
>
> The wait(2) man page describes the macros you need to use to
> get the return code of the process.
>
> What you want to do is something like:
>
>    rc = WEXITSTATUS(pclose(pipe));

Actually, you want check both parts - what process returns and how it ends:
normal, been killed or crashes.

>
> - Dave Rivers -
>
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message



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?005f01becdef$71bc5b80$6f27abcd>