HP 3000 Manuals

pclose [ MPE/iX Developer's Kit Reference Manual Volume I ] MPE/iX 5.0 Documentation


MPE/iX Developer's Kit Reference Manual Volume I

pclose 

Close a pipe.

Syntax 

     #include <stdio.h>
     int pclose(FILE *stream);

Parameters 

stream     is the pointer for a pipe opened with popen().  If it is not a
           pointer for a pipe opened with popen(), the result is
           undefined.

Description 

pclose() closes a pipe that was opened with popen().  It then waits for
the command on the other end of the pipe to terminate.

Errors 

Normally, pclose() returns the termination status of the command at the
other end of the pipe.  However, if the process calling pclose() has also
called wait() or waitpid() with a pid argument less than or equal to
zero, or with some non-standard function that makes it impossible for
pclose() to determine the termination status, pclose() returns -1 and
sets errno to ECHILD.

If popen() was unable to invoke the shell to execute a command, pclose()
returns a termination status as if the shell had terminated with
exit(127).

pclose() may set errno to one of the following:

ECHILD            CAUSE           pclose() was unable to determine the child process's
                                  status.
                  ACTION          No action is necessary.

See Also 

sh(1), popen()



MPE/iX 5.0 Documentation