pclose(3) — Subroutines
OSF
NAME
pclose − Closes a pipe to a process
LIBRARY
Standard I/O Package (libc.a)
SYNOPSIS
#include <stdio.h> int pclose (
FILE ∗stream );
PARAMETERS
streamPoints to a FILE structure for an open pipe returned by a previous call to the popen() function.
DESCRIPTION
The pclose() function closes a pipe between the calling program and a shell command to be executed. Use the pclose() function to close any stream you have opened with the popen() function. The pclose() function waits for the associated process to end, and then returns the exit status of the command.
NOTES
AES Support Level:
Trial use
CAUTION
If the original processes and the process started with the popen() function concurrently read or write a common file, neither should use buffered I/O. If they do, the results are unpredictable.
RETURN VALUES
Upon successful completion, the pclose() function returns the exit status of the command. If the stream parameter is not associated with a popen() command, a value of -1 is returned.
ERRORS
If the pclose() function fails, errno may be set to the following value:
[ECHILD]The status of the child process could not be obtained.