Skip to content
Snippets Groups Projects
Verified Commit 12820978 authored by jD91mZM2's avatar jD91mZM2
Browse files

Finish up fexec migration

parent 66d7aa85
No related branches found
No related tags found
No related merge requests found
...@@ -98,7 +98,9 @@ pub unsafe extern "C" fn _start_rust(sp: &'static Stack) -> ! { ...@@ -98,7 +98,9 @@ pub unsafe extern "C" fn _start_rust(sp: &'static Stack) -> ! {
platform::exit(main( platform::exit(main(
argc, argc,
argv, argv,
envp // not envp, because programs like bash try to modify this *const*
// pointer :|
platform::environ as *const *const c_char
)); ));
} }
......
...@@ -219,7 +219,7 @@ pub unsafe extern "C" fn execve( ...@@ -219,7 +219,7 @@ pub unsafe extern "C" fn execve(
while *arg.offset(len) != 0 { while *arg.offset(len) != 0 {
len += 1; len += 1;
} }
args.push([*arg as usize, len as usize]); args.push([arg as usize, len as usize]);
argv = argv.offset(1); argv = argv.offset(1);
} }
...@@ -236,7 +236,7 @@ pub unsafe extern "C" fn execve( ...@@ -236,7 +236,7 @@ pub unsafe extern "C" fn execve(
while *env.offset(len) != 0 { while *env.offset(len) != 0 {
len += 1; len += 1;
} }
envs.push([*env as usize, len as usize]); envs.push([env as usize, len as usize]);
envp = envp.offset(1); envp = envp.offset(1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment