aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.h
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-27 09:03:41 -0500
committerRob Landley <rob@landley.net>2015-09-27 09:03:41 -0500
commit3b51a07e478d64a84e40b3a7c026b2f8566b194b (patch)
treed9cd3570367e49ef7d51f527bdf68984bf2643c7 /lib/lib.h
parent0593b32337b48d60a521922e2355c78750e635d2 (diff)
downloadtoybox-3b51a07e478d64a84e40b3a7c026b2f8566b194b.tar.gz
Another chunk of nommu support, replacing toys.recursion with toys.stacktop.
Diffstat (limited to 'lib/lib.h')
-rw-r--r--lib/lib.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/lib.h b/lib/lib.h
index cbac3aa5..d76dcc0c 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -98,6 +98,7 @@ void xputc(char c);
void xflush(void);
void xexec(char **argv);
pid_t xpopen_both(char **argv, int *pipes);
+int xwaitpid(pid_t pid);
int xpclose_both(pid_t pid, int *pipes);
pid_t xpopen(char **argv, int *pipe, int stdout);
pid_t xpclose(pid_t pid, int pipe);
@@ -248,12 +249,12 @@ void names_to_pid(char **names, int (*callback)(pid_t pid, char *name));
// Returning from a function can modify a potentially shared stack,
// so this has to always inline.
-
static inline pid_t xvfork(void)
{
- pid_t p = vfork();
+ pid_t p;
- if (p == -1) perror_exit("vfork");
+ toys.stacktop = 0;
+ if ((p = vfork()) == -1) perror_exit("vfork");
return p;
}