man-pages/man3/fpurge.3.html
2021-03-31 01:06:50 +01:00

151 lines
3.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of FPURGE</TITLE>
</HEAD><BODY>
<H1>FPURGE</H1>
Section: Linux Programmer's Manual (3)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
fpurge, __fpurge - purge a stream
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
/* unsupported */
<B>#include &lt;<A HREF="file:///usr/include/stdio.h">stdio.h</A>&gt;</B>
<B>int fpurge(FILE *</B><I>stream</I><B>);</B>
/* supported */
<B>#include &lt;<A HREF="file:///usr/include/stdio.h">stdio.h</A>&gt;</B>
<B>#include &lt;<A HREF="file:///usr/include/stdio_ext.h">stdio_ext.h</A>&gt;</B>
<B>void __fpurge(FILE *</B><I>stream</I><B>);</B>
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The function
<B>fpurge</B>()
clears the buffers of the given stream.
For output streams this discards any unwritten output.
For input streams this discards any input read from the underlying object
but not yet obtained via
<B><A HREF="/cgi-bin/man/man2html?3+getc">getc</A></B>(3);
this includes any text pushed back via
<B><A HREF="/cgi-bin/man/man2html?3+ungetc">ungetc</A></B>(3).
See also
<B><A HREF="/cgi-bin/man/man2html?3+fflush">fflush</A></B>(3).
<P>
The function
<B>__fpurge</B>()
does precisely the same, but without returning a value.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
Upon successful completion
<B>fpurge</B>()
returns 0.
On error, it returns -1 and sets
<I>errno</I>
appropriately.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="1"><B>EBADF</B>
<DD>
<I>stream</I>
is not an open stream.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>ATTRIBUTES</H2>
For an explanation of the terms used in this section, see
<B><A HREF="/cgi-bin/man/man2html?7+attributes">attributes</A></B>(7).
<TABLE BORDER>
<TR VALIGN=top><TD><B>Interface</B></TD><TD><B>Attribute</B></TD><TD><B>Value</B><BR></TD></TR>
<TR VALIGN=top><TD>
<B>__fpurge</B>()
</TD><TD>Thread safety</TD><TD>MT-Safe race:stream<BR></TD></TR>
</TABLE>
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>CONFORMING TO</H2>
These functions are nonstandard and not portable.
The function
<B>fpurge</B>()
was introduced in 4.4BSD and is not available under Linux.
The function
<B>__fpurge</B>()
was introduced in Solaris, and is present in glibc 2.1.95 and later.
<A NAME="lbAI">&nbsp;</A>
<H2>NOTES</H2>
Usually it is a mistake to want to discard input buffers.
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+fflush">fflush</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+setbuf">setbuf</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+stdio_ext">stdio_ext</A></B>(3)
<A NAME="lbAK">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="2"><A HREF="#lbAB">NAME</A><DD>
<DT id="3"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="4"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="5"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="6"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="7"><A HREF="#lbAG">ATTRIBUTES</A><DD>
<DT id="8"><A HREF="#lbAH">CONFORMING TO</A><DD>
<DT id="9"><A HREF="#lbAI">NOTES</A><DD>
<DT id="10"><A HREF="#lbAJ">SEE ALSO</A><DD>
<DT id="11"><A HREF="#lbAK">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:43 GMT, March 31, 2021
</BODY>
</HTML>