diff options
| author | Alejandro Colomar <alx@kernel.org> | 2025-10-09 12:12:50 +0200 |
|---|---|---|
| committer | Alejandro Colomar <alx@kernel.org> | 2025-10-10 00:18:30 +0200 |
| commit | d8cfe5d33c48e0d9d676eb585b759ecf753ca47f (patch) | |
| tree | 97a42ef59a1038812b950057c43cb3a274885938 /man/man3/fgetc.3 | |
| parent | 5ad7c36ee44ff4abfb6252c63e9030b67fb45f68 (diff) | |
| download | man-pages-d8cfe5d33c48e0d9d676eb585b759ecf753ca47f.tar.gz | |
man/man3/[f]getc.3: Document that getc(3) should not be used
Move getc(3) to a separate manual page, documenting the bugs
of this API, and recommending fgetc(3) instead. While the
relevant standards (ISO C and POSIX) don't deprecate this
API, let's deprecate it here.
Cc: <onf@disroot.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man3/fgetc.3')
| -rw-r--r-- | man/man3/fgetc.3 | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/man/man3/fgetc.3 b/man/man3/fgetc.3 index a2e49bd8f9..af0059e94e 100644 --- a/man/man3/fgetc.3 +++ b/man/man3/fgetc.3 @@ -5,7 +5,7 @@ .\" .TH fgetc 3 (date) "Linux man-pages (unreleased)" .SH NAME -fgetc, fgets, getc, getchar, ungetc \- input of characters and strings +fgetc, fgets, getchar, ungetc \- input of characters and strings .SH LIBRARY Standard C library .RI ( libc ,\~ \-lc ) @@ -14,7 +14,6 @@ Standard C library .B #include <stdio.h> .P .BI "int fgetc(FILE *" stream ); -.BI "int getc(FILE *" stream ); .B "int getchar(void);" .P .BR "char *fgets(" "int size;" @@ -34,16 +33,9 @@ or .B EOF on end of file or error. .P -.BR getc () -is equivalent to -.BR fgetc () -except that it may be implemented as a macro which evaluates -.I stream -more than once. -.P .BR getchar () is equivalent to -.IR getc(stdin) . +.IR fgetc(stdin) . .P .BR fgets () reads in at most one less than @@ -79,8 +71,7 @@ library for the same input stream. For nonlocking counterparts, see .BR unlocked_stdio (3). .SH RETURN VALUE -.BR fgetc (), -.BR getc (), +.BR fgetc () and .BR getchar () return the character read as an @@ -116,7 +107,6 @@ T{ .nh .BR fgetc (), .BR fgets (), -.BR getc (), .BR getchar (), .BR ungetc () T} Thread safety MT-Safe |
