Operating systems, development tools, and professional services
for connected embedded systems

Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation

pclose

pclose()

Close a pipe

Synopsis:

#include <stdio.h>

int pclose( FILE* stream );

Arguments:

stream
The stream pointer for the pipe that you want to close, that you obtained by calling popen().

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.


Note: This function is in libc.a, but not in libc.so (in order to save space).

Description:

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

Returns:

The termination status of the command language interpreter, or -1 if an error occurred (errno is set).

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.1

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

See also:

errno, popen(), pipe()