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