pclose

Closes a pipe stream.

Library:LibC
Classification:UNIX
Service:File and Directory I/O

Syntax

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

Parameters

stream

(IN) Points to the pipe to close.

Return Values

If successful, returns the exit status of the command. Otherwise, returns -1 and sets errno to the following:

Decimal

Constant

Description

70

ECHILD

The status of the child could not be obtained.

Remarks

The pclose function closes a stream that was opened with popen, waits for the child process to terminate, and returns the termination status of the child process.

See Also