pub static FORKLEVEL: AtomicI32Expand description
Port of int forklevel; from Src/exec.c:1052. Records the
locallevel at the most recent fork point (set at c:1221:
forklevel = locallevel; inside entersubsh()). Used by:
signals.c:808SIGPIPE handler —!forkleveldistinguishes the top-level shell from a forked subshell.exec.c:6146—if (locallevel > forklevel)decides whether a function-defined trap should fire on this subshell exit.params.c:3724— WARNCREATEGLOBAL nest-depth check.
Initialised to 0 (no fork has occurred yet). Set to locallevel
at every entersubsh() entry per c:1221.