+
+ size_t count = fifo_read(&console->input, buf, len);
+ if (count > 0 && ((char*)buf)[count - 1] == '\n') {
+ return count;
+ }
+
+ while (count < len) {
+ // FIXME RACE!
+ // Consider two process that is polling the input key simultaneously.
+ // When a key is arrived, one of the processes will win the race and
+ // swallow it (advancing the key buffer pointer)