Implement O_DIRECTORY, switch to open for mkdir

This commit is contained in:
Jeremy Soller 2016-11-25 18:24:38 -07:00
parent 09fb7d1d69
commit c018bfe5ef
10 changed files with 33 additions and 44 deletions

View file

@ -93,9 +93,9 @@ pub fn cpu_count() -> usize {
pub extern fn userspace_init() {
assert_eq!(syscall::chdir(b"initfs:bin"), Ok(0));
assert_eq!(syscall::open(b"debug:", 0).map(FileHandle::into), Ok(0));
assert_eq!(syscall::open(b"debug:", 0).map(FileHandle::into), Ok(1));
assert_eq!(syscall::open(b"debug:", 0).map(FileHandle::into), Ok(2));
assert_eq!(syscall::open(b"debug:", syscall::flag::O_RDONLY).map(FileHandle::into), Ok(0));
assert_eq!(syscall::open(b"debug:", syscall::flag::O_WRONLY).map(FileHandle::into), Ok(1));
assert_eq!(syscall::open(b"debug:", syscall::flag::O_WRONLY).map(FileHandle::into), Ok(2));
syscall::exec(b"initfs:bin/init", &[]).expect("failed to execute initfs:init");