1UNLOCKED_STDIO(3)          Linux Programmer's Manual         UNLOCKED_STDIO(3)
2
3
4

NAME

6       getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - non‐
7       locking stdio functions
8

SYNOPSIS

10       #include <stdio.h>
11
12       int getc_unlocked(FILE *stream);
13       int getchar_unlocked(void);
14       int putc_unlocked(int c, FILE *stream);
15       int putchar_unlocked(int c);
16
17       void clearerr_unlocked(FILE *stream);
18       int feof_unlocked(FILE *stream);
19       int ferror_unlocked(FILE *stream);
20       int fileno_unlocked(FILE *stream);
21       int fflush_unlocked(FILE *stream);
22       int fgetc_unlocked(FILE *stream);
23       int fputc_unlocked(int c, FILE *stream);
24       size_t fread_unlocked(void *ptr, size_t size, size_t n,
25                             FILE *stream);
26       size_t fwrite_unlocked(const void *ptr, size_t size, size_t n,
27                             FILE *stream);
28
29       char *fgets_unlocked(char *s, int n, FILE *stream);
30       int fputs_unlocked(const char *s, FILE *stream);
31
32       #include <wchar.h>
33
34       wint_t getwc_unlocked(FILE *stream);
35       wint_t getwchar_unlocked(void);
36       wint_t fgetwc_unlocked(FILE *stream);
37       wint_t fputwc_unlocked(wchar_t wc, FILE *stream);
38       wint_t putwc_unlocked(wchar_t wc, FILE *stream);
39       wint_t putwchar_unlocked(wchar_t wc);
40       wchar_t *fgetws_unlocked(wchar_t *ws, int n, FILE *stream);
41       int fputws_unlocked(const wchar_t *ws, FILE *stream);
42
43   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
44
45       getc_unlocked(), getchar_unlocked(), putc_unlocked(),
46       putchar_unlocked():
47           _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE ||
48           _BSD_SOURCE || _SVID_SOURCE
49
50       clearerr_unlocked(), feof_unlocked(), ferror_unlocked(),
51       fileno_unlocked(), fflush_unlocked(), fgetc_unlocked(),
52       fputc_unlocked(), fread_unlocked(), fwrite_unlocked():
53           _BSD_SOURCE || _SVID_SOURCE
54
55       fgets_unlocked(), fputs_unlocked(), getwc_unlocked(),
56       getwchar_unlocked(), fgetwc_unlocked(), fputwc_unlocked(),
57       putwchar_unlocked(), fgetws_unlocked(), fputws_unlocked():
58           _GNU_SOURCE
59

DESCRIPTION

61       Each of these functions has the same behavior as its counterpart  with‐
62       out  the  "_unlocked" suffix, except that they do not use locking (they
63       do not set locks themselves, and do not test for the presence of  locks
64       set by others) and hence are thread-unsafe.  See flockfile(3).
65

CONFORMING TO

67       The     four     functions     getc_unlocked(),     getchar_unlocked(),
68       putc_unlocked(), putchar_unlocked() are in POSIX.1-2001.
69
70       The nonstandard *_unlocked() variants occur on a few UNIX systems,  and
71       are available in recent glibc.  They should probably not be used.
72

SEE ALSO

74       flockfile(3), stdio(3)
75

COLOPHON

77       This  page  is  part of release 3.53 of the Linux man-pages project.  A
78       description of the project, and information about reporting  bugs,  can
79       be found at http://www.kernel.org/doc/man-pages/.
80
81
82
83                                  2008-08-29                 UNLOCKED_STDIO(3)
Impressum