diff --git a/bash-5.1/r_execute_cmd/src/lib.rs b/bash-5.1/r_execute_cmd/src/lib.rs index 2366482639c5a2c7b3f3085cf4573ef6bc5b0c53..5eb1022b033fd28b8f7bdd87dc1e58103ce49477 100644 --- a/bash-5.1/r_execute_cmd/src/lib.rs +++ b/bash-5.1/r_execute_cmd/src/lib.rs @@ -1999,7 +1999,45 @@ unsafe extern "C" fn coproc_setstatus(mut cp: *mut coproc, mut status: libc::c_i (*cp).c_lock = 0 as libc::c_int; } +#[no_mangle] +pub unsafe extern "C" fn coproc_pidchk(mut pid: pid_t, mut status: libc::c_int) { + let mut cp: *mut coproc = 0 as *mut coproc; + + cp = getcoprocbypid(pid); + if !cp.is_null() { + coproc_setstatus(cp, status); + } +} + +#[no_mangle] +pub unsafe extern "C" fn coproc_active() -> pid_t { + return if sh_coproc.c_flags & COPROC_DEAD as libc::c_int != 0 { + NO_PID!() + } else { + sh_coproc.c_pid + }; +} +#[macro_export] +macro_rules! INVALID_NAMEREF_VALUE { + () => { + &mut nameref_invalid_value as *mut SHELL_VAR + }; +} + +#[macro_export] +macro_rules! att_nameref { + () => { + 0x0000800 + }; +} + +#[macro_export] +macro_rules! nameref_p { + ($var:expr) => { + (*$var).attributes & att_nameref!() + }; +}