1fpurge(3bsd)                         LOCAL                        fpurge(3bsd)
2

NAME

4     fpurge — flush a stream
5

LIBRARY

7     Utility functions from BSD systems (libbsd, -lbsd)
8

SYNOPSIS

10     #include <stdio.h>
11     (See libbsd(7) for include usage.)
12
13     int
14     fpurge(FILE *stream);
15

DESCRIPTION

17     The function fpurge() erases any input or output buffered in the given
18     stream.  For output streams this discards any unwritten output.  For in‐
19     put 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

RETURN VALUES

24     Upon successful completion 0 is returned.  Otherwise, EOF is returned and
25     the global variable errno is set to indicate the error.
26

ERRORS

28     [EBADF]            stream is not an open stream.
29

SEE ALSO

31     fclose(3), fopen(3), setvbuf(3)
32

HISTORY

34     The fpurge() function first appeared in 4.4BSD-Lite.
35
36BSD                            November 4, 2015                            BSD
Impressum