diff --git a/bash-5.1/r_execute_cmd/Cargo.toml b/bash-5.1/r_execute_cmd/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..fcd280dc659b8202531db8c4dc7d6d292bbd1964 --- /dev/null +++ b/bash-5.1/r_execute_cmd/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "r_execute_cmd" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +libc = "*" +r_bash = {path = "../r_bash"} +r_jobs = {path = "../r_jobs"} +rexec_cmd = {path = "../builtins_rust/exec_cmd"} +rcommon = {path = "../builtins_rust/common"} + +[lib] +name = "r_execute_cmd" +crate-type = ["rlib", "staticlib"] + + + + + + diff --git a/bash-5.1/r_execute_cmd/src/lib.rs b/bash-5.1/r_execute_cmd/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..174bc221524afbe433d23f4659ef4ef653ecca94 --- /dev/null +++ b/bash-5.1/r_execute_cmd/src/lib.rs @@ -0,0 +1,62 @@ +use std::{ffi::CStr}; +use std::mem::{size_of, transmute}; +use libc::{c_char, c_int, c_void,__errno_location}; +use r_bash::*; +use r_jobs::{BLOCK_CHILD, UNBLOCK_CHILD, SIG_IGN,}; +use rexec_cmd::{r_exec_cmd}; +use rcommon::{WordList, WordDesc}; +use stdext::function_name; + + +#[no_mangle] +pub static mut stdin_redir: libc::c_int = 0; +#[no_mangle] +pub static mut this_command_name: *mut libc::c_char = 0 as *mut libc::c_char; +#[no_mangle] +pub static mut the_printed_command_except_trap: *mut libc::c_char = 0 as *mut libc::c_char; +#[no_mangle] +pub static mut return_catch_flag: libc::c_int = 0; +#[no_mangle] +pub static mut return_catch_value: libc::c_int = 0; +#[no_mangle] +pub static mut return_catch: sigjmp_buf = [__jmp_buf_tag { + __jmpbuf: [0; 8], + __mask_was_saved: 0, + __saved_mask: __sigset_t { __val: [0; 16] }, +}; 1]; +#[no_mangle] +pub static mut last_command_exit_value: libc::c_int = 0; +#[no_mangle] +pub static mut last_command_exit_signal: libc::c_int = 0; +#[no_mangle] +pub static mut builtin_ignoring_errexit: libc::c_int = 0 as libc::c_int; +#[no_mangle] +pub static mut redirection_undo_list: *mut REDIRECT = 0 as *const libc::c_void + as *mut libc::c_void as *mut REDIRECT; +#[no_mangle] +pub static mut exec_redirection_undo_list: *mut REDIRECT = 0 as *const libc::c_void + as *mut libc::c_void as *mut REDIRECT; + + + + + + + + + + + + + + + + + + + + + + + +