17.14.4 Accessing the write buffer of a FILE stream

The following two functions provide information about the output buffer of a FILE * stream.

The fpending function returns the number of pending (a.k.a. buffered, unflushed) bytes in the given stream.

The fbufmode function returns the buffering mode of the given stream:

Resultmeans
_IONBFunbuffered
_IOLBFline buffered
_IOFBFfully buffered

Note that on some platforms, it is impossible to distinguish _IOFBF and _IOLBF.