]>
Commit | Line | Data |
---|---|---|
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 |
8 | getw, putw \- input and output of words (ints) | |
42009080 AC |
9 | .SH LIBRARY |
10 | Standard 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 |
21 | Feature 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 () |
37 | reads a word (that is, an \fIint\fP) from \fIstream\fP. | |
1c44bd5b | 38 | It's provided for compatibility with SVr4. |
60a90ecd MK |
39 | We recommend you use |
40 | .BR fread (3) | |
41 | instead. | |
c6d039a3 | 42 | .P |
60a90ecd MK |
43 | .BR putw () |
44 | writes the word \fIw\fP (that is, | |
1c44bd5b | 45 | an \fIint\fP) to \fIstream\fP. |
35478399 | 46 | It is provided for compatibility with SVr4, but we recommend you use |
60a90ecd MK |
47 | .BR fwrite (3) |
48 | instead. | |
47297adb | 49 | .SH RETURN VALUE |
60a90ecd MK |
50 | Normally, |
51 | .BR getw () | |
52 | returns the word read, and | |
53 | .BR putw () | |
54 | returns 0. | |
fea681da | 55 | On error, they return \fBEOF\fP. |
27c00aef PH |
56 | .SH ATTRIBUTES |
57 | For an explanation of the terms used in this section, see | |
58 | .BR attributes (7). | |
59 | .TS | |
60 | allbox; | |
c466875e | 61 | lbx lb lb |
27c00aef PH |
62 | l l l. |
63 | Interface Attribute Value | |
64 | T{ | |
9e54434e BR |
65 | .na |
66 | .nh | |
27c00aef PH |
67 | .BR getw (), |
68 | .BR putw () | |
69 | T} Thread safety MT-Safe | |
70 | .TE | |
3113c7f3 | 71 | .SH STANDARDS |
4131356c AC |
72 | None. |
73 | .SH HISTORY | |
d72a31c6 | 74 | SVr4, SUSv2. |
fea681da MK |
75 | .SH BUGS |
76 | The value returned on error is also a legitimate data value. | |
60a90ecd MK |
77 | .BR ferror (3) |
78 | can 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) |