summaryrefslogtreecommitdiff
path: root/static/v10/man3/fgets.3
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 21:07:28 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 21:07:28 -0400
commit711594636704defae873be1a355a292505585afd (patch)
tree59ee13f863830d8beba6cfd02bbe813dd486c26f /static/v10/man3/fgets.3
parent3258a063c1f189d7b019e40e525b46bef9b9a7b1 (diff)
docs: Added UNIX V10 Manuals
Diffstat (limited to 'static/v10/man3/fgets.3')
-rw-r--r--static/v10/man3/fgets.373
1 files changed, 73 insertions, 0 deletions
diff --git a/static/v10/man3/fgets.3 b/static/v10/man3/fgets.3
new file mode 100644
index 00000000..3e33caaf
--- /dev/null
+++ b/static/v10/man3/fgets.3
@@ -0,0 +1,73 @@
+.TH FGETS 3S
+.CT 2 file_io
+.SH NAME
+fgets, puts, fputs, gets \(mi string input/out on streams
+.SH SYNOPSIS
+.nf
+.B #include <stdio.h>
+.PP
+.B char *fgets(s, n, stream)
+.B char *s;
+.B FILE *stream;
+.PP
+.B int puts(s)
+.B char *s;
+.PP
+.B int fputs(s, stream)
+.B char *s;
+.B FILE *stream;
+.fi
+.SH DESCRIPTION
+.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.
+.PP
+.I Puts
+copies the null-terminated string
+.I s
+to the standard output stream
+.I stdout
+and appends a
+newline character.
+.PP
+.I Fputs
+copies the null-terminated string
+.I s
+to the named output
+.IR stream .
+.PP
+Neither routine copies the terminal null character.
+Both return the result of calling
+.IR putc
+with the last character written; see
+.IR getc (3).
+.SH "SEE ALSO"
+.IR getc (3)
+.IR stdio (3)
+.SH DIAGNOSTICS
+.IR Fgets
+returns a null pointer
+upon end of file or error.
+.SH BUGS
+For safety reasons the
+.SM ANSI
+standard function
+.BR "char *gets(s)" ,
+which reads from standard input up to a newline and
+discards the newline, is not supported.
+.br
+.I Puts
+appends a newline,
+.I fputs
+does not, all in the name of backward compatibility.