OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / unlocked_stdio.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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.
12 .\"
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.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH UNLOCKED_STDIO 3  2008-08-29 "" "Linux Programmer's Manual"
26 .SH NAME
27 getc_unlocked, getchar_unlocked, putc_unlocked,
28 putchar_unlocked \- nonlocking stdio functions
29 .SH SYNOPSIS
30 .nf
31 .B #include <stdio.h>
32 .sp
33 .BI "int getc_unlocked(FILE *" stream );
34 .B "int getchar_unlocked(void);"
35 .BI "int putc_unlocked(int " c ", FILE *" stream );
36 .BI "int putchar_unlocked(int " c );
37 .sp
38 .BI "void clearerr_unlocked(FILE *" stream );
39 .BI "int feof_unlocked(FILE *" stream );
40 .BI "int ferror_unlocked(FILE *" stream );
41 .BI "int fileno_unlocked(FILE *" stream );
42 .BI "int fflush_unlocked(FILE *" stream );
43 .BI "int fgetc_unlocked(FILE *" stream );
44 .BI "int fputc_unlocked(int " c ", FILE *" stream );
45 .BI "size_t fread_unlocked(void *" ptr ", size_t " size ", size_t " n ,
46 .BI "                      FILE *" stream );
47 .BI "size_t fwrite_unlocked(const void *" ptr ", size_t " size ", size_t " n ,
48 .BI "                      FILE *" stream );
49 .sp
50 .BI "char *fgets_unlocked(char *" s ", int " n ", FILE *" stream );
51 .BI "int fputs_unlocked(const char *" s ", FILE *" stream );
52 .sp
53 .B #include <wchar.h>
54 .sp
55 .BI "wint_t getwc_unlocked(FILE *" stream );
56 .B "wint_t getwchar_unlocked(void);"
57 .BI "wint_t fgetwc_unlocked(FILE *" stream );
58 .BI "wint_t fputwc_unlocked(wchar_t " wc ", FILE *" stream );
59 .BI "wint_t putwc_unlocked(wchar_t " wc ", FILE *" stream );
60 .BI "wint_t putwchar_unlocked(wchar_t " wc );
61 .BI "wchar_t *fgetws_unlocked(wchar_t *" ws ", int " n ", FILE *" stream );
62 .BI "int fputws_unlocked(const wchar_t *" ws ", FILE *" stream );
63 .fi
64 .sp
65 .in -4n
66 Feature Test Macro Requirements for glibc (see
67 .BR feature_test_macros (7)):
68 .ad l
69 .in
70 .sp
71 .BR getc_unlocked (),
72 .BR getchar_unlocked (),
73 .BR putc_unlocked (),
74 .BR putchar_unlocked ():
75 .RS 4
76 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE ||
77 _BSD_SOURCE || _SVID_SOURCE
78 .RE
79 .sp
80 .BR clearerr_unlocked (),
81 .BR feof_unlocked (),
82 .BR ferror_unlocked (),
83 .BR fileno_unlocked (),
84 .BR fflush_unlocked (),
85 .BR fgetc_unlocked (),
86 .BR fputc_unlocked (),
87 .BR fread_unlocked (),
88 .BR fwrite_unlocked ():
89 .RS 4
90 _BSD_SOURCE || _SVID_SOURCE
91 .RE
92 .sp
93 .BR fgets_unlocked (),
94 .BR fputs_unlocked (),
95 .BR getwc_unlocked (),
96 .BR getwchar_unlocked (),
97 .BR fgetwc_unlocked (),
98 .BR fputwc_unlocked (),
99 .BR putwchar_unlocked (),
100 .BR fgetws_unlocked (),
101 .BR fputws_unlocked ():
102 .RS 4
103 _GNU_SOURCE
104 .RE
105 .ad b
106 .SH DESCRIPTION
107 Each of these functions has the same behavior as its counterpart
108 without the "_unlocked" suffix, except that they do not use locking
109 (they do not set locks themselves, and do not test for the presence
110 of locks set by others) and hence are thread-unsafe.
111 See
112 .BR flockfile (3).
113 .SH CONFORMING TO
114 The four functions
115 .BR getc_unlocked (),
116 .BR getchar_unlocked (),
117 .BR putc_unlocked (),
118 .BR putchar_unlocked ()
119 are in POSIX.1-2001.
120
121 The nonstandard
122 .BR *_unlocked ()
123 variants occur on a few UNIX systems, and are available in recent glibc.
124 .\" E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
125 .\" moved to a compatibility library.
126 .\" Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
127 .\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
128 .\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
129 .\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
130 .\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
131 .\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
132 .\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
133 .\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
134 .\" ungetc_unlocked, ungetwc_unlocked.
135 They should probably not be used.
136 .SH SEE ALSO
137 .BR flockfile (3),
138 .BR stdio (3)
139 .SH COLOPHON
140 This page is part of release 3.79 of the Linux
141 .I man-pages
142 project.
143 A description of the project,
144 information about reporting bugs,
145 and the latest version of this page,
146 can be found at
147 \%http://www.kernel.org/doc/man\-pages/.