[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: obtaining process exit code from popen()
- From: "John D. Blair" <jdb@...>
- Date: Mon, 08 Jun 2009 12:50:31 -0700
On Mon, 2009-06-08 at 21:47 +0200, Florian Weimer wrote:
> * John D. Blair:
>
> > I'm not sure I understand... popen() doesn't return a process object, it
> > returns a file handle. Also, I don't see wait() or a process object in
> > the lua docs anyplace. Is it part of an add-on module? I don't think
> > there's any concept of process in ANSI-C, which is what the un-adorned
> > lua interpreter targets.
>
> popen() is from POSIX, not ISO C. pclose() does return the exit
> status of the child process.
That's not true about pclose(), at least not on Linux:
>From the Linux popen() man page, which also describes pclose():
The pclose() function waits for the associated process to
terminate and returns the exit status of the command as returned by
wait4(2).