manual page distributed with 4.1BSD
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 16 May 1985 06:00:59 +0000 (22:00 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 16 May 1985 06:00:59 +0000 (22:00 -0800)
SCCS-vsn: lib/libc/stdio/fgets.3 4.1
SCCS-vsn: lib/libc/stdio/gets.3 4.1

usr/src/lib/libc/stdio/fgets.3 [new file with mode: 0644]
usr/src/lib/libc/stdio/gets.3 [new file with mode: 0644]

diff --git a/usr/src/lib/libc/stdio/fgets.3 b/usr/src/lib/libc/stdio/fgets.3
new file mode 100644 (file)
index 0000000..f6e9065
--- /dev/null
@@ -0,0 +1,65 @@
+.\"    @(#)fgets.3     4.1 (Berkeley) %G%
+.\"
+.TH GETS 3S 
+.AT 3
+.SH NAME
+gets, fgets \- get a string from a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B char *gets(s)
+.br
+.B char *s;
+.PP
+.B char *fgets(s, n, stream)
+.br
+.B char *s;
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Gets
+reads a string into
+.I s
+from the standard input stream
+.B stdin.
+The string is terminated by a newline
+character, which is replaced in
+.I s
+by a null character.
+.I Gets
+returns its argument.
+.PP
+.I Fgets
+reads 
+.IR n \-1
+characters, or up to a newline
+character, whichever comes first,
+from the
+.I stream
+into the string
+.IR s .
+The last character read into
+.I s
+is followed by a null character.
+.I Fgets
+returns its first argument.
+.SH "SEE ALSO"
+puts(3),
+getc(3), scanf(3), fread(3),
+ferror(3)
+.SH DIAGNOSTICS
+.I Gets
+and
+.I fgets
+return the constant pointer 
+.SM
+.B NULL
+upon end of file or error.
+.SH BUGS
+.I Gets
+deletes a newline,
+.I fgets
+keeps it,
+all in the name of backward compatibility.
diff --git a/usr/src/lib/libc/stdio/gets.3 b/usr/src/lib/libc/stdio/gets.3
new file mode 100644 (file)
index 0000000..00d323f
--- /dev/null
@@ -0,0 +1,65 @@
+.\"    @(#)gets.3      4.1 (Berkeley) %G%
+.\"
+.TH GETS 3S 
+.AT 3
+.SH NAME
+gets, fgets \- get a string from a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B char *gets(s)
+.br
+.B char *s;
+.PP
+.B char *fgets(s, n, stream)
+.br
+.B char *s;
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Gets
+reads a string into
+.I s
+from the standard input stream
+.B stdin.
+The string is terminated by a newline
+character, which is replaced in
+.I s
+by a null character.
+.I Gets
+returns its argument.
+.PP
+.I Fgets
+reads 
+.IR n \-1
+characters, or up to a newline
+character, whichever comes first,
+from the
+.I stream
+into the string
+.IR s .
+The last character read into
+.I s
+is followed by a null character.
+.I Fgets
+returns its first argument.
+.SH "SEE ALSO"
+puts(3),
+getc(3), scanf(3), fread(3),
+ferror(3)
+.SH DIAGNOSTICS
+.I Gets
+and
+.I fgets
+return the constant pointer 
+.SM
+.B NULL
+upon end of file or error.
+.SH BUGS
+.I Gets
+deletes a newline,
+.I fgets
+keeps it,
+all in the name of backward compatibility.