diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-21 16:45:28 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-21 16:45:33 -0400 |
commit | ceb9471fed96f907e37a6ba031825c31167a8ff4 (patch) | |
tree | d98392e420b4541a6ba926ff4d8b3ebe85734580 /user/lib/spawn.c | |
parent | update linker scripts (diff) | |
download | comus-ceb9471fed96f907e37a6ba031825c31167a8ff4.tar.gz comus-ceb9471fed96f907e37a6ba031825c31167a8ff4.tar.bz2 comus-ceb9471fed96f907e37a6ba031825c31167a8ff4.zip |
update userland to compile
Diffstat (limited to 'user/lib/spawn.c')
-rw-r--r-- | user/lib/spawn.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/user/lib/spawn.c b/user/lib/spawn.c deleted file mode 100644 index 78b1a53..0000000 --- a/user/lib/spawn.c +++ /dev/null @@ -1,32 +0,0 @@ -#include <stdio.h> -#include <error.h> -#include <unistd.h> - -int wait(int32_t *status) -{ - return (waitpid(0, status)); -} - -int spawn(uint_t prog, char **args) -{ - int32_t pid; - - pid = fork(); - if (pid != 0) { - // failure, or we are the parent - return (pid); - } - - // we are the child - pid = getpid(); - - // child inherits parent's priority level - - exec(prog, args); - - // uh-oh.... - - fprintf(stderr, "Child %d exec() #%u failed\n", pid, prog); - - exit(EXIT_FAILURE); -} |