]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getw.3
Fixed unbalanced .nf/fi pairs.
[thirdparty/man-pages.git] / man3 / getw.3
CommitLineData
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
25getw, 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 ()
36reads a word (that is, an \fIint\fP) from \fIstream\fP.
1c44bd5b 37It's provided for compatibility with SVr4.
60a90ecd
MK
38We recommend you use
39.BR fread (3)
40instead.
fea681da 41.P
60a90ecd
MK
42.BR putw ()
43writes the word \fIw\fP (that is,
1c44bd5b 44an \fIint\fP) to \fIstream\fP.
35478399 45It is provided for compatibility with SVr4, but we recommend you use
60a90ecd
MK
46.BR fwrite (3)
47instead.
fea681da 48.SH "RETURN VALUE"
60a90ecd
MK
49Normally,
50.BR getw ()
51returns the word read, and
52.BR putw ()
53returns 0.
fea681da 54On error, they return \fBEOF\fP.
2b2581ee 55.SH "CONFORMING TO"
de4c786e 56SVr4, SUSv2. Not present in POSIX.1-2001.
fea681da
MK
57.SH BUGS
58The value returned on error is also a legitimate data value.
60a90ecd
MK
59.BR ferror (3)
60can 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)