aboutsummaryrefslogtreecommitdiff
path: root/toys.h
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-03-11 22:09:15 -0500
committerRob Landley <rob@landley.net>2020-03-11 22:09:15 -0500
commit114541b98e755bd28a9386008a352065bd942875 (patch)
tree6a90b20d308978d354e2cf0cea4c5e1446febfb0 /toys.h
parent42be28f77458618c128d32d9273f6eca7f73a971 (diff)
downloadtoybox-114541b98e755bd28a9386008a352065bd942875.tar.gz
Redo NOFORK plumbing so commands like eval/unset can access/edit shell state.
Diffstat (limited to 'toys.h')
-rw-r--r--toys.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/toys.h b/toys.h
index eb9208e4..955cc4ca 100644
--- a/toys.h
+++ b/toys.h
@@ -82,6 +82,7 @@
struct toy_list *toy_find(char *name);
void toy_init(struct toy_list *which, char *argv[]);
+void toy_singleinit(struct toy_list *which, char *argv[]);
void toy_exec(char *argv[]);
// Array of available commands
@@ -101,18 +102,18 @@ extern struct toy_context {
char **optargs; // Arguments left over from get_optflags()
unsigned long long optflags; // Command line option flags from get_optflags()
int optc; // Count of optargs
- int envc; // Count of original environ entries
- int old_umask; // Old umask preserved by TOYFLAG_UMASK
short toycount; // Total number of commands in this build
- short signal; // generic_signal() records what signal it saw here
- int signalfd; // and writes signal to this fd, if set
char exitval; // Value error_exit feeds to exit()
char wasroot; // dropped setuid
- // This is at the end so toy_init() doesn't zero it.
+ // toy_init() should not zero past here.
sigjmp_buf *rebound; // siglongjmp here instead of exit when do_rebound
struct arg_list *xexit; // atexit() functions for xexit(), set by sigatexit()
void *stacktop; // nested toy_exec() call count, or 0 if vforked
+ int envc; // Count of original environ entries
+ int old_umask; // Old umask preserved by TOYFLAG_UMASK
+ short signal; // generic_signal() records what signal it saw here
+ int signalfd; // and writes signal to this fd, if set
} toys;
// Two big temporary buffers: one for use by commands, one for library functions