From 1382c0b2f7f05b29038219e3f4c6085cb1bc7ab7 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Tue, 5 Mar 1991 22:54:41 -0800 Subject: [PATCH 1/1] man page pass, minor cleanups SCCS-vsn: lib/libc/stdio/fgetln.3 5.3 SCCS-vsn: lib/libc/stdio/fgets.3 6.7 SCCS-vsn: lib/libc/stdio/fread.3 6.4 SCCS-vsn: lib/libc/stdio/fseek.3 6.7 SCCS-vsn: lib/libc/stdio/getc.3 6.5 SCCS-vsn: lib/libc/stdio/mktemp.3 6.8 SCCS-vsn: lib/libc/string/strerror.3 6.5 SCCS-vsn: lib/libc/stdio/printf.3 6.9 SCCS-vsn: lib/libc/stdio/setbuf.3 6.7 SCCS-vsn: lib/libc/stdio/stdio.3 6.4 --- usr/src/lib/libc/stdio/fgetln.3 | 8 ++-- usr/src/lib/libc/stdio/fgets.3 | 11 +++-- usr/src/lib/libc/stdio/fread.3 | 11 ++++- usr/src/lib/libc/stdio/fseek.3 | 11 ++--- usr/src/lib/libc/stdio/getc.3 | 4 +- usr/src/lib/libc/stdio/mktemp.3 | 13 +++--- usr/src/lib/libc/stdio/printf.3 | 4 +- usr/src/lib/libc/stdio/setbuf.3 | 6 +-- usr/src/lib/libc/stdio/stdio.3 | 73 +++++------------------------- usr/src/lib/libc/string/strerror.3 | 23 +++++----- 10 files changed, 60 insertions(+), 104 deletions(-) diff --git a/usr/src/lib/libc/stdio/fgetln.3 b/usr/src/lib/libc/stdio/fgetln.3 index ec7034dd97..ac97551db6 100644 --- a/usr/src/lib/libc/stdio/fgetln.3 +++ b/usr/src/lib/libc/stdio/fgetln.3 @@ -3,7 +3,7 @@ .\" .\" %sccs.include.redist.man% .\" -.\" @(#)fgetln.3 5.2 (Berkeley) %G% +.\" @(#)fgetln.3 5.3 (Berkeley) %G% .\" .TH FGETLINE 3 "" .UC 7 @@ -37,9 +37,9 @@ or as soon as the stream is closed. Otherwise, NULL is returned. .I Fgetline does not distinguish between end-of-file and error, and callers must use -.I feof +.IR feof (3) and -.I ferror +.IR ferror (3) to determine which occurred. If an error occurrs, the global variable .I errno @@ -47,7 +47,7 @@ is set to indicate the error. The end-of-file condition is remembered, even on a terminal, and all subsequent attempts to read will return NULL until the condition is cleared with -.IR clearerr . +.IR clearerr (3). .PP The text to which the returned pointer points may be modified, provided that no changes are made beyond the terminating NUL. diff --git a/usr/src/lib/libc/stdio/fgets.3 b/usr/src/lib/libc/stdio/fgets.3 index 8bc1eef9e0..58869ab4ef 100644 --- a/usr/src/lib/libc/stdio/fgets.3 +++ b/usr/src/lib/libc/stdio/fgets.3 @@ -6,7 +6,7 @@ .\" .\" %sccs.include.redist.man% .\" -.\" @(#)fgets.3 6.6 (Berkeley) %G% +.\" @(#)fgets.3 6.7 (Berkeley) %G% .\" .TH FGETS 3 "" .UC 7 @@ -59,10 +59,13 @@ return .IR s . If end-of-file or an error occurs before any characters are read, they return NULL. -Callers must use -.I feof +.I Fgets +and +.I gets +do not distinguish between end-of-file and error, and callers must use +.IR feof (3) and -.I ferror +.I ferror (3) to determine which occurred. .SH ERRORS .TP 15 diff --git a/usr/src/lib/libc/stdio/fread.3 b/usr/src/lib/libc/stdio/fread.3 index 4ca661ccf2..ae5ad0821a 100644 --- a/usr/src/lib/libc/stdio/fread.3 +++ b/usr/src/lib/libc/stdio/fread.3 @@ -6,7 +6,7 @@ .\" .\" %sccs.include.redist.man% .\" -.\" @(#)fread.3 6.3 (Berkeley) %G% +.\" @(#)fread.3 6.4 (Berkeley) %G% .\" .TH FREAD 3 "" .UC 7 @@ -41,6 +41,13 @@ in the event of an .B EOF or error). .PP +Fread does not distinguish between end-of-file and error, and callers +must use +.IR feof (3) +and +.IR ferror (3) +to determine which occurred. +.PP .I Fwrite writes .I count @@ -54,4 +61,4 @@ It returns the actual count of items written. .SH "RETURN VALUE" These functions return 0 (or a short count) upon end of file or error. .SH "SEE ALSO" -read(2), write(2), fopen(3), getc(3), putc(3), stdio(3) +read(2), write(2) diff --git a/usr/src/lib/libc/stdio/fseek.3 b/usr/src/lib/libc/stdio/fseek.3 index 10c107ef66..e4b702b17a 100644 --- a/usr/src/lib/libc/stdio/fseek.3 +++ b/usr/src/lib/libc/stdio/fseek.3 @@ -6,7 +6,7 @@ .\" .\" %sccs.include.redist.man% .\" -.\" @(#)fseek.3 6.6 (Berkeley) %G% +.\" @(#)fseek.3 6.7 (Berkeley) %G% .\" .TH FSEEK 3 "" .UC 7 @@ -45,13 +45,8 @@ value of .IR whence . If .I whence -is set to -.IR SEEK_SET , -.IR SEEK_CUR , -or -.IR SEEK_END , -the offset is from the beginning, the current position, or the end of -the file, respectively. +is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is from the +beginning, the current position, or the end of the file, respectively. .I Fseek undoes any effects of .IR ungetc . diff --git a/usr/src/lib/libc/stdio/getc.3 b/usr/src/lib/libc/stdio/getc.3 index e7d9a8a84d..bcec321fa6 100644 --- a/usr/src/lib/libc/stdio/getc.3 +++ b/usr/src/lib/libc/stdio/getc.3 @@ -6,7 +6,7 @@ .\" .\" %sccs.include.redist.man% .\" -.\" @(#)getc.3 6.4 (Berkeley) %G% +.\" @(#)getc.3 6.5 (Berkeley) %G% .\" .TH GETC 3 "" .UC 7 @@ -24,7 +24,7 @@ int getc(FILE *stream); int -getchar() +getchar(); int getw(FILE *stream); diff --git a/usr/src/lib/libc/stdio/mktemp.3 b/usr/src/lib/libc/stdio/mktemp.3 index 810da34091..36e913160b 100644 --- a/usr/src/lib/libc/stdio/mktemp.3 +++ b/usr/src/lib/libc/stdio/mktemp.3 @@ -3,7 +3,7 @@ .\" .\" %sccs.include.redist.man% .\" -.\" @(#)mktemp.3 6.7 (Berkeley) %G% +.\" @(#)mktemp.3 6.8 (Berkeley) %G% .\" .TH MKTEMP 3 "" .AT 3 @@ -12,12 +12,11 @@ mktemp \- create a unique file name .SH SYNOPSIS .nf .ft B -char * -mktemp(template) -char *template; -.sp -mkstemp(template) -char *template; +#include + +char *mktemp(char *template); + +int mkstemp(char *template); .ft R .fi .SH DESCRIPTION diff --git a/usr/src/lib/libc/stdio/printf.3 b/usr/src/lib/libc/stdio/printf.3 index 2a2a550b1f..1daf8bca77 100644 --- a/usr/src/lib/libc/stdio/printf.3 +++ b/usr/src/lib/libc/stdio/printf.3 @@ -6,7 +6,7 @@ .\" .\" %sccs.include.redist.man% .\" -.\" @(#)printf.3 6.8 (Berkeley) %G% +.\" @(#)printf.3 6.9 (Berkeley) %G% .\" .TH PRINTF 3 "" .UC 7 @@ -546,7 +546,7 @@ char *newfmt(va_alist) .RE .fi .SH "SEE ALSO" -malloc(3), putc(3), scanf(3) +printf(1), scanf(3) .SH BUGS The conversion formats `%D', `%O', and `%U' are not standard and are provided only for backward compatibility. diff --git a/usr/src/lib/libc/stdio/setbuf.3 b/usr/src/lib/libc/stdio/setbuf.3 index 2078763221..cf072a928d 100644 --- a/usr/src/lib/libc/stdio/setbuf.3 +++ b/usr/src/lib/libc/stdio/setbuf.3 @@ -2,7 +2,7 @@ .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)setbuf.3 6.6 (Berkeley) %G% +.\" @(#)setbuf.3 6.7 (Berkeley) %G% .\" .TH SETBUF 3 .UC 4 @@ -117,13 +117,13 @@ fopen(3), fclose(3), fread(3), malloc(3), puts(3), printf(3) .I Setbuf and .I setvbuf -onform to ANSI X3.159-1989 (``ANSI C''). +conform to ANSI X3.159-1989 (``ANSI C''). .SH BUGS The .I setbuffer and .I setlinebuf -functions are not portable to non-4.2BSD versions of UNIX. +functions are not portable to versions of BSD UNIX before 4.2BSD. On 4.2BSD and 4.3BSD systems, .I setbuf always uses a suboptimal buffer size and should be avoided. diff --git a/usr/src/lib/libc/stdio/stdio.3 b/usr/src/lib/libc/stdio/stdio.3 index 525fa2cf0c..dbdced782d 100644 --- a/usr/src/lib/libc/stdio/stdio.3 +++ b/usr/src/lib/libc/stdio/stdio.3 @@ -2,7 +2,7 @@ .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)stdio.3 6.3 (Berkeley) %G% +.\" @(#)stdio.3 6.4 (Berkeley) %G% .\" .TH STDIO 3 "" .UC 4 @@ -84,41 +84,13 @@ The following are implemented as macros; these names may not be reused without first removing their current definitions with .BR #undef : -.IR NULL , -.IR BUFSIZ , -.IR EOF , -.IR FOPEN_MAX , -.IR FILENAME_MAX , -.IR L_tmpnam , -.IR SEEK_SET , -.IR SEE_CUR , -.IR SEEK_END , -.IR TMP_MAX , -.IR stdin , -.IR stdout , -.IR stderr , -.IR fropen , -.IR fwopen , -.IR feof , -.IR ferror , -.IR clearerr , -.IR fileno , -.IR getc , -.IR getchar , -.IR putc , -.IR putchar , -.IR L_cuserid . -Function versions of the macro functions -.IR feof , -.IR ferror , -.IR clearerr , -.IR fileno , -.IR getc , -.IR getchar , -.IR putc , -and -.I putchar -exist and will be used if the macros definitions are explicitly removed. +BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_cuserid, L_tmpnam, NULL, +SEEK_END, SEEK_SET, SEE_CUR, TMP_MAX, clearerr, feof, ferror, +fileno, fropen, fwopen, getc, getchar, putc, putchar, stderr, +stdin, stdout. +Function versions of the macro functions feof, ferror, clearerr, fileno, +getc, getchar, putc, and putchar exist and will be used if the macros +definitions are explicitly removed. .PP Output streams that refer to terminal devices are always line buffered by default; @@ -132,7 +104,7 @@ will appear. .SH "SEE ALSO" open(2), close(2), read(2), write(2) .br -all of the manuals listed below +all of the manual entries listed below .SH "RETURN VALUE" The value .SM @@ -193,41 +165,20 @@ putc putc.3 put a character or word to a stream putchar putc.3 put a character or word to a stream puts fputs.3 put a line to a stream putw putc.3 put a character or word to a stream -remove remove.3 remove a file xxx +remove remove.3 remove a file rewind fseek.3 reposition a stream scanf scanf.3 formatted input conversion setbuf setvbuf.3 assign buffering to a stream setbuffer setvbuf.3 assign buffering to a stream setlinebuf setvbuf.3 assign buffering to a stream setvbuf setvbuf.3 assign buffering to a stream -.\" smprintf printf.3 formatted output conversion snprintf printf.3 formatted output conversion sprintf printf.3 formatted output conversion -tmpfile xxx.3 xxx -tmpnam xxx.3 xxx +tmpfile tmpnam.3 create a temporary stream +tmpnam tmpnam.3 create a temporary file name ungetc ungetc.3 push character back into input stream vfprintf printf.3 formatted output conversion vprintf printf.3 formatted output conversion -.\" vsmprintf printf.3 formatted output conversion vsnprintf printf.3 formatted output conversion vsprintf printf.3 formatted output conversion .fi -.sp 2 -Although these have nothing to do with `standard I/O', -the following declarations also appear in -.RI < stdio.h > -as required by ANSI X3.159-1989 and IEEE 1003.2 standards: -.sp -.nf -.ta \w'setlinebuf'u+2n +\w'setvbuf.3'u+10n -\fIName\fP \fIAppears on Page\fP \fIDescription\fP -.ta \w'setlinebuf'u+4n +\w'setvbuf.3'u+4n -.sp 5p -cuserid cuserid.3 xxx -getlogin getlogin.3 get login name -pclose popen.3 initiate I/O to/from a process -perror strerror.3 xxx -popen popen.3 initiate I/O to/from a process -remove remove.3 xxx -rename rename.2 xxx -.fi diff --git a/usr/src/lib/libc/string/strerror.3 b/usr/src/lib/libc/string/strerror.3 index f006d806a6..5c50d58fcd 100644 --- a/usr/src/lib/libc/string/strerror.3 +++ b/usr/src/lib/libc/string/strerror.3 @@ -2,7 +2,7 @@ .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)strerror.3 6.4 (Berkeley) %G% +.\" @(#)strerror.3 6.5 (Berkeley) %G% .\" .TH PERROR 3 "" .UC 4 @@ -10,15 +10,16 @@ perror, strerror, sys_errlist, sys_nerr \- system error messages .SH SYNOPSIS .nf -.B perror(string) -.B char *string; -.PP -.B char * -.B strerror(errnum) -.B int errnum; -.PP -.B extern int errno, sys_nerr; -.B extern char *sys_errlist[]; +.ft B +extern int errno, sys_nerr; +extern char *sys_errlist[]; + +#include + +void perror(const char *string); + +char *strerror(int errnum); +.ft R .fi .SH DESCRIPTION .I Perror @@ -52,4 +53,4 @@ variables is deprecated; .I strerror should be used instead. .SH "SEE ALSO" -intro(2) +intro(2), psignal(3) -- 2.20.1