Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fflush(3S) — DG/UX 5.4R3.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close(2)

exit(2)

intro(3)

reentrant(3)

fopen(3S)

setbuf(3S)

stdio(3S)



fclose(3S)                     DG/UX 5.4R3.00                     fclose(3S)


NAME
       fclose, fflush - close or flush a stream

SYNOPSIS
       #include <stdio.h>

       int fclose (FILE *stream);

       int fflush (FILE *stream);

DESCRIPTION
       fclose causes any buffered data waiting to be written for the named
       stream [see intro(3)] to be written out, and the stream to be closed.
       If the underlying file pointer is not already at end of file, and the
       file is one capable of seeking, the file pointer is adjusted so that
       the next operation on the open file pointer deals with the byte after
       the last one read from or written to the file being closed.

       fclose is performed automatically for all open files upon calling
       exit.

       If stream points to an output stream or an update stream on which the
       most recent operation was not input, fflush causes any buffered data
       waiting to be written for the named stream to be written to that
       file.  Any unread data buffered in stream is discarded.  The stream
       remains open.  If stream is open for reading, the underlying file
       pointer is not already at end of file, and the file is one capable of
       seeking, the file pointer is adjusted so that the next operation on
       the open file pointer deals with the byte after the last one read
       from or written to the stream.

       When calling fflush, if stream is a null pointer, all files open for
       writing are flushed.

   Considerations for Threads Programming
                     +---------+-----------------------------+
                     |         |                      async- |
                     |function | reentrant   cancel   cancel |
                     |         |              point    safe  |
                     +---------+-----------------------------+
                     |fclose   |     Y          Y        N   |
                     |fflush   |     Y          Y        N   |
                     +---------+-----------------------------+
SEE ALSO
       close(2), exit(2), intro(3), reentrant(3), fopen(3S), setbuf(3S),
       stdio(3S).

DIAGNOSTICS
       Upon successful completion these functions return a value of zero.
       Otherwise EOF is returned.







Licensed material--property of copyright holder(s)                         1


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