]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/unlocked_stdio.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / unlocked_stdio.3
1 '\" t
2 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH unlocked_stdio 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 getc_unlocked, getchar_unlocked, putc_unlocked,
9 putchar_unlocked \- nonlocking stdio functions
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ", " \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <stdio.h>
16 .PP
17 .BI "int getc_unlocked(FILE *" stream );
18 .B "int getchar_unlocked(void);"
19 .BI "int putc_unlocked(int " c ", FILE *" stream );
20 .BI "int putchar_unlocked(int " c );
21 .PP
22 .BI "void clearerr_unlocked(FILE *" stream );
23 .BI "int feof_unlocked(FILE *" stream );
24 .BI "int ferror_unlocked(FILE *" stream );
25 .BI "int fileno_unlocked(FILE *" stream );
26 .BI "int fflush_unlocked(FILE *_Nullable " stream );
27 .PP
28 .BI "int fgetc_unlocked(FILE *" stream );
29 .BI "int fputc_unlocked(int " c ", FILE *" stream );
30 .PP
31 .BI "size_t fread_unlocked(void " ptr "[restrict ." size " * ." n ],
32 .BI " size_t " size ", size_t " n ,
33 .BI " FILE *restrict " stream );
34 .BI "size_t fwrite_unlocked(const void " ptr "[restrict ." size " * ." n ],
35 .BI " size_t " size ", size_t " n ,
36 .BI " FILE *restrict " stream );
37 .PP
38 .BI "char *fgets_unlocked(char " s "[restrict ." n "], int " n \
39 ", FILE *restrict " stream );
40 .BI "int fputs_unlocked(const char *restrict " s ", FILE *restrict " stream );
41 .PP
42 .B #include <wchar.h>
43 .PP
44 .BI "wint_t getwc_unlocked(FILE *" stream );
45 .B "wint_t getwchar_unlocked(void);"
46 .BI "wint_t fgetwc_unlocked(FILE *" stream );
47 .PP
48 .BI "wint_t fputwc_unlocked(wchar_t " wc ", FILE *" stream );
49 .BI "wint_t putwc_unlocked(wchar_t " wc ", FILE *" stream );
50 .BI "wint_t putwchar_unlocked(wchar_t " wc );
51 .PP
52 .BI "wchar_t *fgetws_unlocked(wchar_t " ws "[restrict ." n "], int " n ,
53 .BI " FILE *restrict " stream );
54 .BI "int fputws_unlocked(const wchar_t *restrict " ws ,
55 .BI " FILE *restrict " stream );
56 .fi
57 .PP
58 .RS -4
59 Feature Test Macro Requirements for glibc (see
60 .BR feature_test_macros (7)):
61 .nh
62 .RE
63 .ad l
64 .PP
65 .BR getc_unlocked (),
66 .BR getchar_unlocked (),
67 .BR putc_unlocked (),
68 .BR putchar_unlocked ():
69 .nf
70 /* glibc >= 2.24: */ _POSIX_C_SOURCE >= 199309L
71 || /* glibc <= 2.23: */ _POSIX_C_SOURCE
72 || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
73 .fi
74 .PP
75 .BR clearerr_unlocked (),
76 .BR feof_unlocked (),
77 .BR ferror_unlocked (),
78 .BR fileno_unlocked (),
79 .BR fflush_unlocked (),
80 .BR fgetc_unlocked (),
81 .BR fputc_unlocked (),
82 .BR fread_unlocked (),
83 .BR fwrite_unlocked ():
84 .nf
85 /* glibc >= 2.19: */ _DEFAULT_SOURCE
86 || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
87 .fi
88 .PP
89 .BR fgets_unlocked (),
90 .BR fputs_unlocked (),
91 .BR getwc_unlocked (),
92 .BR getwchar_unlocked (),
93 .BR fgetwc_unlocked (),
94 .BR fputwc_unlocked (),
95 .BR putwchar_unlocked (),
96 .BR fgetws_unlocked (),
97 .BR fputws_unlocked ():
98 .nf
99 _GNU_SOURCE
100 .fi
101 .hy
102 .ad
103 .SH DESCRIPTION
104 Each of these functions has the same behavior as its counterpart
105 without the "_unlocked" suffix, except that they do not use locking
106 (they do not set locks themselves, and do not test for the presence
107 of locks set by others) and hence are thread-unsafe.
108 See
109 .BR flockfile (3).
110 .SH ATTRIBUTES
111 For an explanation of the terms used in this section, see
112 .BR attributes (7).
113 .TS
114 allbox;
115 lb lb lbx
116 l l l.
117 Interface Attribute Value
118 T{
119 .na
120 .nh
121 .BR getc_unlocked (),
122 .BR putc_unlocked (),
123 .BR clearerr_unlocked (),
124 .BR fflush_unlocked (),
125 .BR fgetc_unlocked (),
126 .BR fputc_unlocked (),
127 .BR fread_unlocked (),
128 .BR fwrite_unlocked (),
129 .BR fgets_unlocked (),
130 .BR fputs_unlocked (),
131 .BR getwc_unlocked (),
132 .BR fgetwc_unlocked (),
133 .BR fputwc_unlocked (),
134 .BR putwc_unlocked (),
135 .BR fgetws_unlocked (),
136 .BR fputws_unlocked ()
137 T} Thread safety T{
138 .na
139 .nh
140 MT-Safe race:stream
141 T}
142 T{
143 .na
144 .nh
145 .BR getchar_unlocked (),
146 .BR getwchar_unlocked ()
147 T} Thread safety T{
148 .na
149 .nh
150 MT-Unsafe race:stdin
151 T}
152 T{
153 .na
154 .nh
155 .BR putchar_unlocked (),
156 .BR putwchar_unlocked ()
157 T} Thread safety T{
158 .na
159 .nh
160 MT-Unsafe race:stdout
161 T}
162 T{
163 .na
164 .nh
165 .BR feof_unlocked (),
166 .BR ferror_unlocked (),
167 .BR fileno_unlocked ()
168 T} Thread safety MT-Safe
169 .TE
170 .sp 1
171 .SH STANDARDS
172 .TP
173 .BR getc_unlocked ()
174 .TQ
175 .BR getchar_unlocked ()
176 .TQ
177 .BR putc_unlocked ()
178 .TQ
179 .BR putchar_unlocked ()
180 POSIX.1-2008.
181 .TP
182 Others:
183 None.
184 .SH HISTORY
185 .TP
186 .BR getc_unlocked ()
187 .TQ
188 .BR getchar_unlocked ()
189 .TQ
190 .BR putc_unlocked ()
191 .TQ
192 .BR putchar_unlocked ()
193 POSIX.1-2001.
194 .\" E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
195 .\" moved to a compatibility library.
196 .\" Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
197 .\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
198 .\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
199 .\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
200 .\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
201 .\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
202 .\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
203 .\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
204 .\" ungetc_unlocked, ungetwc_unlocked.
205 .SH SEE ALSO
206 .BR flockfile (3),
207 .BR stdio (3)