COHERENT manpages

This page displays the COHERENT manpage for pclose() [Close a pipe].

List of available manpages
Index


pclose() -- STDIO Function (libc)

Close a pipe
#include <stdio.h>
int pclose(fp)
FILE *fp;

pclose() closes the  pipe pointed to by fp, which  must have been opened by
the function popen().

pclose()  awaits the  completion of  the child  process and  performs other
cleanup.  It returns the value from a WAIT done on the child process.  This
value includes information in addition  to the ``simple'' exit value of the
child process.

Example

For an example of this function, see the Lexicon entry for popen.

Files

<stdio.h>

See Also

fclose(),
fopen(),
libc,
pipe(),
popen(),
sh,
system(),
wait()

Diagnostics

pclose()  returns -1  if fp  had  not been  created by  a call  to popen().
Otherwise, pclose()  returns the exit status of the  command, in the format
described in  the entry for  wait(): exit status  in the high  byte, signal
information in the low byte.