2 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH fpurge 3 (date) "Linux man-pages (unreleased)"
8 fpurge, __fpurge \- purge a stream
11 .RI ( libc ", " \-lc )
17 .BI "int fpurge(FILE *" stream );
21 .B #include <stdio_ext.h>
23 .BI "void __fpurge(FILE *" stream );
28 clears the buffers of the given stream.
29 For output streams this discards any unwritten output.
30 For input streams this discards any input read from the underlying object
31 but not yet obtained via
33 this includes any text pushed back via
40 does precisely the same, but without returning a value.
42 Upon successful completion
45 On error, it returns \-1 and sets
47 to indicate the error.
52 is not an open stream.
54 For an explanation of the terms used in this section, see
62 Interface Attribute Value
65 T} Thread safety MT-Safe race:stream
76 Not available under Linux.
79 Solaris, glibc 2.1.95.
81 Usually it is a mistake to want to discard input buffers.