diff --git a/src/userland/cli/bsh.c b/src/userland/cli/bsh.c index d643240..35b10a1 100644 --- a/src/userland/cli/bsh.c +++ b/src/userland/cli/bsh.c @@ -1438,7 +1438,7 @@ static int read_line(char *out, int max_len, const char *prompt_tmpl) { int got = sys_tty_read_in(&ch, 1); if (got <= 0) { // Throttle idle input polling to avoid pegging the CPU at 100% - sleep(1); + sleep(50); continue; } diff --git a/src/userland/games/2048.c b/src/userland/games/2048.c index 721c7f5..091c723 100644 --- a/src/userland/games/2048.c +++ b/src/userland/games/2048.c @@ -496,7 +496,7 @@ int main(int argc, char **argv) { ui_mark_dirty(win, 0, 0, WINDOW_W, WINDOW_H); } } else { - sys_yield(); + sys_system(SYSTEM_CMD_SLEEP, 10, 0, 0, 0); } } diff --git a/src/userland/gui/boredword.c b/src/userland/gui/boredword.c index 25baaf4..3b67564 100644 --- a/src/userland/gui/boredword.c +++ b/src/userland/gui/boredword.c @@ -1988,7 +1988,7 @@ int main(int argc, char **argv) { ui_mark_dirty(win, 0, 0, win_w, win_h); needs_repaint = 0; } else { - sys_yield(); + sys_system(SYSTEM_CMD_SLEEP, 16, 0, 0, 0); } } return 0; diff --git a/src/userland/gui/keylog.c b/src/userland/gui/keylog.c index a5f5422..851d1d5 100644 --- a/src/userland/gui/keylog.c +++ b/src/userland/gui/keylog.c @@ -54,7 +54,7 @@ int main(void) { draw(win); ui_mark_dirty(win, 0, 0, WINDOW_W, WINDOW_H); } else { - sys_yield(); + sys_system(SYSTEM_CMD_SLEEP, 10, 0, 0, 0); } } diff --git a/src/userland/libc/posix_io.c b/src/userland/libc/posix_io.c index b71065d..320b8d3 100644 --- a/src/userland/libc/posix_io.c +++ b/src/userland/libc/posix_io.c @@ -158,7 +158,7 @@ static int _b_pipe_read(fd_handle_t *h, void *buf, size_t count) { } break; } - sys_yield(); + sleep(1); continue; } @@ -193,7 +193,7 @@ static int _b_pipe_write(fd_handle_t *h, const void *buf, size_t count) { } break; } - sys_yield(); + sleep(1); continue; } diff --git a/src/userland/libc/posix_process.c b/src/userland/libc/posix_process.c index 0d15f05..16dd17a 100644 --- a/src/userland/libc/posix_process.c +++ b/src/userland/libc/posix_process.c @@ -3,6 +3,7 @@ #include "errno.h" #include "stdio.h" +#include "stdlib.h" #include "string.h" #include "sys/types.h" #include "sys/wait.h" @@ -219,6 +220,6 @@ __attribute__((weak)) pid_t waitpid(pid_t pid, int *status, int options) { errno = ECHILD; return -1; } - sys_yield(); + sleep(1); } } diff --git a/src/userland/net/telnet.c b/src/userland/net/telnet.c index d8440bf..ccdd2f1 100644 --- a/src/userland/net/telnet.c +++ b/src/userland/net/telnet.c @@ -363,7 +363,7 @@ int main(int argc, char **argv) { connected = 0; break; } - sys_yield(); + sys_system(SYSTEM_CMD_SLEEP, 10, 0, 0, 0); continue; }