1GETW(3) Linux Programmer's Manual GETW(3)
2
3
4
6 getw, putw - input and output of words (ints)
7
9 #include <stdio.h>
10
11 int getw(FILE *stream);
12
13 int putw(int w, FILE *stream);
14
15 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17 getw(), putw():
18 Since glibc 2.3.3:
19 _XOPEN_SOURCE && ! (_POSIX_C_SOURCE >= 200112L)
20 || /* Glibc since 2.19: */ _DEFAULT_SOURCE
21 || /* Glibc versions <= 2.19: */ _BSD_SOURCE ||
22 _SVID_SOURCE
23 Before glibc 2.3.3:
24 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
25
27 getw() reads a word (that is, an int) from stream. It's provided for
28 compatibility with SVr4. We recommend you use fread(3) instead.
29
30 putw() writes the word w (that is, an int) to stream. It is provided
31 for compatibility with SVr4, but we recommend you use fwrite(3)
32 instead.
33
35 Normally, getw() returns the word read, and putw() returns 0. On
36 error, they return EOF.
37
39 For an explanation of the terms used in this section, see
40 attributes(7).
41
42 ┌───────────────┬───────────────┬─────────┐
43 │Interface │ Attribute │ Value │
44 ├───────────────┼───────────────┼─────────┤
45 │getw(), putw() │ Thread safety │ MT-Safe │
46 └───────────────┴───────────────┴─────────┘
48 SVr4, SUSv2. Not present in POSIX.1.
49
51 The value returned on error is also a legitimate data value. ferror(3)
52 can be used to distinguish between the two cases.
53
55 ferror(3), fread(3), fwrite(3), getc(3), putc(3)
56
58 This page is part of release 5.02 of the Linux man-pages project. A
59 description of the project, information about reporting bugs, and the
60 latest version of this page, can be found at
61 https://www.kernel.org/doc/man-pages/.
62
63
64
65GNU 2016-03-15 GETW(3)