rwait
if (rwait(&ts) && read(STDIN_FILENO, &c, 1) != 1)
if (!rwait(&timeleft))
int rwait(struct timespec *);
} while (rwait(NULL) == -1);