]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" (c) 1995 by Jim Van Zandt <jrv@vanzandt.mv.com> |
2 | .\" | |
3 | .\" Permission is granted to make and distribute verbatim copies of this | |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
6 | .\" | |
7 | .\" Permission is granted to copy and distribute modified versions of this | |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
c13182ef | 11 | .\" |
fea681da MK |
12 | .\" Since the Linux kernel and libraries are constantly changing, this |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
c13182ef | 19 | .\" |
fea681da MK |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" License. | |
de4c786e | 23 | .TH GETW 3 2007-12-20 "GNU" "Linux Programmer's Manual" |
fea681da MK |
24 | .SH NAME |
25 | getw, putw \- input and output of words (ints) | |
26 | .SH SYNOPSIS | |
27 | .nf | |
28 | .B #include <stdio.h> | |
29 | .sp | |
30 | .BI "int getw(FILE *" stream ); | |
5895e7eb | 31 | |
fea681da | 32 | .BI "int putw(int " w ", FILE *" stream ); |
c8250206 | 33 | .fi |
fea681da | 34 | .SH DESCRIPTION |
60a90ecd MK |
35 | .BR getw () |
36 | reads a word (that is, an \fIint\fP) from \fIstream\fP. | |
1c44bd5b | 37 | It's provided for compatibility with SVr4. |
60a90ecd MK |
38 | We recommend you use |
39 | .BR fread (3) | |
40 | instead. | |
fea681da | 41 | .P |
60a90ecd MK |
42 | .BR putw () |
43 | writes the word \fIw\fP (that is, | |
1c44bd5b | 44 | an \fIint\fP) to \fIstream\fP. |
35478399 | 45 | It is provided for compatibility with SVr4, but we recommend you use |
60a90ecd MK |
46 | .BR fwrite (3) |
47 | instead. | |
fea681da | 48 | .SH "RETURN VALUE" |
60a90ecd MK |
49 | Normally, |
50 | .BR getw () | |
51 | returns the word read, and | |
52 | .BR putw () | |
53 | returns 0. | |
fea681da | 54 | On error, they return \fBEOF\fP. |
2b2581ee | 55 | .SH "CONFORMING TO" |
de4c786e | 56 | SVr4, SUSv2. Not present in POSIX.1-2001. |
fea681da MK |
57 | .SH BUGS |
58 | The value returned on error is also a legitimate data value. | |
60a90ecd MK |
59 | .BR ferror (3) |
60 | can be used to distinguish between the two cases. | |
fea681da MK |
61 | .SH "SEE ALSO" |
62 | .BR ferror (3), | |
63 | .BR fread (3), | |
64 | .BR fwrite (3), | |
65 | .BR getc (3), | |
66 | .BR putc (3) |