mount_setattr.2: Add a reference to mount_namespaces(7) in discussion of propagation...
[man-pages.git] / man3 / getw.3
blob01955fc5a2b84a0c5f203fcbdbf9aeceeefe9801
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  2021-03-22 "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 .PP
32 .BI "int getw(FILE *" stream );
33 .BI "int putw(int " w ", FILE *" stream );
34 .fi
35 .PP
36 .RS -4
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
39 .RE
40 .PP
41 .BR getw (),
42 .BR putw ():
43 .nf
44     Since glibc 2.3.3:
45         _XOPEN_SOURCE && ! (_POSIX_C_SOURCE >= 200112L)
46             || /* Glibc since 2.19: */ _DEFAULT_SOURCE
47             || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
48     Before glibc 2.3.3:
49         _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
50 .fi
51 .SH DESCRIPTION
52 .BR getw ()
53 reads a word (that is, an \fIint\fP) from \fIstream\fP.
54 It's provided for compatibility with SVr4.
55 We recommend you use
56 .BR fread (3)
57 instead.
58 .PP
59 .BR putw ()
60 writes the word \fIw\fP (that is,
61 an \fIint\fP) to \fIstream\fP.
62 It is provided for compatibility with SVr4, but we recommend you use
63 .BR fwrite (3)
64 instead.
65 .SH RETURN VALUE
66 Normally,
67 .BR getw ()
68 returns the word read, and
69 .BR putw ()
70 returns 0.
71 On error, they return \fBEOF\fP.
72 .SH ATTRIBUTES
73 For an explanation of the terms used in this section, see
74 .BR attributes (7).
75 .ad l
76 .nh
77 .TS
78 allbox;
79 lbx lb lb
80 l l l.
81 Interface       Attribute       Value
83 .BR getw (),
84 .BR putw ()
85 T}      Thread safety   MT-Safe
86 .TE
87 .hy
88 .ad
89 .sp 1
90 .SH CONFORMING TO
91 SVr4, SUSv2.
92 Not present in POSIX.1.
93 .SH BUGS
94 The value returned on error is also a legitimate data value.
95 .BR ferror (3)
96 can be used to distinguish between the two cases.
97 .SH SEE ALSO
98 .BR ferror (3),
99 .BR fread (3),
100 .BR fwrite (3),
101 .BR getc (3),
102 .BR putc (3)