OSDN Git Service

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