sched: improve thread handling on system calls

This commit is contained in:
Michael Shaw 2025-02-11 18:58:00 -05:00
commit 72827c1e00
9 changed files with 157 additions and 180 deletions

View file

@ -25,27 +25,9 @@ void _start()
promptfd(fd);
char c[2];
ssize_t ret;
while ((ret = read(fd, c, 1)) > 0) {
if (c[0] == '\r')
c[0] = '\n';
write(fd, c, 1);
if (c[0] == '\n') {
write(fd, "attempting to fork\n", 19);
pid_t pid = fork();
if (pid == 0) {
write(fd, "child\n", 6);
exit(0);
} else {
write(fd, "parent\n", 7);
}
}
char buf[256];
int n;
while ((n = read(fd, buf, 256)) > 0) {
write(fd, buf, n);
}
exit(0x1234);
}