]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getw.3
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man3 / getw.3
CommitLineData
a1eaacb1 1'\" t
bf5a7247 2.\" Copyright (c) 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
fea681da 3.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
c08df37a 5.\"
4c1c5274 6.TH getw 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
7.SH NAME
8getw, putw \- input and output of words (ints)
42009080
AC
9.SH LIBRARY
10Standard C library
11.RI ( libc ", " \-lc )
fea681da
MK
12.SH SYNOPSIS
13.nf
14.B #include <stdio.h>
c6d039a3 15.P
fea681da 16.BI "int getw(FILE *" stream );
fea681da 17.BI "int putw(int " w ", FILE *" stream );
c8250206 18.fi
c6d039a3 19.P
d39ad78f 20.RS -4
35c25d45
MK
21Feature Test Macro Requirements for glibc (see
22.BR feature_test_macros (7)):
d39ad78f 23.RE
c6d039a3 24.P
68d2edce 25.BR getw (),
35c25d45 26.BR putw ():
9d2adbae
MK
27.nf
28 Since glibc 2.3.3:
5c10d2c5 29 _XOPEN_SOURCE && ! (_POSIX_C_SOURCE >= 200112L)
75c018a1
AC
30 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
31 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
9d2adbae
MK
32 Before glibc 2.3.3:
33 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
34.fi
fea681da 35.SH DESCRIPTION
60a90ecd
MK
36.BR getw ()
37reads a word (that is, an \fIint\fP) from \fIstream\fP.
1c44bd5b 38It's provided for compatibility with SVr4.
60a90ecd
MK
39We recommend you use
40.BR fread (3)
41instead.
c6d039a3 42.P
60a90ecd
MK
43.BR putw ()
44writes the word \fIw\fP (that is,
1c44bd5b 45an \fIint\fP) to \fIstream\fP.
35478399 46It is provided for compatibility with SVr4, but we recommend you use
60a90ecd
MK
47.BR fwrite (3)
48instead.
47297adb 49.SH RETURN VALUE
60a90ecd
MK
50Normally,
51.BR getw ()
52returns the word read, and
53.BR putw ()
54returns 0.
fea681da 55On error, they return \fBEOF\fP.
27c00aef
PH
56.SH ATTRIBUTES
57For an explanation of the terms used in this section, see
58.BR attributes (7).
59.TS
60allbox;
c466875e 61lbx lb lb
27c00aef
PH
62l l l.
63Interface Attribute Value
64T{
9e54434e
BR
65.na
66.nh
27c00aef
PH
67.BR getw (),
68.BR putw ()
69T} Thread safety MT-Safe
70.TE
3113c7f3 71.SH STANDARDS
4131356c
AC
72None.
73.SH HISTORY
d72a31c6 74SVr4, SUSv2.
fea681da
MK
75.SH BUGS
76The value returned on error is also a legitimate data value.
60a90ecd
MK
77.BR ferror (3)
78can be used to distinguish between the two cases.
47297adb 79.SH SEE ALSO
fea681da
MK
80.BR ferror (3),
81.BR fread (3),
82.BR fwrite (3),
83.BR getc (3),
84.BR putc (3)