Rev 4156 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4156 | Rev 4201 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | return count; |
54 | return count; |
55 | } |
55 | } |
56 | 56 | ||
57 | ssize_t read_stdin(void *buf, size_t count) |
57 | ssize_t read_stdin(void *buf, size_t count) |
58 | { |
58 | { |
59 | int cons_phone = console_phone_get(); |
59 | int cons_phone = console_phone_get(false); |
60 | 60 | ||
61 | if (cons_phone >= 0) { |
61 | if (cons_phone >= 0) { |
62 | kbd_event_t ev; |
62 | kbd_event_t ev; |
63 | int rc; |
63 | int rc; |
64 | size_t i = 0; |
64 | size_t i = 0; |
Line 77... | Line 77... | ||
77 | } |
77 | } |
78 | } |
78 | } |
79 | 79 | ||
80 | ssize_t write_stdout(const void *buf, size_t count) |
80 | ssize_t write_stdout(const void *buf, size_t count) |
81 | { |
81 | { |
82 | int cons_phone = console_phone_get(); |
82 | int cons_phone = console_phone_get(false); |
- | 83 | int left, rc; |
|
83 | 84 | ||
84 | if (cons_phone >= 0) { |
85 | if (cons_phone >= 0) { |
85 | int i; |
86 | int i; |
86 | 87 | ||
87 | for (i = 0; i < count; i++) |
88 | left = count; |
- | 89 | while (left > 0) { |
|
88 | console_putchar(((const char *) buf)[i]); |
90 | rc = console_write(buf, left); |
- | 91 | if (rc < 0) |
|
- | 92 | break; |
|
- | 93 | buf += rc; |
|
- | 94 | left -= rc; |
|
- | 95 | } |
|
89 | 96 | ||
90 | return count; |
97 | return count; |
91 | } else |
98 | } else |
92 | return __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, count); |
99 | return __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, count); |
93 | } |
100 | } |
94 | 101 | ||
- | 102 | int flush_stdout(void) |
|
- | 103 | { |
|
- | 104 | console_flush(); |
|
- | 105 | return 0; |
|
- | 106 | } |
|
- | 107 | ||
95 | void klog_update(void) |
108 | void klog_update(void) |
96 | { |
109 | { |
97 | (void) __SYSCALL3(SYS_KLOG, 1, NULL, 0); |
110 | (void) __SYSCALL3(SYS_KLOG, 1, NULL, 0); |
98 | } |
111 | } |
99 | 112 |