diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-08 10:39:48 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-08 10:39:48 -0400 |
commit | 8a19547957a86bed3f58c9abc1ac218d04698faf (patch) | |
tree | ed7ccc6f3a8902915dfe6c9bf763fc45d752b3c4 /ulib/spawn.c | |
parent | fmt (diff) | |
download | comus-8a19547957a86bed3f58c9abc1ac218d04698faf.tar.gz comus-8a19547957a86bed3f58c9abc1ac218d04698faf.tar.bz2 comus-8a19547957a86bed3f58c9abc1ac218d04698faf.zip |
break apart c libaray
Diffstat (limited to 'ulib/spawn.c')
-rw-r--r-- | ulib/spawn.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/ulib/spawn.c b/ulib/spawn.c deleted file mode 100644 index 78b1a53..0000000 --- a/ulib/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); -} |