Rev 4160 | Rev 4317 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4160 | Rev 4164 | ||
---|---|---|---|
Line 78... | Line 78... | ||
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(false); |
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 |