1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH FPURGE 3 2021-03-22 GNU "Linux Programmer's Manual"
7 fpurge, __fpurge \- purge a stream
10 .RI ( libc ", " \-lc )
16 .BI "int fpurge(FILE *" stream );
20 .B #include <stdio_ext.h>
22 .BI "void __fpurge(FILE *" stream );
27 clears the buffers of the given stream.
28 For output streams this discards any unwritten output.
29 For input streams this discards any input read from the underlying object
30 but not yet obtained via
32 this includes any text pushed back via
39 does precisely the same, but without returning a value.
41 Upon successful completion
44 On error, it returns \-1 and sets
46 to indicate the error.
51 is not an open stream.
53 For an explanation of the terms used in this section, see
61 Interface Attribute Value
64 T} Thread safety MT-Safe race:stream
70 These functions are nonstandard and not portable.
73 was introduced in 4.4BSD and is not available under Linux.
76 was introduced in Solaris, and is present in glibc 2.1.95 and later.
78 Usually it is a mistake to want to discard input buffers.