[Previous] [Contents] [Next]

pclose()

Close a pipe

Synopsis:

#include <stdio.h>

int pclose( FILE* stream );

Library:

libc

Description:

The pclose() function closes the pipe associated with stream, and waits for the subprocess created by popen() to terminate.

Returns:

The pclose() function returns the termination status of the command language interpreter. On error, pclose() returns -1, with errno set appropriately.

Errors:

EINTR
The pclose() function was interrupted by a signal while waiting for the child process to terminate.
ECHILD
The pclose() function was unable to obtain the termination status of the child process.

Examples:

See popen().

Classification:

POSIX 1003.1a

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread No

See also:

errno, popen(), pipe()


[Previous] [Contents] [Next]