80,12 → 80,19 |
ssize_t write_stdout(const void *buf, size_t count) |
{ |
int cons_phone = console_phone_get(false); |
int left, rc; |
|
if (cons_phone >= 0) { |
int i; |
|
for (i = 0; i < count; i++) |
console_putchar(((const char *) buf)[i]); |
left = count; |
while (left > 0) { |
rc = console_write(buf, left); |
if (rc < 0) |
break; |
buf += rc; |
left -= rc; |
} |
|
return count; |
} else |
92,6 → 99,12 |
return __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, count); |
} |
|
int flush_stdout(void) |
{ |
console_flush(); |
return 0; |
} |
|
void klog_update(void) |
{ |
(void) __SYSCALL3(SYS_KLOG, 1, NULL, 0); |