OSDN Git Service

(split) LDP: Update original to LDP v3.38.
[linuxjm/LDP_man-pages.git] / original / man3 / unlocked_stdio.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .TH UNLOCKED_STDIO 3  2008-08-29 "" "Linux Programmer's Manual"
24 .SH NAME
25 getc_unlocked, getchar_unlocked, putc_unlocked,
26 putchar_unlocked \- nonlocking stdio functions
27 .SH SYNOPSIS
28 .nf
29 .B #include <stdio.h>
30 .sp
31 .BI "int getc_unlocked(FILE *" stream );
32 .B "int getchar_unlocked(void);"
33 .BI "int putc_unlocked(int " c ", FILE *" stream );
34 .BI "int putchar_unlocked(int " c );
35 .sp
36 .BI "void clearerr_unlocked(FILE *" stream );
37 .BI "int feof_unlocked(FILE *" stream );
38 .BI "int ferror_unlocked(FILE *" stream );
39 .BI "int fileno_unlocked(FILE *" stream );
40 .BI "int fflush_unlocked(FILE *" stream );
41 .BI "int fgetc_unlocked(FILE *" stream );
42 .BI "int fputc_unlocked(int " c ", FILE *" stream );
43 .BI "size_t fread_unlocked(void *" ptr ", size_t " size ", size_t " n ,
44 .BI "                      FILE *" stream );
45 .BI "size_t fwrite_unlocked(const void *" ptr ", size_t " size ", size_t " n ,
46 .BI "                      FILE *" stream );
47 .sp
48 .BI "char *fgets_unlocked(char *" s ", int " n ", FILE *" stream );
49 .BI "int fputs_unlocked(const char *" s ", FILE *" stream );
50 .sp
51 .B #include <wchar.h>
52 .sp
53 .BI "wint_t getwc_unlocked(FILE *" stream );
54 .B "wint_t getwchar_unlocked(void);"
55 .BI "wint_t fgetwc_unlocked(FILE *" stream );
56 .BI "wint_t fputwc_unlocked(wchar_t " wc ", FILE *" stream );
57 .BI "wint_t putwc_unlocked(wchar_t " wc ", FILE *" stream );
58 .BI "wint_t putwchar_unlocked(wchar_t " wc );
59 .BI "wchar_t *fgetws_unlocked(wchar_t *" ws ", int " n ", FILE *" stream );
60 .BI "int fputws_unlocked(const wchar_t *" ws ", FILE *" stream );
61 .fi
62 .sp
63 .in -4n
64 Feature Test Macro Requirements for glibc (see
65 .BR feature_test_macros (7)):
66 .ad l
67 .in
68 .sp
69 .BR getc_unlocked (),
70 .BR getchar_unlocked (),
71 .BR putc_unlocked (),
72 .BR putchar_unlocked ():
73 .RS 4
74 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE ||
75 _BSD_SOURCE || _SVID_SOURCE
76 .RE
77 .sp
78 .BR clearerr_unlocked (),
79 .BR feof_unlocked (),
80 .BR ferror_unlocked (),
81 .BR fileno_unlocked (),
82 .BR fflush_unlocked (),
83 .BR fgetc_unlocked (),
84 .BR fputc_unlocked (),
85 .BR fread_unlocked (),
86 .BR fwrite_unlocked ():
87 .RS 4
88 _BSD_SOURCE || _SVID_SOURCE
89 .RE
90 .sp
91 .BR fgets_unlocked (),
92 .BR fputs_unlocked (),
93 .BR getwc_unlocked (),
94 .BR getwchar_unlocked (),
95 .BR fgetwc_unlocked (),
96 .BR fputwc_unlocked (),
97 .BR putwchar_unlocked (),
98 .BR fgetws_unlocked (),
99 .BR fputws_unlocked ():
100 .RS 4
101 _GNU_SOURCE
102 .RE
103 .ad b
104 .SH DESCRIPTION
105 Each of these functions has the same behavior as its counterpart
106 without the "_unlocked" suffix, except that they do not use locking
107 (they do not set locks themselves, and do not test for the presence
108 of locks set by others) and hence are thread-unsafe.
109 See
110 .BR flockfile (3).
111 .SH "CONFORMING TO"
112 The four functions
113 .BR getc_unlocked (),
114 .BR getchar_unlocked (),
115 .BR putc_unlocked (),
116 .BR putchar_unlocked ()
117 are in POSIX.1-2001.
118
119 The nonstandard
120 .BR *_unlocked ()
121 variants occur on a few UNIX systems, and are available in recent glibc.
122 .\" E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
123 .\" moved to a compatibility library.
124 .\" Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
125 .\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
126 .\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
127 .\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
128 .\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
129 .\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
130 .\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
131 .\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
132 .\" ungetc_unlocked, ungetwc_unlocked.
133 They should probably not be used.
134 .SH "SEE ALSO"
135 .BR flockfile (3),
136 .BR stdio (3)