]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getw.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man3 / getw.3
CommitLineData
bf5a7247 1.\" Copyright (c) 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
fea681da
MK
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.
e6a44d61 23.TH GETW 3 2010-09-26 "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
35c25d45
MK
34.sp
35.in -4n
36Feature Test Macro Requirements for glibc (see
37.BR feature_test_macros (7)):
38.in
39.sp
68d2edce 40.BR getw (),
35c25d45 41.BR putw ():
c105dbb5
MK
42.ad l
43.PD 0
44.RS 4
45.TP 4
46Since glibc 2.3.3:
47_SVID_SOURCE || _BSD_SOURCE ||
e6a44d61
MK
48.br
49(_XOPEN_SOURCE &&
50 !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600))
c105dbb5
MK
51.TP
52Before glibc 2.3.3:
53_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
c105dbb5
MK
54.RE
55.PD
56.ad
fea681da 57.SH DESCRIPTION
60a90ecd
MK
58.BR getw ()
59reads a word (that is, an \fIint\fP) from \fIstream\fP.
1c44bd5b 60It's provided for compatibility with SVr4.
60a90ecd
MK
61We recommend you use
62.BR fread (3)
63instead.
fea681da 64.P
60a90ecd
MK
65.BR putw ()
66writes the word \fIw\fP (that is,
1c44bd5b 67an \fIint\fP) to \fIstream\fP.
35478399 68It is provided for compatibility with SVr4, but we recommend you use
60a90ecd
MK
69.BR fwrite (3)
70instead.
47297adb 71.SH RETURN VALUE
60a90ecd
MK
72Normally,
73.BR getw ()
74returns the word read, and
75.BR putw ()
76returns 0.
fea681da 77On error, they return \fBEOF\fP.
47297adb 78.SH CONFORMING TO
de4c786e 79SVr4, SUSv2. Not present in POSIX.1-2001.
fea681da
MK
80.SH BUGS
81The value returned on error is also a legitimate data value.
60a90ecd
MK
82.BR ferror (3)
83can be used to distinguish between the two cases.
47297adb 84.SH SEE ALSO
fea681da
MK
85.BR ferror (3),
86.BR fread (3),
87.BR fwrite (3),
88.BR getc (3),
89.BR putc (3)