Blame man3/unlocked_stdio.3

Packit 7cfc04
.\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(VERBATIM)
Packit 7cfc04
.\" Permission is granted to make and distribute verbatim copies of this
Packit 7cfc04
.\" manual provided the copyright notice and this permission notice are
Packit 7cfc04
.\" preserved on all copies.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Permission is granted to copy and distribute modified versions of this
Packit 7cfc04
.\" manual under the conditions for verbatim copying, provided that the
Packit 7cfc04
.\" entire resulting derived work is distributed under the terms of a
Packit 7cfc04
.\" permission notice identical to this one.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Since the Linux kernel and libraries are constantly changing, this
Packit 7cfc04
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
Packit 7cfc04
.\" responsibility for errors or omissions, or for damages resulting from
Packit 7cfc04
.\" the use of the information contained herein.  The author(s) may not
Packit 7cfc04
.\" have taken the same level of care in the production of this manual,
Packit 7cfc04
.\" which is licensed free of charge, as they might when working
Packit 7cfc04
.\" professionally.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Formatted or processed versions of this manual, if unaccompanied by
Packit 7cfc04
.\" the source, must acknowledge the copyright and authors of this work.
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.TH UNLOCKED_STDIO 3  2017-09-15 "" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
getc_unlocked, getchar_unlocked, putc_unlocked,
Packit 7cfc04
putchar_unlocked \- nonlocking stdio functions
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.nf
Packit 7cfc04
.B #include <stdio.h>
Packit 7cfc04
.PP
Packit 7cfc04
.BI "int getc_unlocked(FILE *" stream );
Packit 7cfc04
.B "int getchar_unlocked(void);"
Packit 7cfc04
.BI "int putc_unlocked(int " c ", FILE *" stream );
Packit 7cfc04
.BI "int putchar_unlocked(int " c );
Packit 7cfc04
.PP
Packit 7cfc04
.BI "void clearerr_unlocked(FILE *" stream );
Packit 7cfc04
.BI "int feof_unlocked(FILE *" stream );
Packit 7cfc04
.BI "int ferror_unlocked(FILE *" stream );
Packit 7cfc04
.BI "int fileno_unlocked(FILE *" stream );
Packit 7cfc04
.BI "int fflush_unlocked(FILE *" stream );
Packit 7cfc04
.BI "int fgetc_unlocked(FILE *" stream );
Packit 7cfc04
.BI "int fputc_unlocked(int " c ", FILE *" stream );
Packit 7cfc04
.BI "size_t fread_unlocked(void *" ptr ", size_t " size ", size_t " n ,
Packit 7cfc04
.BI "                      FILE *" stream );
Packit 7cfc04
.BI "size_t fwrite_unlocked(const void *" ptr ", size_t " size ", size_t " n ,
Packit 7cfc04
.BI "                      FILE *" stream );
Packit 7cfc04
.PP
Packit 7cfc04
.BI "char *fgets_unlocked(char *" s ", int " n ", FILE *" stream );
Packit 7cfc04
.BI "int fputs_unlocked(const char *" s ", FILE *" stream );
Packit 7cfc04
Packit 7cfc04
.B #include <wchar.h>
Packit 7cfc04
.PP
Packit 7cfc04
.BI "wint_t getwc_unlocked(FILE *" stream );
Packit 7cfc04
.B "wint_t getwchar_unlocked(void);"
Packit 7cfc04
.BI "wint_t fgetwc_unlocked(FILE *" stream );
Packit 7cfc04
.BI "wint_t fputwc_unlocked(wchar_t " wc ", FILE *" stream );
Packit 7cfc04
.BI "wint_t putwc_unlocked(wchar_t " wc ", FILE *" stream );
Packit 7cfc04
.BI "wint_t putwchar_unlocked(wchar_t " wc );
Packit 7cfc04
.BI "wchar_t *fgetws_unlocked(wchar_t *" ws ", int " n ", FILE *" stream );
Packit 7cfc04
.BI "int fputws_unlocked(const wchar_t *" ws ", FILE *" stream );
Packit 7cfc04
.fi
Packit 7cfc04
.PP
Packit 7cfc04
.in -4n
Packit 7cfc04
Feature Test Macro Requirements for glibc (see
Packit 7cfc04
.BR feature_test_macros (7)):
Packit 7cfc04
.ad l
Packit 7cfc04
.in
Packit 7cfc04
.PP
Packit 7cfc04
.BR getc_unlocked (),
Packit 7cfc04
.BR getchar_unlocked (),
Packit 7cfc04
.BR putc_unlocked (),
Packit 7cfc04
.BR putchar_unlocked ():
Packit 7cfc04
.RS 4
Packit 7cfc04
/* Since glibc 2.24: */ _POSIX_C_SOURCE\ >=\ 199309L
Packit 7cfc04
    || /* Glibc versions <= 2.23: */ _POSIX_C_SOURCE
Packit 7cfc04
    || /* Glibc versions <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
Packit 7cfc04
.RE
Packit 7cfc04
.PP
Packit 7cfc04
.BR clearerr_unlocked (),
Packit 7cfc04
.BR feof_unlocked (),
Packit 7cfc04
.BR ferror_unlocked (),
Packit 7cfc04
.BR fileno_unlocked (),
Packit 7cfc04
.BR fflush_unlocked (),
Packit 7cfc04
.BR fgetc_unlocked (),
Packit 7cfc04
.BR fputc_unlocked (),
Packit 7cfc04
.BR fread_unlocked (),
Packit 7cfc04
.BR fwrite_unlocked ():
Packit 7cfc04
.RS 4
Packit 7cfc04
/* Glibc since 2.19: */ _DEFAULT_SOURCE
Packit 7cfc04
    || /* Glibc versions <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
Packit 7cfc04
.RE
Packit 7cfc04
.PP
Packit 7cfc04
.BR fgets_unlocked (),
Packit 7cfc04
.BR fputs_unlocked (),
Packit 7cfc04
.BR getwc_unlocked (),
Packit 7cfc04
.BR getwchar_unlocked (),
Packit 7cfc04
.BR fgetwc_unlocked (),
Packit 7cfc04
.BR fputwc_unlocked (),
Packit 7cfc04
.BR putwchar_unlocked (),
Packit 7cfc04
.BR fgetws_unlocked (),
Packit 7cfc04
.BR fputws_unlocked ():
Packit 7cfc04
.RS 4
Packit 7cfc04
_GNU_SOURCE
Packit 7cfc04
.RE
Packit 7cfc04
.ad b
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
Each of these functions has the same behavior as its counterpart
Packit 7cfc04
without the "_unlocked" suffix, except that they do not use locking
Packit 7cfc04
(they do not set locks themselves, and do not test for the presence
Packit 7cfc04
of locks set by others) and hence are thread-unsafe.
Packit 7cfc04
See
Packit 7cfc04
.BR flockfile (3).
Packit 7cfc04
.SH ATTRIBUTES
Packit 7cfc04
For an explanation of the terms used in this section, see
Packit 7cfc04
.BR attributes (7).
Packit 7cfc04
.ad l
Packit 7cfc04
.TS
Packit 7cfc04
allbox;
Packit 7cfc04
lbw20 lb lb
Packit 7cfc04
l l l.
Packit 7cfc04
Interface	Attribute	Value
Packit 7cfc04
T{
Packit 7cfc04
.BR getc_unlocked (),
Packit 7cfc04
.BR putc_unlocked (),
Packit 7cfc04
.BR clearerr_unlocked (),
Packit 7cfc04
.BR fflush_unlocked (),
Packit 7cfc04
.BR fgetc_unlocked (),
Packit 7cfc04
.BR fputc_unlocked (),
Packit 7cfc04
.BR fread_unlocked (),
Packit 7cfc04
.BR fwrite_unlocked (),
Packit 7cfc04
.BR fgets_unlocked (),
Packit 7cfc04
.BR fputs_unlocked (),
Packit 7cfc04
.BR getwc_unlocked (),
Packit 7cfc04
.BR fgetwc_unlocked (),
Packit 7cfc04
.BR fputwc_unlocked (),
Packit 7cfc04
.BR putwc_unlocked (),
Packit 7cfc04
.BR fgetws_unlocked (),
Packit 7cfc04
.BR fputws_unlocked ()
Packit 7cfc04
T}	Thread safety	MT-Safe race:stream
Packit 7cfc04
T{
Packit 7cfc04
.BR getchar_unlocked (),
Packit 7cfc04
.BR getwchar_unlocked ()
Packit 7cfc04
T}	Thread safety	MT-Unsafe race:stdin
Packit 7cfc04
T{
Packit 7cfc04
.BR putchar_unlocked (),
Packit 7cfc04
.BR putwchar_unlocked ()
Packit 7cfc04
T}	Thread safety	MT-Unsafe race:stdout
Packit 7cfc04
T{
Packit 7cfc04
.BR feof_unlocked (),
Packit 7cfc04
.BR ferror_unlocked (),
Packit 7cfc04
.BR fileno_unlocked ()
Packit 7cfc04
T}	Thread safety	MT-Safe
Packit 7cfc04
.TE
Packit 7cfc04
.ad
Packit 7cfc04
.SH CONFORMING TO
Packit 7cfc04
The four functions
Packit 7cfc04
.BR getc_unlocked (),
Packit 7cfc04
.BR getchar_unlocked (),
Packit 7cfc04
.BR putc_unlocked (),
Packit 7cfc04
.BR putchar_unlocked ()
Packit 7cfc04
are in POSIX.1-2001 and POSIX.1-2008.
Packit 7cfc04
.PP
Packit 7cfc04
The nonstandard
Packit 7cfc04
.BR *_unlocked ()
Packit 7cfc04
variants occur on a few UNIX systems, and are available in recent glibc.
Packit 7cfc04
.\" E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
Packit 7cfc04
.\" moved to a compatibility library.
Packit 7cfc04
.\" Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
Packit 7cfc04
.\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
Packit 7cfc04
.\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
Packit 7cfc04
.\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
Packit 7cfc04
.\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
Packit 7cfc04
.\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
Packit 7cfc04
.\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
Packit 7cfc04
.\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
Packit 7cfc04
.\" ungetc_unlocked, ungetwc_unlocked.
Packit 7cfc04
They should probably not be used.
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR flockfile (3),
Packit 7cfc04
.BR stdio (3)
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.