Implement redox_mkfs_v1.

This commit is contained in:
4lDO2
2024-03-18 17:18:42 +01:00
parent 70abce96c1
commit df91c67cf0
+18 -1
View File
@@ -3,7 +3,9 @@ use core::{slice, str};
use syscall::{Error, Result, WaitFlags, EMFILE};
use crate::{
header::{errno::EINVAL, signal::sigaction, sys_stat::UTIME_NOW, time::timespec},
header::{
errno::EINVAL, signal::sigaction, sys_stat::UTIME_NOW, sys_uio::iovec, time::timespec,
},
platform::types::*,
};
@@ -319,3 +321,18 @@ pub unsafe extern "C" fn redox_strerror_v1(
Ok(len)
})())
}
#[no_mangle]
pub unsafe extern "C" fn redox_mkns_v1(
names: *const iovec,
num_names: usize,
flags: u32,
) -> RawResult {
Error::mux((|| {
if flags != 0 {
return Err(Error::new(EINVAL));
}
// Kernel does the UTF-8 validation.
syscall::mkns(core::slice::from_raw_parts(names.cast(), num_names))
})())
}