]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/stdio_ext.3
fanotify_init.2, fanotify.7: Document FAN_REPORT_TID
[thirdparty/man-pages.git] / man3 / stdio_ext.3
CommitLineData
fea681da
MK
1.\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
c13182ef 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da 24.\"
fe0fefbf 25.TH STDIO_EXT 3 2015-03-02 "" "Linux Programmer's Manual"
fea681da 26.SH NAME
35478399 27__fbufsize, __flbf, __fpending, __fpurge, __freadable,
3d54a910
MK
28__freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \-
29interfaces to stdio FILE structure
fea681da 30.SH SYNOPSIS
b4830340 31.nf
fea681da 32.B #include <stdio.h>
fea681da 33.B #include <stdio_ext.h>
68e4db0a 34.PP
fea681da 35.BI "size_t __fbufsize(FILE *" stream );
fea681da 36.BI "size_t __fpending(FILE *" stream );
fea681da 37.BI "int __flbf(FILE *" stream );
fea681da 38.BI "int __freadable(FILE *" stream );
fea681da 39.BI "int __fwritable(FILE *" stream );
fea681da 40.BI "int __freading(FILE *" stream );
fea681da 41.BI "int __fwriting(FILE *" stream );
fea681da 42.BI "int __fsetlocking(FILE *" stream ", int " type );
0daa9e92 43.B "void _flushlbf(void);"
fea681da 44.BI "void __fpurge(FILE *" stream );
b4830340 45.fi
fea681da
MK
46.SH DESCRIPTION
47Solaris introduced routines to allow portable access to the
2f0af33b 48internals of the
097585ed 49.I FILE
2f0af33b 50structure, and glibc also implemented these.
dd3568a1 51.PP
fea681da 52The
63aa9df0 53.BR __fbufsize ()
fea681da
MK
54function returns the size of the buffer currently used
55by the given stream.
dd3568a1 56.PP
fea681da 57The
63aa9df0 58.BR __fpending ()
fea681da
MK
59function returns the number of bytes in the output buffer.
60For wide-oriented streams the unit is wide characters.
61This function is undefined on buffers in reading mode,
62or opened read-only.
dd3568a1 63.PP
fea681da 64The
63aa9df0 65.BR __flbf ()
c7094399 66function returns a nonzero value if the stream is line-buffered,
fea681da 67and zero otherwise.
dd3568a1 68.PP
fea681da 69The
63aa9df0 70.BR __freadable ()
c7094399 71function returns a nonzero value if the stream allows reading,
fea681da 72and zero otherwise.
dd3568a1 73.PP
fea681da 74The
63aa9df0 75.BR __fwritable ()
c7094399 76function returns a nonzero value if the stream allows writing,
fea681da 77and zero otherwise.
dd3568a1 78.PP
fea681da 79The
63aa9df0 80.BR __freading ()
c7094399 81function returns a nonzero value if the stream is read-only, or
fea681da
MK
82if the last operation on the stream was a read operation,
83and zero otherwise.
dd3568a1 84.PP
fea681da 85The
63aa9df0 86.BR __fwriting ()
c7094399 87function returns a nonzero value if the stream is write-only (or
fea681da
MK
88append-only), or if the last operation on the stream was a write
89operation, and zero otherwise.
dd3568a1 90.PP
fea681da 91The
63aa9df0 92.BR __fsetlocking ()
fea681da 93function can be used to select the desired type of locking on the stream.
c13182ef
MK
94It returns the current type.
95The
fea681da 96.I type
c4bb193f 97argument can take the following three values:
fea681da
MK
98.TP
99.B FSETLOCKING_INTERNAL
100Perform implicit locking around every operation on the given stream
c13182ef
MK
101(except for the *_unlocked ones).
102This is the default.
fea681da
MK
103.TP
104.B FSETLOCKING_BYCALLER
105The caller will take care of the locking (possibly using
106.BR flockfile (3)
107in case there is more than one thread), and the stdio routines
ec5a588f
MK
108will not do locking until the state is reset to
109.BR FSETLOCKING_INTERNAL .
fea681da
MK
110.TP
111.B FSETLOCKING_QUERY
c13182ef
MK
112Don't change the type of locking.
113(Only return it.)
dd3568a1 114.PP
fea681da 115The
63aa9df0 116.BR _flushlbf ()
c13182ef
MK
117function flushes all line-buffered streams.
118(Presumably so that
fea681da 119output to a terminal is forced out, say before reading keyboard input.)
dd3568a1 120.PP
fea681da 121The
63aa9df0 122.BR __fpurge ()
fea681da 123function discards the contents of the stream's buffer.
cbdd5ebe 124.SH ATTRIBUTES
3ba48039
PH
125For an explanation of the terms used in this section, see
126.BR attributes (7).
127.TS
128allbox;
129lbw28 lb lb
130l l l.
131Interface Attribute Value
132T{
cbdd5ebe
PH
133.BR __fbufsize (),
134.BR __fpending (),
3ba48039
PH
135.br
136.BR __fpurge (),
cbdd5ebe 137.BR __fsetlocking ()
b4a2fb21 138T} Thread safety MT-Safe race:stream
3ba48039 139T{
cbdd5ebe
PH
140.BR __flbf (),
141.BR __freadable (),
3ba48039 142.br
cbdd5ebe
PH
143.BR __freading (),
144.BR __fwritable (),
3ba48039
PH
145.br
146.BR __fwriting (),
cbdd5ebe 147.BR _flushlbf ()
3ba48039
PH
148T} Thread safety MT-Safe
149.TE
47297adb 150.SH SEE ALSO
fea681da
MK
151.BR flockfile (3),
152.BR fpurge (3)