Complete execve - add argument support using safe ABI

This commit is contained in:
Jeremy Soller 2016-09-17 21:44:50 -06:00
parent 57f5699664
commit cfbaccf4d2
7 changed files with 167 additions and 122 deletions

View file

@ -126,8 +126,8 @@ pub fn dup(fd: usize) -> Result<usize> {
unsafe { syscall1(SYS_DUP, fd) }
}
pub fn execve(path: &str) -> Result<usize> {
unsafe { syscall2(SYS_EXECVE, path.as_ptr() as usize, path.len()) }
pub fn execve(path: &str, args: &[[usize; 2]]) -> Result<usize> {
unsafe { syscall4(SYS_EXECVE, path.as_ptr() as usize, path.len(), args.as_ptr() as usize, args.len()) }
}
pub fn exit(status: usize) -> Result<usize> {