Commit | Line | Data |
---|---|---|
ae59e04c | 1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
8937b634 | 2 | .\" All rights reserved. |
85d99438 | 3 | .\" |
8937b634 | 4 | .\" This code is derived from software contributed to Berkeley by |
043368e6 KB |
5 | .\" Chris Torek and the American National Standards Committee X3, |
6 | .\" on Information Processing Systems. | |
7 | .\" | |
8937b634 KB |
8 | .\" %sccs.include.redist.man% |
9 | .\" | |
043368e6 | 10 | .\" @(#)fputs.3 6.6 (Berkeley) %G% |
8937b634 | 11 | .\" |
ae59e04c CL |
12 | .Dd |
13 | .Dt FPUTS 3 | |
14 | .Os | |
15 | .Sh NAME | |
16 | .Nm fputs , | |
17 | .Nm puts | |
18 | .Nd output a line to a stream | |
19 | .Sh SYNOPSIS | |
20 | .Fd #include <stdio.h> | |
21 | .Ft int | |
22 | .Fn fputs "const char *str" "FILE *stream" | |
23 | .Ft int | |
24 | .Fn puts "const char *str" | |
25 | .Sh DESCRIPTION | |
26 | The function | |
27 | .Fn fputs | |
28 | writes the string pointed to by | |
29 | .Fa str | |
30 | to the stream pointed to by | |
31 | .Fa stream . | |
32 | .\" The terminating | |
33 | .\" .Dv NUL | |
34 | .\" character is not written. | |
35 | .Pp | |
36 | The function | |
37 | .Fn puts | |
8937b634 | 38 | writes the string |
ae59e04c CL |
39 | .Fa str , |
40 | and a terminating newline character, | |
41 | to the stream | |
42 | .Em stdout . | |
43 | .Sh RETURN VALUES | |
44 | The | |
45 | .Fn fputs | |
46 | function | |
47 | returns 0 on success and | |
48 | .Dv EOF | |
8937b634 | 49 | on error; |
ae59e04c CL |
50 | .Fn puts |
51 | returns a nonnegative integer on success and | |
52 | .Dv EOF | |
8937b634 | 53 | on error. |
ae59e04c CL |
54 | .Sh ERRORS |
55 | .Bl -tag -width [EBADF] | |
56 | .It Bq Er EBADF | |
57 | The | |
58 | .Fa stream | |
59 | supplied | |
8937b634 | 60 | is not a writable stream. |
ae59e04c CL |
61 | .El |
62 | .Pp | |
63 | The functions | |
64 | .Fn fputs | |
8937b634 | 65 | and |
ae59e04c | 66 | .Fn puts |
8937b634 | 67 | may also fail and set |
ae59e04c | 68 | .Va errno |
8937b634 | 69 | for any of the errors specified for the routines |
ae59e04c CL |
70 | .Xr write 2 . |
71 | .Sh SEE ALSO | |
72 | .Xr putc 3 , | |
73 | .Xr ferror 3 , | |
74 | .Xr stdio 3 | |
75 | .Sh STANDARDS | |
76 | The functions | |
77 | .Fn fputs | |
8937b634 | 78 | and |
ae59e04c CL |
79 | .Fn puts |
80 | conform to | |
81 | .St -ansiC . |