Changeset 566f4cfb in mainline for uspace/lib/libc/generic/io/io.c


Ignore:
Timestamp:
2009-04-24T08:01:05Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
402de0c
Parents:
ab1861a
Message:

use buffering for klog output (this can be used to avoid the ugly usleeps while starting tasks)
unify and cleanup console.c and related files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/io/io.c

    rab1861a r566f4cfb  
    3939#include <string.h>
    4040#include <errno.h>
     41#include <console.h>
    4142
    4243const static char nl = '\n';
     
    5051       
    5152        for (count = 0; str[count] != 0; count++);
    52         if (write_stdout((void *) str, count) == count) {
    53                 if (write_stdout(&nl, 1) == 1)
     53       
     54        if (console_write((void *) str, count) == count) {
     55                if (console_write(&nl, 1) == 1)
    5456                        return 0;
    5557        }
     
    6567int putnchars(const char *buf, size_t count)
    6668{
    67         if (write_stdout((void *) buf, count) == count)
     69        if (console_write((void *) buf, count) == count)
    6870                return 0;
    6971       
     
    8284
    8385        for (count = 0; str[count] != 0; count++);
    84         if (write_stdout((void *) str, count) == count)
     86        if (console_write((void *) str, count) == count)
    8587                return 0;
    8688       
     
    9799                return EOF;
    98100
    99         if (write_stdout((void *) buf, offs) == offs)
     101        if (console_write((void *) buf, offs) == offs)
    100102                return c;
    101103
     
    106108{
    107109        unsigned char c;
    108 
    109         flush_stdout();
     110       
     111        console_flush();
    110112        if (read_stdin((void *) &c, 1) == 1)
    111113                return c;
     
    116118int fflush(FILE *f)
    117119{
     120        /* Dummy implementation */
    118121        (void) f;
    119         return flush_stdout();
     122        console_flush();
     123        return 0;
    120124}
    121125
Note: See TracChangeset for help on using the changeset viewer.