Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fclose(3s) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close, closex

exit, _exit

fopen, freopen, fdopen

setbuf, setvbuf

stdio



FCLOSE(3s,L)                AIX Technical Reference                FCLOSE(3s,L)



-------------------------------------------------------------------------------
fclose, fflush



PURPOSE

Closes or flushes a stream.

LIBRARY

Standard I/O Library (libc.a)

SYNTAX

#include <stdio.h>




                int fclose (stream)         int fflush (stream)
                FILE *stream;               FILE *stream;



DESCRIPTION

The fclose subroutine writes buffered data to the stream specified by the
stream parameter and then closes the stream.

The fclose subroutine is automatically called for all open files when the exit
system call is invoked.

The fflush subroutine writes any buffered data for the stream specified by the
stream parameter and leaves the stream open.

RETURN VALUE

Upon successful completion, both the fclose and the fflush subroutines return a
value of 0.  If either of these subroutines fails for any reason, it returns
the value EOF.

ERROR CONDITIONS

The fclose and fflush subroutines fail if one or more of the following are
true:

EAGAIN    The O_NONBLOCK flag is set for the file descriptor underlying stream
          and the process is delayed in the write operation.

EBADF     The file descriptor underlying stream is not valid.




Processed November 7, 1990       FCLOSE(3s,L)                                 1





FCLOSE(3s,L)                AIX Technical Reference                FCLOSE(3s,L)



EFBIG     An attempt was made to write to a file that exceeds the process's
          file size limit or the maximum file size.

EINTR     The function was interrupted by a signal.

EIO       The process is a member of a background process group attempting to
          write to its controlling terminal, TOSTOP is set, the process is
          neither ignoring nor blocking SIGTTOU and the process group of the
          process is orphaned.

ENOSPEC   There was no free space remaining on the device containing the file.

EPIPE     An attempt is made to write to a pipe or FIFO that is not open for
          reading by any process.  A SIGPIPE signal is also sent to the
          process.

RELATED INFORMATION

In this book:  "close, closex," "exit, _exit," "fopen, freopen, fdopen,"
"setbuf, setvbuf," and "stdio."



































Processed November 7, 1990       FCLOSE(3s,L)                                 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026