Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4163 → Rev 4164

/trunk/uspace/lib/libc/generic/io/io.c
97,6 → 97,8
int getchar(void)
{
unsigned char c;
 
flush_stdout();
if (read_stdin((void *) &c, 1) == 1)
return c;
103,5 → 105,11
return EOF;
}
 
int fflush(FILE *f)
{
(void) f;
return flush_stdout();
}
 
/** @}
*/
/trunk/uspace/lib/libc/generic/io/stream.c
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);