1FPURGE(3)                  Linux Programmer's Manual                 FPURGE(3)
2
3
4

NAME

6       fpurge, __fpurge - purge a stream
7

SYNOPSIS

9       /* unsupported */
10       #include <stdio.h>
11
12       int fpurge(FILE *stream);
13
14       /* supported */
15       #include <stdio.h>
16       #include <stdio_ext.h>
17
18       void  __fpurge(FILE *stream);
19

DESCRIPTION

21       The function fpurge() clears the buffers of the given stream.  For out‐
22       put streams this discards any unwritten output.  For input streams this
23       discards any input read from the underlying object but not yet obtained
24       via getc(3); this includes any text pushed  back  via  ungetc(3).   See
25       also fflush(3).
26
27       The  function __fpurge() does precisely the same, but without returning
28       a value.
29

RETURN VALUE

31       Upon successful completion fpurge() returns 0.  On error, it returns -1
32       and sets errno appropriately.
33

ERRORS

35       EBADF  stream is not an open stream.
36

CONFORMING TO

38       These  functions  are  nonstandard  and  not  portable.   The  function
39       fpurge() was introduced in 4.4BSD and is  not  available  under  Linux.
40       The  function  __fpurge()  was introduced in Solaris, and is present in
41       glibc 2.1.95 and later.
42

NOTES

44       Usually it is a mistake to want to discard input buffers.
45

SEE ALSO

47       fflush(3), setbuf(3), stdio_ext(3)
48

COLOPHON

50       This page is part of release 3.25 of the Linux  man-pages  project.   A
51       description  of  the project, and information about reporting bugs, can
52       be found at http://www.kernel.org/doc/man-pages/.
53
54
55
56                                  2001-12-15                         FPURGE(3)
Impressum