pub fn execsave()Expand description
Port of void execsave(void) from Src/exec.c:6438.
C body:
struct execstack *es = (struct execstack *) zalloc(sizeof(struct execstack));
es->list_pipe_pid = list_pipe_pid;
es->nowait = nowait;
es->pline_level = pline_level;
es->list_pipe_child = list_pipe_child;
es->list_pipe_job = list_pipe_job;
strcpy(es->list_pipe_text, list_pipe_text);
es->lastval = lastval;
es->noeval = noeval;
es->badcshglob = badcshglob;
es->cmdoutpid = cmdoutpid;
es->cmdoutval = cmdoutval;
es->use_cmdoutval = use_cmdoutval;
es->procsubstpid = procsubstpid;
es->trap_return = trap_return;
es->trap_state = trap_state;
es->trapisfunc = trapisfunc;
es->traplocallevel = traplocallevel;
es->noerrs = noerrs;
es->this_noerrexit = this_noerrexit;
es->underscore = ztrdup(zunderscore);
es->next = exstack;
exstack = es;
noerrs = cmdoutpid = 0;Snapshot every transient exec-context global onto the exstack
linked list so a signal-handler / trap-firing nested eval can
scribble freely; execrestore pops the frame back. Called by
dotrap (signals.c) and the trap-firing entry in execlist.