diff options
author | Alex Auvolat <alex@adnab.me> | 2015-03-14 15:01:46 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2015-03-14 15:01:46 +0100 |
commit | 51def2fc45d98b59be0413fcb9c25cbb0bbca211 (patch) | |
tree | 8b57930186622a8fad2aeb6fa6aac1025f9db224 /src/lib/libkogata/stdio.c | |
parent | 4672f514591f0f7110103c4cd898909aef95b635 (diff) | |
download | kogata-51def2fc45d98b59be0413fcb9c25cbb0bbca211.tar.gz kogata-51def2fc45d98b59be0413fcb9c25cbb0bbca211.zip |
Fix blocking channel && channel write on circular-overflow. (see ipc.c)
Diffstat (limited to 'src/lib/libkogata/stdio.c')
-rw-r--r-- | src/lib/libkogata/stdio.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/lib/libkogata/stdio.c b/src/lib/libkogata/stdio.c index 1c298ad..e62aa30 100644 --- a/src/lib/libkogata/stdio.c +++ b/src/lib/libkogata/stdio.c @@ -1,4 +1,5 @@ #include <syscall.h> +#include <string.h> #include <printf.h> #include <stdio.h> @@ -7,12 +8,6 @@ fd_t stdio = 1; int getc() { - sel_fd_t fd; - fd.fd = stdio; - fd.req_flags = SEL_READ; - ASSERT(select(&fd, 1, -1)); - ASSERT(fd.got_flags & SEL_READ); - char chr; size_t sz = read(stdio, 0, 1, &chr); ASSERT(sz == 1); @@ -26,7 +21,7 @@ void putc(int c) { } void puts(char* s) { - while (*s) putc(*(s++)); + write(stdio, 0, strlen(s), s); } void getline(char* buf, size_t l) { |