Commit | Line | Data |
---|---|---|
8937b634 KB |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
85d99438 | 3 | .\" |
8937b634 KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" Chris Torek. | |
6 | .\" | |
7 | .\" %sccs.include.redist.man% | |
8 | .\" | |
9 | .\" @(#)fputs.3 6.3 (Berkeley) %G% | |
10 | .\" | |
11 | .TH FPUTS 3 "" | |
12 | .UC 7 | |
85d99438 | 13 | .SH NAME |
8937b634 | 14 | fputs, puts \- put a line to a stream |
85d99438 | 15 | .SH SYNOPSIS |
8937b634 KB |
16 | .nf |
17 | .ft B | |
18 | #include <stdio.h> | |
19 | ||
20 | int | |
21 | fputs(char *str, FILE *stream); | |
22 | ||
23 | int | |
24 | puts(char *str); | |
25 | .ft R | |
26 | .fi | |
85d99438 | 27 | .SH DESCRIPTION |
85d99438 | 28 | .I Fputs |
8937b634 KB |
29 | writes the string |
30 | .I str | |
31 | to the given | |
85d99438 KM |
32 | .IR stream . |
33 | .PP | |
85d99438 | 34 | .I Puts |
8937b634 KB |
35 | writes the string |
36 | .I str | |
37 | to the standard output stream | |
38 | .BR stdout , | |
39 | appending a newline character. | |
40 | .SH "RETURN VALUE" | |
41 | .I Fputs | |
42 | returns 0 on success, | |
43 | .B EOF | |
44 | on error; | |
45 | .I puts | |
46 | returns a nonnegative integer on success, | |
47 | .B EOF | |
48 | on error. | |
49 | .SH "SEE ALSO" | |
50 | putc(3), ferror(3), stdio(3) | |
51 | .SH ERRORS | |
52 | .TP 15 | |
53 | [EBADF] | |
54 | .I Stream | |
55 | is not a writable stream. | |
56 | .PP | |
57 | .I Fputs | |
58 | and | |
59 | .I puts | |
60 | may also fail and set | |
61 | .I errno | |
62 | for any of the errors specified for the routines | |
63 | .IR write (2). | |
64 | .SH STANDARDS | |
65 | .I Fputs | |
66 | and | |
67 | .I puts | |
68 | conform to ANSI X3.159-1989 (``ANSI C''). |