|
|
HP-UX Reference > Ffclose(3S)HP-UX 11i Version 2: December 2007 Update |
|
NAMEfclose(), fflush(), fclose_unlocked(), fflush_unlocked() — close or flush a stream DESCRIPTIONfclose() causes any buffered data for the named stream to be written out, and the stream to be closed. Buffers allocated by the standard input/output system may be freed. fclose() is performed automatically for all open files upon calling exit(2). If stream points to an output stream or an update stream in which the most recent operation was output, fflush() causes any buffered data for the stream to be written to that file; otherwise any buffered data is discarded. The stream remains open. If stream is a null pointer, fflush() performs this flushing action on all currently open streams. RETURN VALUEUpon successful completion, fclose() and fflush() return 0. Otherwise, they return EOF and set errno to indicate the error. ERRORSIf fclose(), fflush(), fclose_unlocked(), or fflush_unlocked() fails, errno is set to one of:
Additional errno values may be set by the underlying write(), lseek(), and close() functions (see write(2), lseek(2) and close(2)). WARNINGSfclose_unlocked() and fflush_unlocked() are obsolescent interfaces supported only for compatibility with existing DCE applications. New multithreaded applications should use fclose() and fflush(). SEE ALSOclose(2), exit(2), lseek(2), write(2), flockfile(3S), fopen(3S), setbuf(3S), thread_safety(5). |
|