Cleanup OpenOptions
This commit is contained in:
parent
84f645fd0c
commit
84de8cc141
@ -17,7 +17,7 @@ pub mod time;
|
||||
pub mod io {
|
||||
//! I/O data structures
|
||||
|
||||
pub use abi::io::{MountOptions, OpenFlags, RawFd, UnmountOptions};
|
||||
pub use abi::io::{FileMode, MountOptions, OpenOptions, RawFd, UnmountOptions};
|
||||
}
|
||||
|
||||
/// Type alias for a raw file descriptor
|
||||
|
@ -3,7 +3,7 @@ use core::time::Duration;
|
||||
|
||||
use abi::{
|
||||
error::{Error, SyscallResult},
|
||||
io::{MountOptions, OpenFlags, RawFd, UnmountOptions},
|
||||
io::{FileMode, MountOptions, OpenOptions, RawFd, UnmountOptions},
|
||||
syscall::SyscallFunction,
|
||||
};
|
||||
|
||||
@ -166,12 +166,13 @@ pub unsafe fn read(fd: RawFd, buf: &mut [u8]) -> Result<usize, Error> {
|
||||
/// # Safety
|
||||
///
|
||||
/// Unsafe: direct system call.
|
||||
pub unsafe fn open(path: &str, opts: OpenFlags) -> Result<RawFd, Error> {
|
||||
pub unsafe fn open(path: &str, opts: OpenOptions, mode: FileMode) -> Result<RawFd, Error> {
|
||||
RawFd::from_syscall_result(syscall!(
|
||||
SyscallFunction::Open,
|
||||
argp!(path.as_ptr()),
|
||||
argn!(path.len()),
|
||||
argn!(opts.0)
|
||||
argn!(opts.bits()),
|
||||
argn!(mode.bits())
|
||||
))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user