2 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH stdio_ext 3 (date) "Linux man-pages (unreleased)"
8 __fbufsize, __flbf, __fpending, __fpurge, __freadable,
9 __freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \-
10 interfaces to stdio FILE structure
13 .RI ( libc ", " \-lc )
17 .B #include <stdio_ext.h>
19 .BI "size_t __fbufsize(FILE *" stream );
20 .BI "size_t __fpending(FILE *" stream );
21 .BI "int __flbf(FILE *" stream );
22 .BI "int __freadable(FILE *" stream );
23 .BI "int __fwritable(FILE *" stream );
24 .BI "int __freading(FILE *" stream );
25 .BI "int __fwriting(FILE *" stream );
26 .BI "int __fsetlocking(FILE *" stream ", int " type );
27 .B "void _flushlbf(void);"
28 .BI "void __fpurge(FILE *" stream );
31 Solaris introduced routines to allow portable access to the
34 structure, and glibc also implemented these.
38 function returns the size of the buffer currently used
43 function returns the number of bytes in the output buffer.
44 For wide-oriented streams the unit is wide characters.
45 This function is undefined on buffers in reading mode,
50 function returns a nonzero value if the stream is line-buffered,
55 function returns a nonzero value if the stream allows reading,
60 function returns a nonzero value if the stream allows writing,
65 function returns a nonzero value if the stream is read-only, or
66 if the last operation on the stream was a read operation,
71 function returns a nonzero value if the stream is write-only (or
72 append-only), or if the last operation on the stream was a write
73 operation, and zero otherwise.
77 function can be used to select the desired type of locking on the stream.
78 It returns the current type.
81 argument can take the following three values:
83 .B FSETLOCKING_INTERNAL
84 Perform implicit locking around every operation on the given stream
85 (except for the *_unlocked ones).
88 .B FSETLOCKING_BYCALLER
89 The caller will take care of the locking (possibly using
91 in case there is more than one thread), and the stdio routines
92 will not do locking until the state is reset to
93 .BR FSETLOCKING_INTERNAL .
96 Don't change the type of locking.
101 function flushes all line-buffered streams.
103 output to a terminal is forced out, say before reading keyboard input.)
107 function discards the contents of the stream's buffer.
109 For an explanation of the terms used in this section, see
117 Interface Attribute Value
123 T} Thread safety MT-Safe race:stream
131 T} Thread safety MT-Safe