]>
Commit | Line | Data |
---|---|---|
bf5a7247 | 1 | .\" Copyright (c) 1995 by Jim Van Zandt <jrv@vanzandt.mv.com> |
fea681da | 2 | .\" |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
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. | |
c13182ef | 12 | .\" |
fea681da MK |
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. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
c08df37a | 24 | .\" |
97986708 | 25 | .TH GETW 3 2016-03-15 "GNU" "Linux Programmer's Manual" |
fea681da MK |
26 | .SH NAME |
27 | getw, putw \- input and output of words (ints) | |
28 | .SH SYNOPSIS | |
29 | .nf | |
30 | .B #include <stdio.h> | |
68e4db0a | 31 | .PP |
fea681da | 32 | .BI "int getw(FILE *" stream ); |
dbfe9c70 | 33 | .PP |
fea681da | 34 | .BI "int putw(int " w ", FILE *" stream ); |
c8250206 | 35 | .fi |
68e4db0a | 36 | .PP |
35c25d45 MK |
37 | .in -4n |
38 | Feature Test Macro Requirements for glibc (see | |
39 | .BR feature_test_macros (7)): | |
40 | .in | |
68e4db0a | 41 | .PP |
68d2edce | 42 | .BR getw (), |
35c25d45 | 43 | .BR putw (): |
c105dbb5 MK |
44 | .ad l |
45 | .PD 0 | |
46 | .RS 4 | |
47 | .TP 4 | |
48 | Since glibc 2.3.3: | |
d59161f9 MK |
49 | _XOPEN_SOURCE && ! (_POSIX_C_SOURCE\ >=\ 200112L) |
50 | || /* Glibc since 2.19: */ _DEFAULT_SOURCE | |
51 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
c105dbb5 MK |
52 | .TP |
53 | Before glibc 2.3.3: | |
54 | _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE | |
c105dbb5 MK |
55 | .RE |
56 | .PD | |
57 | .ad | |
fea681da | 58 | .SH DESCRIPTION |
60a90ecd MK |
59 | .BR getw () |
60 | reads a word (that is, an \fIint\fP) from \fIstream\fP. | |
1c44bd5b | 61 | It's provided for compatibility with SVr4. |
60a90ecd MK |
62 | We recommend you use |
63 | .BR fread (3) | |
64 | instead. | |
11ac5b51 | 65 | .PP |
60a90ecd MK |
66 | .BR putw () |
67 | writes the word \fIw\fP (that is, | |
1c44bd5b | 68 | an \fIint\fP) to \fIstream\fP. |
35478399 | 69 | It is provided for compatibility with SVr4, but we recommend you use |
60a90ecd MK |
70 | .BR fwrite (3) |
71 | instead. | |
47297adb | 72 | .SH RETURN VALUE |
60a90ecd MK |
73 | Normally, |
74 | .BR getw () | |
75 | returns the word read, and | |
76 | .BR putw () | |
77 | returns 0. | |
fea681da | 78 | On error, they return \fBEOF\fP. |
27c00aef PH |
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 | |
47297adb | 92 | .SH CONFORMING TO |
d72a31c6 | 93 | SVr4, SUSv2. |
0e5a067b | 94 | Not present in POSIX.1. |
fea681da MK |
95 | .SH BUGS |
96 | The value returned on error is also a legitimate data value. | |
60a90ecd MK |
97 | .BR ferror (3) |
98 | can be used to distinguish between the two cases. | |
47297adb | 99 | .SH SEE ALSO |
fea681da MK |
100 | .BR ferror (3), |
101 | .BR fread (3), | |
102 | .BR fwrite (3), | |
103 | .BR getc (3), | |
104 | .BR putc (3) |