Date: Tue, 13 Oct 1998 10:46:28 -0400 (EDT) Message-Id: <199810131446.KAA04596@indy.delorie.com> From: DJ Delorie To: djgpp-workers AT delorie DOT com In-reply-to: (message from Eli Zaretskii on Tue, 13 Oct 1998 17:42:48 +0300 (IDT)) Subject: Re: Bug in popen Reply-To: djgpp-workers AT delorie DOT com > > Anywhere in the docs and also in popen.c it is documented, > > that pclose returns zero for success and nonzero for failure. > > But effectively pclose return in the case of success the return > > value of the piped program. > > DJ, what exactly does Posix say about this? IIRC, the last changes in > pclose were done to make it more Posix-compliant. pclose returns the exit code of the program it runs. POSIX assumes you can always run the shell (which is what popen is supposed to use); problems getting the shell started are supposed to be returned by popen.