aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.h
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-29 05:09:46 -0500
committerRob Landley <rob@landley.net>2015-09-29 05:09:46 -0500
commit7d6af77804adc069a83e8566250f868a6cb9786e (patch)
tree92b6b57f55c41ab13164c1d448b3cdd1129703b4 /lib/lib.h
parent3b51a07e478d64a84e40b3a7c026b2f8566b194b (diff)
downloadtoybox-7d6af77804adc069a83e8566250f868a6cb9786e.tar.gz
Make defconfig build for nommu.
Adds XVFORK() macro, teaches xpopen_both() to call /proc/self/exe with NULL argv (and converts cpio -p to use that), adds TOYBOX_FORK guards to some unconverted commands.
Diffstat (limited to 'lib/lib.h')
-rw-r--r--lib/lib.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/lib.h b/lib/lib.h
index d76dcc0c..90f44dcb 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -247,17 +247,8 @@ void mode_to_string(mode_t mode, char *buf);
char *basename_r(char *name);
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;
-
- toys.stacktop = 0;
- if ((p = vfork()) == -1) perror_exit("vfork");
-
- return p;
-}
+pid_t xvforkwrap(pid_t pid);
+#define XVFORK() xvforkwrap(vfork())
// Functions in need of further review/cleanup
#include "lib/pending.h"