Changeset b27a97bb in mainline for libc/generic/io/io.c


Ignore:
Timestamp:
2006-05-31T15:41:19Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c0e674a
Parents:
440cff5
Message:

Support for reading from stdin.
Getchar() implemented.

File:
1 edited

Legend:

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

    r440cff5 rb27a97bb  
    9393        return EOF;
    9494}
     95
     96int getchar(void)
     97{
     98        unsigned char c;
     99        if (read(0, (void *)&c , 1) == 1) {
     100                        return c;
     101        }
     102       
     103        return EOF;
     104}
     105
     106
Note: See TracChangeset for help on using the changeset viewer.