These functions provide portable access to the members of the stdio(3C) FILE structure.
The __fbufsize() function returns in bytes the size of the buffer currently in use by the given stream.
The __flbf() function returns non-zero if the stream is line-buffered.
The __fpending function returns in bytes the amount of output pending on a stream.
The __fpurge() function discards any pending buffered I/O on the stream.
The __freadable() function returns non-zero if it is possible to read from a stream.
The __freading() function returns non-zero if the file is open readonly, or if the last operation on the stream was a read operation such as fread(3C) or fgetc(3C). Otherwise it returns 0.
The __fsetlocking() function allows the type of locking performed by stdio on a given stream to be controlled by the programmer.
If type is FSETLOCKING_INTERNAL, stdio performs implicit locking around every operation on the given stream. This is the default system behavior on that stream.
If type is FSETLOCKING_BYCALLER, stdio assumes that the caller is responsible for maintaining the integrity of the stream in the face of access by multiple threads. If there is only one thread accessing the stream, nothing further needs
to be done. If multiple threads are accessing the stream, then the caller can use the flockfile(), funlockfile(), and ftrylockfile() functions described on the flockfile(3C) manual page to provide the appropriate locking. In both this and the case where type is FSETLOCKING_INTERNAL, __fsetlocking() returns the previous state of the stream.
If type is FSETLOCKING_QUERY, __fsetlocking() returns the current state of the stream without changing it.
The __fwritable() function returns non-zero if it is possible to write on a stream.
The __fwriting() function returns non-zero if the file is open write-only or append-only, or if the last operation on the stream was a write operation such as fwrite(3C)
or fputc(3C). Otherwise it returns 0.
The _flushlbf() function flushes all line-buffered files. It is used when reading from a line-buffered file.
|