fpurge (3)
Leading comments
$OpenBSD: fflush.3,v 1.12 2015/11/04 21:30:13 tedu Exp $ Copyright (c) 1990, 1991, 1993 The Regents of the University of California. All rights reserved. This code is derived from software contributed to Berkeley by Chris Torek and the American National Standards Committee X3, on Information Processing Systems. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of sourc...
NAME
fpurge - flush a streamLIBRARY
Lb libbsdSYNOPSIS
In stdio.h (See libbsd(7) for include usage.) Ft int Fn fpurge FILE *streamDESCRIPTION
The function Fn fpurge erases any input or output buffered in the given Fa 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 getc(3); this includes any text pushed back via ungetc(3).RETURN VALUES
Upon successful completion 0 is returned. Otherwise, EOF is returned and the global variable errno is set to indicate the error.ERRORS
- Bq Er EBADF
- Fa stream is not an open stream.