]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/ux/glue_libc_ux.cc
45816af4ab05d9d9be1d9431d27da9dbe506635a
[l4.git] / kernel / fiasco / src / kern / ux / glue_libc_ux.cc
1 #include <unistd.h>
2 #include "libc_backend.h"
3 #include "console.h"
4
5 int __libc_backend_outs(const char *s, size_t len)
6 {
7   return write(1, s, len);
8 }
9
10 int __libc_backend_ins( char *s, size_t len )
11 {
12   if(Console::stdin) {
13     size_t act = 0;
14     for(; act < len; act++) {
15       s[act]=Console::stdin->getchar();
16       if(s[act]=='\r') {
17         act++;
18         break;
19       }
20     }
21     return act;
22   } else
23     return 0;
24 }