*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: fgets | Section: 3 | Source: UNIX v10 | File: fgets.3
FGETS(3S) FGETS(3S) NAME fgets, puts, fputs, gets - string input/out on streams SYNOPSIS #include <stdio.h> char *fgets(s, n, stream) char *s; FILE *stream; int puts(s) char *s; int fputs(s, stream) char *s; FILE *stream; DESCRIPTION Fgets reads n-1 characters, or up to a newline character, whichever comes first, from the stream into the string s. The last character read into s is followed by a null character. Fgets returns its first argument. Puts copies the null-terminated string s to the standard output stream stdout and appends a newline character. Fputs copies the null-terminated string s to the named output stream. Neither routine copies the terminal null character. Both return the result of calling putc with the last character written; see getc(3). SEE ALSO getc(3) stdio(3) DIAGNOSTICS Fgets returns a null pointer upon end of file or error. Puts and fputs return the constant on write error. BUGS For safety reasons the ANSI standard function char *gets(s), which reads from standard input up to a newline and discards the newline, is not supported. Puts appends a newline, fputs does not, all in the name of backward compatibility. FGETS(3S)

Navigation Options