ioctl_tty.2: Update DTR example
[man-pages.git] / man3 / getwchar.3
blob91381ccf1338f55d1fa0470c8b8a8eee234a2382
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\"   GNU glibc-2 source code and manual
12 .\"   Dinkumware C library reference http://www.dinkumware.com/
13 .\"   OpenGroup's Single UNIX specification
14 .\"      http://www.UNIX-systems.org/online.html
15 .\"   ISO/IEC 9899:1999
16 .\"
17 .TH GETWCHAR 3  2021-03-22 "GNU" "Linux Programmer's Manual"
18 .SH NAME
19 getwchar \- read a wide character from standard input
20 .SH SYNOPSIS
21 .nf
22 .B #include <wchar.h>
23 .PP
24 .B "wint_t getwchar(void);"
25 .fi
26 .SH DESCRIPTION
27 The
28 .BR getwchar ()
29 function is the wide-character equivalent of the
30 .BR getchar (3)
31 function.
32 It reads a wide character from
33 .I stdin
34 and returns
35 it.
36 If the end of stream is reached, or if
37 .I ferror(stdin)
38 becomes true, it returns
39 .BR WEOF .
40 If a wide-character conversion error occurs, it sets
41 .I errno
43 .B EILSEQ
44 and returns
45 .BR WEOF .
46 .PP
47 For a nonlocking counterpart, see
48 .BR unlocked_stdio (3).
49 .SH RETURN VALUE
50 The
51 .BR getwchar ()
52 function returns the next wide-character from
53 standard input, or
54 .BR WEOF .
55 .SH ATTRIBUTES
56 For an explanation of the terms used in this section, see
57 .BR attributes (7).
58 .ad l
59 .nh
60 .TS
61 allbox;
62 lbx lb lb
63 l l l.
64 Interface       Attribute       Value
66 .BR getwchar ()
67 T}      Thread safety   MT-Safe
68 .TE
69 .hy
70 .ad
71 .sp 1
72 .SH CONFORMING TO
73 POSIX.1-2001, POSIX.1-2008, C99.
74 .SH NOTES
75 The behavior of
76 .BR getwchar ()
77 depends on the
78 .B LC_CTYPE
79 category of the
80 current locale.
81 .PP
82 It is reasonable to expect that
83 .BR getwchar ()
84 will actually
85 read a multibyte sequence from standard input and then
86 convert it to a wide character.
87 .SH SEE ALSO
88 .BR fgetwc (3),
89 .BR unlocked_stdio (3)