]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getw.3
brk.2, chroot.2, clock_nanosleep.2, getpagesize.2, posix_fadvise.2, select.2, select_...
[thirdparty/man-pages.git] / man3 / getw.3
1 .\" Copyright (c) 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH GETW 3 2015-03-02 "GNU" "Linux Programmer's Manual"
26 .SH NAME
27 getw, putw \- input and output of words (ints)
28 .SH SYNOPSIS
29 .nf
30 .B #include <stdio.h>
31 .sp
32 .BI "int getw(FILE *" stream );
33
34 .BI "int putw(int " w ", FILE *" stream );
35 .fi
36 .sp
37 .in -4n
38 Feature Test Macro Requirements for glibc (see
39 .BR feature_test_macros (7)):
40 .in
41 .sp
42 .BR getw (),
43 .BR putw ():
44 .ad l
45 .PD 0
46 .RS 4
47 .TP 4
48 Since glibc 2.3.3:
49 _SVID_SOURCE || _BSD_SOURCE ||
50 .br
51 (_XOPEN_SOURCE && ! (_POSIX_C_SOURCE\ >=\ 200112L))
52 .TP
53 Before glibc 2.3.3:
54 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
55 .RE
56 .PD
57 .ad
58 .SH DESCRIPTION
59 .BR getw ()
60 reads a word (that is, an \fIint\fP) from \fIstream\fP.
61 It's provided for compatibility with SVr4.
62 We recommend you use
63 .BR fread (3)
64 instead.
65 .P
66 .BR putw ()
67 writes the word \fIw\fP (that is,
68 an \fIint\fP) to \fIstream\fP.
69 It is provided for compatibility with SVr4, but we recommend you use
70 .BR fwrite (3)
71 instead.
72 .SH RETURN VALUE
73 Normally,
74 .BR getw ()
75 returns the word read, and
76 .BR putw ()
77 returns 0.
78 On error, they return \fBEOF\fP.
79 .SH ATTRIBUTES
80 For an explanation of the terms used in this section, see
81 .BR attributes (7).
82 .TS
83 allbox;
84 lbw14 lb lb
85 l l l.
86 Interface Attribute Value
87 T{
88 .BR getw (),
89 .BR putw ()
90 T} Thread safety MT-Safe
91 .TE
92 .SH CONFORMING TO
93 SVr4, SUSv2.
94 Not present in POSIX.1.
95 .SH BUGS
96 The value returned on error is also a legitimate data value.
97 .BR ferror (3)
98 can be used to distinguish between the two cases.
99 .SH SEE ALSO
100 .BR ferror (3),
101 .BR fread (3),
102 .BR fwrite (3),
103 .BR getc (3),
104 .BR putc (3)