From 02c1f441ae93af5859816a82ba1b0ac9bb992033 Mon Sep 17 00:00:00 2001 From: pjht Date: Sat, 9 Nov 2024 21:42:54 -0600 Subject: [PATCH] Change to using proc_man for CLI arguments --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 628215a..4874daa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -154,8 +154,11 @@ fn run_initrd_proc(initrd: &TarArchiveRef, path: &str) -> u64 { .unwrap_or_else(|| panic!("{} not found", path)) .data(); let (space, entry) = Loader::load(proc); - let path_arg = CString::new(path).unwrap(); - let pid = new_process(entry as _, space, &[path_arg.as_bytes_with_nul()]).unwrap(); + let pid = new_process(entry as _, space).unwrap(); + if let Some(proc_man_pid) = syscalls::try_get_registered(3) { + let proc_man_client = proc_man_rpc::Client::new(proc_man_pid); + proc_man_client.set_cli_args(pid, vec![path.to_string().parse().unwrap()]).unwrap(); + } syscalls::wake_new(pid).unwrap(); pid }