Implement O_DIRECTORY, switch to open for mkdir

This commit is contained in:
Jeremy Soller 2016-11-25 18:24:38 -07:00
commit c018bfe5ef

View file

@ -468,7 +468,7 @@ pub fn exec(path: &[u8], arg_ptrs: &[[usize; 2]]) -> Result<usize> {
(context.euid, context.egid, context.canonicalize(path))
};
let file = syscall::open(&canonical, 0)?;
let file = syscall::open(&canonical, syscall::flag::O_RDONLY)?;
let mut stat = Stat::default();
syscall::file_op_mut_slice(syscall::number::SYS_FSTAT, file, &mut stat)?;