UNLOCKED_STDIO(3) Linux Programmer's Manual UNLOCKED_STDIO(3)
NAME
*_unlocked - non-locking stdio functions
SYNOPSIS
#include<stdio.h>
intgetc_unlocked(FILE*stream);
intgetchar_unlocked(void);
intputc_unlocked(int c,FILE*stream);
intputchar_unlocked(int c);
#define_BSD_SOURCE /* or _SVID_SOURCE or _GNU_SOURCE */
#include<stdio.h>
voidclearerr_unlocked(FILE*stream);
intfeof_unlocked(FILE*stream);
intferror_unlocked(FILE*stream);
intfileno_unlocked(FILE*stream);
intfflush_unlocked(FILE*stream);
intfgetc_unlocked(FILE*stream);
intfputc_unlocked(int c,FILE*stream);
size_tfread_unlocked(void*ptr,size_t size,size_t n,
FILE*stream);
size_tfwrite_unlocked(constvoid*ptr,size_t size,size_t n,
FILE*stream);
#define_GNU_SOURCE
#include<stdio.h>
char*fgets_unlocked(char*s,int n,FILE*stream);
intfputs_unlocked(constchar*s,FILE*stream);
#define_GNU_SOURCE
#include<wchar.h>
wint_tgetwc_unlocked(FILE*stream);
wint_tgetwchar_unlocked(void);
wint_tfgetwc_unlocked(FILE*stream);
wint_tfputwc_unlocked(wchar_t wc,FILE*stream);
wint_tputwc_unlocked(wchar_t wc,FILE*stream);
wint_tputwchar_unlocked(wchar_t wc);
wchar_t*fgetws_unlocked(wchar_t*ws,int n,FILE*stream);
intfputws_unlocked(constwchar_t*ws,FILE*stream);
DESCRIPTION
Each of these functions has the same behaviour as its counterpart with-
out 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).
CONFORMINGTO
The four functions getc_unlocked(), getchar_unlocked(),
putc_unlocked(), putchar_unlocked() are in POSIX.1. The nonstandard
*_unlocked() variants occur on a few Unix systems, and are available in
recent glibc. They should probably not be used.
SEEALSO
flockfile(3)
2001-10-18 UNLOCKED_STDIO(3)