clearerr
clearerr is a C standard-I/O operation that clears a stream's error and end-of-file indicators.
The function returns no value. With a valid stream it does not change errno; clearing stream indicators is separate from resetting that variable. [1]
This is a status operation, not an output replay, a file synchronization request or a repair protocol. The pinned glibc implementation locks the stream, clears its indicators and unlocks it. Preserve the original failure before resetting state, and decide separately how the application will recover. [2]
In Hesela's cross-libc probe, clearerr changed the recorded error indicator from set to clear after failed output. The underlying sink was still /dev/full, which rejects writes with ENOSPC. A cleared flag therefore did not mean that output had reached storage or that the failing condition had disappeared. [4] [3]
Relations
Limitations
- Clearing indicators does not repair failed output or prove persistence.