Imported upstream version 1.5
[manpages-zh.git] / raw / man3 / unlocked_stdio.3
blob53fa32fa109031932705558ae128bb88c7366ceb
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  2001-10-18 "" "Linux Programmer's Manual"
24 .SH NAME
25 *_unlocked \- non-locking stdio functions
26 .SH SYNOPSIS
27 .nf
28 .B #include <stdio.h>
29 .sp
30 .BI "int getc_unlocked(FILE *" stream );
31 .BI "int getchar_unlocked(void);"
32 .BI "int putc_unlocked(int " c ", FILE *" stream );
33 .BI "int putchar_unlocked(int " c );
34 .sp
35 .BR "#define _BSD_SOURCE" " /* or _SVID_SOURCE or _GNU_SOURCE */
36 .B #include <stdio.h>
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 .B #define _GNU_SOURCE
51 .B #include <stdio.h>
52 .sp
53 .BI "char *fgets_unlocked(char *" s ", int " n ", FILE *" stream );
54 .BI "int fputs_unlocked(const char *" s ", FILE *" stream );
55 .sp
56 .B #define _GNU_SOURCE
57 .B #include <wchar.h>
58 .sp
59 .BI "wint_t getwc_unlocked(FILE *" stream );
60 .BI "wint_t getwchar_unlocked(void);"
61 .BI "wint_t fgetwc_unlocked(FILE *" stream );
62 .BI "wint_t fputwc_unlocked(wchar_t " wc ", FILE *" stream );
63 .BI "wint_t putwc_unlocked(wchar_t " wc ", FILE *" stream );
64 .BI "wint_t putwchar_unlocked(wchar_t " wc );
65 .BI "wchar_t *fgetws_unlocked(wchar_t *" ws ", int " n ", FILE *" stream );
66 .BI "int fputws_unlocked(const wchar_t *" ws ", FILE *" stream );
67 .fi
68 .SH DESCRIPTION
69 Each of these functions has the same behaviour as its counterpart
70 without the `_unlocked' suffix, except that they do not use locking
71 (they do not set locks themselves, and do not test for the presence
72 of locks set by others) and hence are thread-unsafe.
73 See
74 .BR flockfile (3).
75 .SH "CONFORMING TO"
76 The four functions \fIgetc_unlocked\fP(), \fIgetchar_unlocked\fP(),
77 \fIputc_unlocked\fP(), \fIputchar_unlocked\fP() are in POSIX.1.
78 The nonstandard
79 .BR *_unlocked()
80 variants occur on a few Unix systems, and are available in recent glibc.
81 .\" E.g., in HPUX 10.0. In HPUX 10.30 they are called obsolescent, and
82 .\" moved to a compatibility library.
83 .\" Available in HPUX 10.0: clearerr_unlocked, fclose_unlocked,
84 .\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
85 .\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
86 .\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
87 .\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
88 .\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
89 .\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
90 .\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
91 .\" ungetc_unlocked, ungetwc_unlocked.
92 They should probably not be used.
93 .SH "SEE ALSO"
94 .BR flockfile (3)