MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / set_exec

Method set_exec

crates/openshell-driver-vm/src/runtime.rs:1163–1181  ·  view source on GitHub ↗
(&self, exec_path: &str, args: &[String], env: &[String])

Source from the content-addressed store, hash-verified

1161 }
1162
1163 fn set_exec(&self, exec_path: &str, args: &[String], env: &[String]) -> Result<(), String> {
1164 let exec_c = CString::new(exec_path).map_err(|e| format!("invalid exec path: {e}"))?;
1165 let argv_slices: Vec<&str> = args.iter().map(String::as_str).collect();
1166 let (_argv_owners, argv_ptrs) = c_string_array(&argv_slices)?;
1167 let env_slices: Vec<&str> = env.iter().map(String::as_str).collect();
1168 let (_env_owners, env_ptrs) = c_string_array(&env_slices)?;
1169
1170 check(
1171 unsafe {
1172 (self.krun.krun_set_exec)(
1173 self.ctx_id,
1174 exec_c.as_ptr(),
1175 argv_ptrs.as_ptr(),
1176 env_ptrs.as_ptr(),
1177 )
1178 },
1179 "krun_set_exec",
1180 )
1181 }
1182
1183 fn start_enter(&self) -> i32 {
1184 unsafe { (self.krun.krun_start_enter)(self.ctx_id) }

Callers 1

run_libkrun_vmFunction · 0.80

Calls 2

c_string_arrayFunction · 0.85
checkFunction · 0.85

Tested by

no test coverage detected