aboutsummaryrefslogtreecommitdiff
path: root/manual/stdio.texi
diff options
context:
space:
mode:
Diffstat (limited to 'manual/stdio.texi')
-rw-r--r--manual/stdio.texi495
1 files changed, 165 insertions, 330 deletions
diff --git a/manual/stdio.texi b/manual/stdio.texi
index 29f3fed89b..5d7b50c442 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -55,9 +55,8 @@ only in the technical sense.
@pindex stdio.h
The @code{FILE} type is declared in the header file @file{stdio.h}.
-@comment stdio.h
-@comment ISO
@deftp {Data Type} FILE
+@standards{ISO, stdio.h}
This is the data type used to represent stream objects. A @code{FILE}
object holds all of the internal state information about the connection
to the associated file, including such things as the file position
@@ -86,25 +85,22 @@ for the process.
These streams are declared in the header file @file{stdio.h}.
@pindex stdio.h
-@comment stdio.h
-@comment ISO
@deftypevar {FILE *} stdin
+@standards{ISO, stdio.h}
The @dfn{standard input} stream, which is the normal source of input for the
program.
@end deftypevar
@cindex standard input stream
-@comment stdio.h
-@comment ISO
@deftypevar {FILE *} stdout
+@standards{ISO, stdio.h}
The @dfn{standard output} stream, which is used for normal output from
the program.
@end deftypevar
@cindex standard output stream
-@comment stdio.h
-@comment ISO
@deftypevar {FILE *} stderr
+@standards{ISO, stdio.h}
The @dfn{standard error} stream, which is used for error messages and
diagnostics issued by the program.
@end deftypevar
@@ -145,9 +141,8 @@ involve creating a new file.
Everything described in this section is declared in the header file
@file{stdio.h}.
-@comment stdio.h
-@comment ISO
@deftypefun {FILE *} fopen (const char *@var{filename}, const char *@var{opentype})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@acsmem{} @acsfd{} @aculock{}}}
@c fopen may leak the list lock if cancelled within _IO_link_in.
The @code{fopen} function opens a stream for I/O to the file
@@ -264,9 +259,8 @@ programs (which can easily happen). It may be advantageous to use the
file locking facilities to avoid simultaneous access. @xref{File
Locks}.
-@comment stdio.h
-@comment Unix98
@deftypefun {FILE *} fopen64 (const char *@var{filename}, const char *@var{opentype})
+@standards{Unix98, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@acsmem{} @acsfd{} @aculock{}}}
This function is similar to @code{fopen} but the stream it returns a
pointer for is opened using @code{open64}. Therefore this stream can be
@@ -280,9 +274,8 @@ bits machine this function is available under the name @code{fopen}
and so transparently replaces the old interface.
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypevr Macro int FOPEN_MAX
+@standards{ISO, stdio.h}
The value of this macro is an integer constant expression that
represents the minimum number of streams that the implementation
guarantees can be open simultaneously. You might be able to open more
@@ -294,9 +287,8 @@ Limits}. In BSD and GNU, it is controlled by the @code{RLIMIT_NOFILE}
resource limit; @pxref{Limits on Resources}.
@end deftypevr
-@comment stdio.h
-@comment ISO
@deftypefun {FILE *} freopen (const char *@var{filename}, const char *@var{opentype}, FILE *@var{stream})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @acsfd{}}}
@c Like most I/O operations, this one is guarded by a recursive lock,
@c released even upon cancellation, but cancellation may leak file
@@ -338,9 +330,8 @@ When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} on a
interface replaces transparently the old interface.
@end deftypefun
-@comment stdio.h
-@comment Unix98
@deftypefun {FILE *} freopen64 (const char *@var{filename}, const char *@var{opentype}, FILE *@var{stream})
+@standards{Unix98, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @acsfd{}}}
This function is similar to @code{freopen}. The only difference is that
on 32 bit machine the stream returned is able to read beyond the
@@ -360,9 +351,8 @@ available and would have to be remembered separately. Solaris
introduced a few functions to get this information from the stream
descriptor and these functions are also available in @theglibc{}.
-@comment stdio_ext.h
-@comment GNU
@deftypefun int __freadable (FILE *@var{stream})
+@standards{GNU, stdio_ext.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
The @code{__freadable} function determines whether the stream
@var{stream} was opened to allow reading. In this case the return value
@@ -371,9 +361,8 @@ is nonzero. For write-only streams the function returns zero.
This function is declared in @file{stdio_ext.h}.
@end deftypefun
-@comment stdio_ext.h
-@comment GNU
@deftypefun int __fwritable (FILE *@var{stream})
+@standards{GNU, stdio_ext.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
The @code{__fwritable} function determines whether the stream
@var{stream} was opened to allow writing. In this case the return value
@@ -385,9 +374,8 @@ This function is declared in @file{stdio_ext.h}.
For slightly different kinds of problems there are two more functions.
They provide even finer-grained information.
-@comment stdio_ext.h
-@comment GNU
@deftypefun int __freading (FILE *@var{stream})
+@standards{GNU, stdio_ext.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
The @code{__freading} function determines whether the stream
@var{stream} was last read from or whether it is opened read-only. In
@@ -399,9 +387,8 @@ buffer, among other things.
This function is declared in @file{stdio_ext.h}.
@end deftypefun
-@comment stdio_ext.h
-@comment GNU
@deftypefun int __fwriting (FILE *@var{stream})
+@standards{GNU, stdio_ext.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
The @code{__fwriting} function determines whether the stream
@var{stream} was last written to or whether it is opened write-only. In
@@ -419,9 +406,8 @@ When a stream is closed with @code{fclose}, the connection between the
stream and the file is canceled. After you have closed a stream, you
cannot perform any additional operations on it.
-@comment stdio.h
-@comment ISO
@deftypefun int fclose (FILE *@var{stream})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@aculock{} @acsmem{} @acsfd{}}}
@c After fclose, it is undefined behavior to use the stream it points
@c to. Therefore, one must only call fclose when the stream is
@@ -456,9 +442,8 @@ The function @code{fclose} is declared in @file{stdio.h}.
To close all streams currently available @theglibc{} provides
another function.
-@comment stdio.h
-@comment GNU
@deftypefun int fcloseall (void)
+@standards{GNU, stdio.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:streams}}@asunsafe{}@acsafe{}}
@c Like fclose, using any previously-opened streams after fcloseall is
@c undefined. However, the implementation of fcloseall isn't equivalent
@@ -518,9 +503,8 @@ themselves would ensure only atomicity of their own operation, but not
atomicity over all the function calls. For this it is necessary to
perform the stream locking in the application code.
-@comment stdio.h
-@comment POSIX
@deftypefun void flockfile (FILE *@var{stream})
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acunsafe{@aculock{}}}
@c There's no way to tell whether the lock was acquired before or after
@c cancellation so as to unlock only when appropriate.
@@ -532,9 +516,8 @@ thread will block until the lock is acquired. An explicit call to
@code{funlockfile} has to be used to release the lock.
@end deftypefun
-@comment stdio.h
-@comment POSIX
@deftypefun int ftrylockfile (FILE *@var{stream})
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acunsafe{@aculock{}}}
The @code{ftrylockfile} function tries to acquire the internal locking
object associated with the stream @var{stream} just like
@@ -544,9 +527,8 @@ the lock was successfully acquired. Otherwise the stream is locked by
another thread.
@end deftypefun
-@comment stdio.h
-@comment POSIX
@deftypefun void funlockfile (FILE *@var{stream})
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acunsafe{@aculock{}}}
The @code{funlockfile} function releases the internal locking object of
the stream @var{stream}. The stream must have been locked before by a
@@ -670,9 +652,8 @@ manipulation of the buffer of the stream.
A second way to avoid locking is by using a non-standard function which
was introduced in Solaris and is available in @theglibc{} as well.
-@comment stdio_ext.h
-@comment GNU
@deftypefun int __fsetlocking (FILE *@var{stream}, int @var{type})
+@standards{GNU, stdio_ext.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asulock{}}@acsafe{}}
@c Changing the implicit-locking status of a stream while it's in use by
@c another thread may cause a lock to be implicitly acquired and not
@@ -783,9 +764,8 @@ a stream. There are no diagnostics issued. The application behavior
will simply be strange or the application will simply crash. The
@code{fwide} function can help avoid this.
-@comment wchar.h
-@comment ISO
@deftypefun int fwide (FILE *@var{stream}, int @var{mode})
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{}}}
@c Querying is always safe, but changing the stream when it's in use
@c upthread may be problematic. Like most lock-acquiring functions,
@@ -873,9 +853,8 @@ These narrow stream functions are declared in the header file
@pindex stdio.h
@pindex wchar.h
-@comment stdio.h
-@comment ISO
@deftypefun int fputc (int @var{c}, FILE *@var{stream})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @aculock{}}}
@c If the stream is in use when interrupted by a signal, the recursive
@c lock won't help ensure the stream is consistent; indeed, if fputc
@@ -892,18 +871,16 @@ The @code{fputc} function converts the character @var{c} to type
character @var{c} is returned.
@end deftypefun
-@comment wchar.h
-@comment ISO
@deftypefun wint_t fputwc (wchar_t @var{wc}, FILE *@var{stream})
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @aculock{}}}
The @code{fputwc} function writes the wide character @var{wc} to the
stream @var{stream}. @code{WEOF} is returned if a write error occurs;
otherwise the character @var{wc} is returned.
@end deftypefun
-@comment stdio.h
-@comment POSIX
@deftypefun int fputc_unlocked (int @var{c}, FILE *@var{stream})
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
@c The unlocked functions can't possibly satisfy the MT-Safety
@c requirements on their own, because they require external locking for
@@ -912,9 +889,8 @@ The @code{fputc_unlocked} function is equivalent to the @code{fputc}
function except that it does not implicitly lock the stream.
@end deftypefun
-@comment wchar.h
-@comment POSIX
@deftypefun wint_t fputwc_unlocked (wchar_t @var{wc}, FILE *@var{stream})
+@standards{POSIX, wchar.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{fputwc_unlocked} function is equivalent to the @code{fputwc}
function except that it does not implicitly lock the stream.
@@ -922,9 +898,8 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypefun int putc (int @var{c}, FILE *@var{stream})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @aculock{}}}
This is just like @code{fputc}, except that most systems implement it as
a macro, making it faster. One consequence is that it may evaluate the
@@ -933,9 +908,8 @@ general rule for macros. @code{putc} is usually the best function to
use for writing a single character.
@end deftypefun
-@comment wchar.h
-@comment ISO
@deftypefun wint_t putwc (wchar_t @var{wc}, FILE *@var{stream})
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @aculock{}}}
This is just like @code{fputwc}, except that it can be implement as
a macro, making it faster. One consequence is that it may evaluate the
@@ -944,17 +918,15 @@ general rule for macros. @code{putwc} is usually the best function to
use for writing a single wide character.
@end deftypefun
-@comment stdio.h
-@comment POSIX
@deftypefun int putc_unlocked (int @var{c}, FILE *@var{stream})
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{putc_unlocked} function is equivalent to the @code{putc}
function except that it does not implicitly lock the stream.
@end deftypefun
-@comment wchar.h
-@comment GNU
@deftypefun wint_t putwc_unlocked (wchar_t @var{wc}, FILE *@var{stream})
+@standards{GNU, wchar.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{putwc_unlocked} function is equivalent to the @code{putwc}
function except that it does not implicitly lock the stream.
@@ -962,33 +934,29 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypefun int putchar (int @var{c})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @aculock{}}}
The @code{putchar} function is equivalent to @code{putc} with
@code{stdout} as the value of the @var{stream} argument.
@end deftypefun
-@comment wchar.h
-@comment ISO
@deftypefun wint_t putwchar (wchar_t @var{wc})
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @aculock{}}}
The @code{putwchar} function is equivalent to @code{putwc} with
@code{stdout} as the value of the @var{stream} argument.
@end deftypefun
-@comment stdio.h
-@comment POSIX
@deftypefun int putchar_unlocked (int @var{c})
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:stdout}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{putchar_unlocked} function is equivalent to the @code{putchar}
function except that it does not implicitly lock the stream.
@end deftypefun
-@comment wchar.h
-@comment GNU
@deftypefun wint_t putwchar_unlocked (wchar_t @var{wc})
+@standards{GNU, wchar.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:stdout}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{putwchar_unlocked} function is equivalent to the @code{putwchar}
function except that it does not implicitly lock the stream.
@@ -996,9 +964,8 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypefun int fputs (const char *@var{s}, FILE *@var{stream})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @aculock{}}}
The function @code{fputs} writes the string @var{s} to the stream
@var{stream}. The terminating null character is not written.
@@ -1020,9 +987,8 @@ fputs ("hungry?\n", stdout);
outputs the text @samp{Are you hungry?} followed by a newline.
@end deftypefun
-@comment wchar.h
-@comment ISO
@deftypefun int fputws (const wchar_t *@var{ws}, FILE *@var{stream})
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{} @aculock{}}}
The function @code{fputws} writes the wide character string @var{ws} to
the stream @var{stream}. The terminating null character is not written.
@@ -1033,9 +999,8 @@ This function returns @code{WEOF} if a write error occurs, and otherwise
a non-negative value.
@end deftypefun
-@comment stdio.h
-@comment GNU
@deftypefun int fputs_unlocked (const char *@var{s}, FILE *@var{stream})
+@standards{GNU, stdio.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{fputs_unlocked} function is equivalent to the @code{fputs}
function except that it does not implicitly lock the stream.
@@ -1043,9 +1008,8 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment wchar.h
-@comment GNU
@deftypefun int fputws_unlocked (const wchar_t *@var{ws}, FILE *@var{stream})
+@standards{GNU, wchar.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{fputws_unlocked} function is equivalent to the @code{fputws}
function except that it does not implicitly lock the stream.
@@ -1053,9 +1017,8 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypefun int puts (const char *@var{s})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
The @code{puts} function writes the string @var{s} to the stream
@code{stdout} followed by a newline. The terminating null character of
@@ -1073,9 +1036,8 @@ puts ("This is a message.");
outputs the text @samp{This is a message.} followed by a newline.
@end deftypefun
-@comment stdio.h
-@comment SVID
@deftypefun int putw (int @var{w}, FILE *@var{stream})
+@standards{SVID, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
This function writes the word @var{w} (that is, an @code{int}) to
@var{stream}. It is provided for compatibility with SVID, but we
@@ -1106,9 +1068,8 @@ that it is no longer distinguishable from the valid character
you've verified that the result is not @code{EOF}, you can be sure that
it will fit in a @samp{char} variable without loss of information.
-@comment stdio.h
-@comment ISO
@deftypefun int fgetc (FILE *@var{stream})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
@c Same caveats as fputc, but instead of losing a write in case of async
@c signals, we may read the same character more than once, and the
@@ -1120,26 +1081,23 @@ the stream @var{stream} and returns its value, converted to an
@code{EOF} is returned instead.
@end deftypefun
-@comment wchar.h
-@comment ISO
@deftypefun wint_t fgetwc (FILE *@var{stream})
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
This function reads the next wide character from the stream @var{stream}
and returns its value. If an end-of-file condition or read error
occurs, @code{WEOF} is returned instead.
@end deftypefun
-@comment stdio.h
-@comment POSIX
@deftypefun int fgetc_unlocked (FILE *@var{stream})
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{fgetc_unlocked} function is equivalent to the @code{fgetc}
function except that it does not implicitly lock the stream.
@end deftypefun
-@comment wchar.h
-@comment GNU
@deftypefun wint_t fgetwc_unlocked (FILE *@var{stream})
+@standards{GNU, wchar.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{fgetwc_unlocked} function is equivalent to the @code{fgetwc}
function except that it does not implicitly lock the stream.
@@ -1147,9 +1105,8 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypefun int getc (FILE *@var{stream})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
This is just like @code{fgetc}, except that it is permissible (and
typical) for it to be implemented as a macro that evaluates the
@@ -1158,9 +1115,8 @@ optimized, so it is usually the best function to use to read a single
character.
@end deftypefun
-@comment wchar.h
-@comment ISO
@deftypefun wint_t getwc (FILE *@var{stream})
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
This is just like @code{fgetwc}, except that it is permissible for it to
be implemented as a macro that evaluates the @var{stream} argument more
@@ -1168,17 +1124,15 @@ than once. @code{getwc} can be highly optimized, so it is usually the
best function to use to read a single wide character.
@end deftypefun
-@comment stdio.h
-@comment POSIX
@deftypefun int getc_unlocked (FILE *@var{stream})
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{getc_unlocked} function is equivalent to the @code{getc}
function except that it does not implicitly lock the stream.
@end deftypefun
-@comment wchar.h
-@comment GNU
@deftypefun wint_t getwc_unlocked (FILE *@var{stream})
+@standards{GNU, wchar.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{getwc_unlocked} function is equivalent to the @code{getwc}
function except that it does not implicitly lock the stream.
@@ -1186,33 +1140,29 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypefun int getchar (void)
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
The @code{getchar} function is equivalent to @code{getc} with @code{stdin}
as the value of the @var{stream} argument.
@end deftypefun
-@comment wchar.h
-@comment ISO
@deftypefun wint_t getwchar (void)
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
The @code{getwchar} function is equivalent to @code{getwc} with @code{stdin}
as the value of the @var{stream} argument.
@end deftypefun
-@comment stdio.h
-@comment POSIX
@deftypefun int getchar_unlocked (void)
+@standards{POSIX, stdio.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:stdin}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{getchar_unlocked} function is equivalent to the @code{getchar}
function except that it does not implicitly lock the stream.
@end deftypefun
-@comment wchar.h
-@comment GNU
@deftypefun wint_t getwchar_unlocked (void)
+@standards{GNU, wchar.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:stdin}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{getwchar_unlocked} function is equivalent to the @code{getwchar}
function except that it does not implicitly lock the stream.
@@ -1253,9 +1203,8 @@ y_or_n_p (const char *question)
@}
@end smallexample
-@comment stdio.h
-@comment SVID
@deftypefun int getw (FILE *@var{stream})
+@standards{SVID, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
This function reads a word (that is, an @code{int}) from @var{stream}.
It's provided for compatibility with SVID. We recommend you use
@@ -1282,9 +1231,8 @@ occurrence of a specified delimiter character.
All these functions are declared in @file{stdio.h}.
-@comment stdio.h
-@comment GNU
@deftypefun ssize_t getline (char **@var{lineptr}, size_t *@var{n}, FILE *@var{stream})
+@standards{GNU, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@aculock{} @acucorrupt{} @acsmem{}}}
@c Besides the usual possibility of getting an inconsistent stream in a
@c signal handler or leaving it inconsistent in case of cancellation,
@@ -1324,9 +1272,8 @@ If an error occurs or end of file is reached without any bytes read,
@code{getline} returns @code{-1}.
@end deftypefun
-@comment stdio.h
-@comment GNU
@deftypefun ssize_t getdelim (char **@var{lineptr}, size_t *@var{n}, int @var{delimiter}, FILE *@var{stream})
+@standards{GNU, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@aculock{} @acucorrupt{} @acsmem{}}}
@c See the getline @acucorrupt note.
This function is like @code{getline} except that the character which
@@ -1350,9 +1297,8 @@ getline (char **lineptr, size_t *n, FILE *stream)
@end smallexample
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypefun {char *} fgets (char *@var{s}, int @var{count}, FILE *@var{stream})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
The @code{fgets} function reads characters from the stream @var{stream}
up to and including a newline character and stores them in the string
@@ -1374,9 +1320,8 @@ a null character, you should either handle it properly or print a clear
error message. We recommend using @code{getline} instead of @code{fgets}.
@end deftypefun
-@comment wchar.h
-@comment ISO
@deftypefun {wchar_t *} fgetws (wchar_t *@var{ws}, int @var{count}, FILE *@var{stream})
+@standards{ISO, wchar.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
The @code{fgetws} function reads wide characters from the stream
@var{stream} up to and including a newline character and stores them in
@@ -1400,9 +1345,8 @@ message.
@comment XXX We need getwline!!!
@end deftypefun
-@comment stdio.h
-@comment GNU
@deftypefun {char *} fgets_unlocked (char *@var{s}, int @var{count}, FILE *@var{stream})
+@standards{GNU, stdio.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{fgets_unlocked} function is equivalent to the @code{fgets}
function except that it does not implicitly lock the stream.
@@ -1410,9 +1354,8 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment wchar.h
-@comment GNU
@deftypefun {wchar_t *} fgetws_unlocked (wchar_t *@var{ws}, int @var{count}, FILE *@var{stream})
+@standards{GNU, wchar.h}
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
The @code{fgetws_unlocked} function is equivalent to the @code{fgetws}
function except that it does not implicitly lock the stream.
@@ -1420,9 +1363,8 @@ function except that it does not implicitly lock the stream.
This function is a GNU extension.
@end deftypefun
-@comment stdio.h
-@comment ISO
@deftypefn {Deprecated function} {char *} gets (char *@var{s})
+@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}}
The function @code{gets} reads characters from the stream @code{stdin}
up to the next newline character, and stores them in the string @var{s}.
@@ -1511,9 +1453,8 @@ so that the next input characters will be @samp{9} and @samp{b}.
The function to unread a character is called @code{ungetc}, because it
reverses the action of @code