HELPLIB.HLB  —  CRTL  pclose
    Closes a pipe to a process.

    Format

      #include  <stdio.h>

      int pclose  (FILE *stream);

1  –  Arguments

 stream

    A pointer to a FILE structure for an open pipe returned by a
    previous call to the popen function.

2  –  Description

    The pclose function closes a pipe between the calling program and
    a shell command to be executed. Use pclose to close any stream
    you have opened with popen. The pclose function waits for the
    associated process to end, and then returns the exit status of
    the command. See the description of waitpid for information on
    interpreting the exit status.

    Beginning with OpenVMS Version 7.3-1, when compiled with the
    _VMS_WAIT macro defined, the pclose function returns the OpenVMS
    completion code of the child process.

    See also popen.

3  –  Return Values

    x                  Exit status of child.
    -1                 Indicates an error. The stream argument is not
                       associated with a popen function. errno is set
                       to the following:

                       o  ECHILD - cannot obtain the status of the
                          child process.
Close Help