Allow exec, emulate clone by pretending to be child

This commit is contained in:
Jeremy Soller 2016-09-11 18:03:10 -06:00
parent 2fffe3ee77
commit f0431f4de1
6 changed files with 33 additions and 13 deletions

View file

@ -125,8 +125,8 @@ pub fn dup(fd: usize) -> Result<usize> {
unsafe { syscall1(SYS_DUP, fd) }
}
pub unsafe fn execve(path: *const u8, args: *const *const u8) -> Result<usize> {
syscall2(SYS_EXECVE, path as usize, args as usize)
pub fn execve(path: &str) -> Result<usize> {
unsafe { syscall2(SYS_EXECVE, path.as_ptr() as usize, path.len()) }
}
pub fn exit(status: usize) -> Result<usize> {