]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/ux/glibc_getchar.cpp
update
[l4.git] / kernel / fiasco / src / kern / ux / glibc_getchar.cpp
1 IMPLEMENTATION:
2
3 #include <cstdio>
4 #include "console.h"
5 #include "filter_console.h"
6 #include "glibc_getchar.h"
7 #include "kernel_console.h"
8 #include "static_init.h"
9
10 class Glibc_getchar : public Console
11 {};
12
13 PUBLIC
14 int
15 Glibc_getchar::getchar( bool /*blocking*/ )
16 {
17   return ::getchar();
18 }
19
20 PUBLIC
21 int
22 Glibc_getchar::write( char const * /*str*/, size_t /*len*/ )
23 {
24   return 1;
25 }
26
27 PUBLIC
28 Mword
29 Glibc_getchar::get_attributes() const
30 {
31   return UX | IN;
32 }
33
34 static void
35 glibc_flt_getchar_init()
36 {
37   static Glibc_getchar c;
38   static Filter_console fcon(&c, 0);
39
40   Kconsole::console()->register_console(&fcon);
41 }
42
43 STATIC_INITIALIZER_P(glibc_flt_getchar_init, GDB_INIT_PRIO);