1STDIO_EXT(3)               Linux Programmer's Manual              STDIO_EXT(3)
2
3
4

NAME

6       __fbufsize,  __flbf,  __fpending,  __fpurge,  __freadable,  __freading,
7       __fsetlocking, __fwritable, __fwriting, _flushlbf - interfaces to stdio
8       FILE structure
9

SYNOPSIS

11       #include <stdio.h>
12       #include <stdio_ext.h>
13
14       size_t __fbufsize(FILE *stream);
15       size_t __fpending(FILE *stream);
16       int __flbf(FILE *stream);
17       int __freadable(FILE *stream);
18       int __fwritable(FILE *stream);
19       int __freading(FILE *stream);
20       int __fwriting(FILE *stream);
21       int __fsetlocking(FILE *stream, int type);
22       void _flushlbf(void);
23       void __fpurge(FILE *stream);
24

DESCRIPTION

26       Solaris  introduced  routines to allow portable access to the internals
27       of the FILE structure, and glibc also implemented these.
28
29       The __fbufsize() function returns the size of the buffer currently used
30       by the given stream.
31
32       The  __fpending()  function  returns  the number of bytes in the output
33       buffer.  For wide-oriented streams the unit is wide  characters.   This
34       function is undefined on buffers in reading mode, or opened read-only.
35
36       The  __flbf()  function returns a non-zero value if the stream is line-
37       buffered, and zero otherwise.
38
39       The __freadable() function returns  a  non-zero  value  if  the  stream
40       allows reading, and zero otherwise.
41
42       The  __fwritable()  function  returns  a  non-zero  value if the stream
43       allows writing, and zero otherwise.
44
45       The __freading() function returns a non-zero value  if  the  stream  is
46       read-only, or if the last operation on the stream was a read operation,
47       and zero otherwise.
48
49       The __fwriting() function returns a non-zero value  if  the  stream  is
50       write-only (or append-only), or if the last operation on the stream was
51       a write operation, and zero otherwise.
52
53       The __fsetlocking() function can be used to select the desired type  of
54       locking on the stream.  It returns the current type.  The type argument
55       can take the following three values:
56
57       FSETLOCKING_INTERNAL
58              Perform implicit locking around every  operation  on  the  given
59              stream (except for the *_unlocked ones).  This is the default.
60
61       FSETLOCKING_BYCALLER
62              The  caller will take care of the locking (possibly using flock‐
63              file(3) in case there is more than one thread),  and  the  stdio
64              routines  will  not do locking until the state is reset to FSET‐
65              LOCKING_INTERNAL.
66
67       FSETLOCKING_QUERY
68              Don't change the type of locking.  (Only return it.)
69
70       The _flushlbf() function flushes all line-buffered  streams.   (Presum‐
71       ably  so  that  output  to a terminal is forced out, say before reading
72       keyboard input.)
73
74       The __fpurge() function discards the contents of the stream's buffer.
75

SEE ALSO

77       flockfile(3), fpurge(3)
78

COLOPHON

80       This page is part of release 3.22 of the Linux  man-pages  project.   A
81       description  of  the project, and information about reporting bugs, can
82       be found at http://www.kernel.org/doc/man-pages/.
83
84
85
86                                  2001-12-16                      STDIO_EXT(3)
Impressum