fpurge(3bsd)
β¨ fpurge β flush a stream β¨
okay bestie, welcome to the fpurge page π
this is from the 3bsd manual section, local vibes only, and it's literally the stream-clearing baddie you didn't know you needed.
π LIBRARY
utility functions from BSD systems, aka libbsd, and you link it with -lbsd. yes that's the whole thing. she's low maintenance fr fr π«Ά
πΈ SYNOPSIS
#include <stdio.h>
(See libbsd(7) for include usage.)
int
fpurge(FILE *stream);
side note bestie: peep libbsd(7) for the whole include-usage situation, it's giving "read the fine print" π
π¦ DESCRIPTION
so the function fpurge() erases any input or output buffered in the given stream. no cap, all of it, gone.
for output streams, this discards any unwritten output. bye bestie, never made it out the door π
for input streams, this discards any input that was read from the underlying object but hasn't yet been obtained via getc(3). and yes, that includes any text that got pushed back via ungetc(3). she's thorough. she's iconic. periodt. π
π RETURN VALUES
- upon successful completion,
0is returned β¨ - otherwise,
EOFis returned, and the global variableerrnois set to indicate the error π
π₯ ERRORS
[EBADF]β stream is not an open stream. like girl. she's not even open. what are we doing here π
π SEE ALSO
π HISTORY
the fpurge() function first appeared in 4.4BSD-Lite. a legend from the jump, we love a historical queen π
and that's the whole page bestie, no notes π this version is from the Debian crew and it's dated November 4, 2015 β mwah, go clear some buffers, you got this π¦β¨π
π¦ where this page comes from
- alpine 3.22: libbsd-doc 0.12.2-r0 Β· BSD-3-Clause
- alpine 3.23: libbsd-doc 0.12.2-r0 Β· BSD-3-Clause
- alpine 3.24: libbsd-doc 0.12.2-r0 Β· BSD-3-Clause
- arch rolling: libbsd 0.12.2-2 Β· custom
- debian bookworm: libbsd-dev 0.11.7-2
- debian trixie: libbsd-dev 0.12.2-2
- epel 10: libbsd-devel 0.12.2-4.el10_0 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- epel 9: libbsd-devel 0.12.2-1.el9 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 43: libbsd-devel 0.12.2-6.fc43 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 43: libbsd-devel 0.12.2-6.fc43 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: libbsd-devel 0.12.2-7.fc44 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: libbsd-devel 0.12.2-7.fc44 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- nixos 26.05: libbsd 0.12.2
- opensuse-leap 16.0: libbsd-devel 0.11.7-160000.3.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libbsd-devel 0.11.7-160000.3.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libbsd-devel 0.11.7-160000.3.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libbsd-devel 0.11.7-160000.3.2 Β· BSD-3-Clause
- ubuntu noble: libbsd-dev 0.12.1-1build1
- ubuntu noble: libbsd-dev 0.12.1-1build1.1
- ubuntu questing: libbsd-dev 0.12.2-2build1
- ubuntu resolute: libbsd-dev 0.12.2-2build2
- ubuntu stonking: libbsd-dev 0.12.2-3
- Copyright (c) 1990, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms