Changeset fa09449 in mainline for uspace/lib/libc/generic/io/stream.c
- Timestamp:
- 2009-02-15T22:31:07Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6cd9aa6
- Parents:
- 76dd25b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/io/stream.c
r76dd25b rfa09449 44 44 #include <ipc/services.h> 45 45 #include <ipc/console.h> 46 #include <kbd/kbd.h> 46 47 #include <unistd.h> 47 48 #include <async.h> … … 59 60 open_console(); 60 61 if (console_phone >= 0) { 61 ipcarg_t r0, r1; 62 kbd_event_t ev; 63 int rc; 62 64 size_t i = 0; 63 65 64 66 while (i < count) { 65 if (async_req_0_2(console_phone, CONSOLE_GETCHAR, &r0, &r1) < 0) 66 return -1; 67 ((char *) buf)[i++] = r0; 67 do { 68 rc = kbd_get_event(&ev); 69 if (rc < 0) return -1; 70 } while (ev.c == 0); 71 72 ((char *) buf)[i++] = ev.c; 68 73 } 69 74 return i;
Note:
See TracChangeset
for help on using the changeset viewer.