1FPURGE(3bsd) LOCAL FPURGE(3bsd)
2
4 fpurge — flush a stream
5
7 Utility functions from BSD systems (libbsd, -lbsd)
8
10 #include <stdio.h>
11 (See libbsd(7) for include usage.)
12
13 int
14 fpurge(FILE *stream);
15
17 The function fpurge() erases any input or output buffered in the given
18 stream. For output streams this discards any unwritten output. For
19 input streams this discards any input read from the underlying object but
20 not yet obtained via getc(3); this includes any text pushed back via
21 ungetc(3).
22
24 Upon successful completion 0 is returned. Otherwise, EOF is returned and
25 the global variable errno is set to indicate the error.
26
28 [EBADF] stream is not an open stream.
29
31 fclose(3), fopen(3), setvbuf(3)
32
34 The fpurge() function first appeared in 4.4BSD-Lite.
35
36BSD May 10, 2020 BSD