NAME
getc_unlocked, getchar_unlocked, putc_unlocked,
putchar_unlocked, - non-locking stdio functions
SYNOPSIS
#include <stdio.h>
I int getc_unlocked(FILE * stream );
I int getchar_unlocked(void);
I int putc_unlocked(int c , FILE * stream );
I int putchar_unlocked(int c );
R #define _BSD_SOURCE /* or _SVID_SOURCE or _GNU_SOURCE */
#include <stdio.h>
I void clearerr_unlocked(FILE * stream );
I int feof_unlocked(FILE * stream );
I int ferror_unlocked(FILE * stream );
I int fileno_unlocked(FILE * stream );
I int fflush_unlocked(FILE * stream );
I int fgetc_unlocked(FILE * stream );
I int fputc_unlocked(int c , FILE * stream );
I size_t fread_unlocked(void * ptr , size_t size , size_t n ,
I FILE * stream );
I size_t fwrite_unlocked(const void * ptr , size_t size , size_t n ,
I FILE * stream );
#define _GNU_SOURCE
#include <stdio.h>
I char *fgets_unlocked(char * s , int n , FILE * stream );
I int fputs_unlocked(const char * s , FILE * stream );
#define _GNU_SOURCE
#include <wchar.h>
I wint_t getwc_unlocked(FILE * stream );
I wint_t getwchar_unlocked(void);
I wint_t fgetwc_unlocked(FILE * stream );
I wint_t fputwc_unlocked(wchar_t wc , FILE * stream );
I wint_t putwc_unlocked(wchar_t wc , FILE * stream );
I wint_t putwchar_unlocked(wchar_t wc );
I wchar_t *fgetws_unlocked(wchar_t * ws , int n , FILE * stream );
I int fputws_unlocked(const wchar_t * ws , FILE * stream );
DESCRIPTION
Each of these functions has the same behavior as its counterpart
without the `_unlocked' suffix, except that they do not use locking
(they do not set locks themselves, and do not test for the presence
of locks set by others) and hence are thread-unsafe.
See
flockfile(3).
CONFORMING TO
The four functions
R getc_unlocked (),
R getchar_unlocked (),
R putc_unlocked (),
R putchar_unlocked ()
are in POSIX.1-2001.
The nonstandard
R *_unlocked ()
variants occur on a few Unix systems, and are available in recent glibc.
They should probably not be used.
SEE ALSO