From 114541b98e755bd28a9386008a352065bd942875 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 11 Mar 2020 22:09:15 -0500 Subject: Redo NOFORK plumbing so commands like eval/unset can access/edit shell state. --- toys.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'toys.h') 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 -- cgit v1.2.3