Add redox_openat_v1

This commit is contained in:
Darley Barreto
2025-04-05 14:50:02 -03:00
parent baaaf8f130
commit d2cc45f59c
3 changed files with 16 additions and 4 deletions
Generated
+2 -2
View File
@@ -457,9 +457,9 @@ dependencies = [
[[package]]
name = "redox_syscall"
version = "0.5.8"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834"
checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3"
dependencies = [
"bitflags",
]
+1 -1
View File
@@ -61,7 +61,7 @@ features = ["c_api"]
sc = "0.2.3"
[target.'cfg(target_os = "redox")'.dependencies]
redox_syscall = "0.5.8"
redox_syscall = "0.5.11"
redox-rt = { path = "redox-rt" }
redox-path = "0.2"
redox_event = { git = "https://gitlab.redox-os.org/redox-os/event.git", default-features = false, features = [
+13 -1
View File
@@ -128,7 +128,19 @@ pub unsafe extern "C" fn redox_open_v1(
mode as mode_t,
))
}
#[no_mangle]
pub unsafe extern "C" fn redox_openat_v1(
fd: usize,
path_base: *const u8,
path_len: usize,
flags: u32,
) -> RawResult {
Error::mux(syscall::openat(
fd,
str::from_utf8_unchecked(slice::from_raw_parts(path_base, path_len)),
flags as usize,
))
}
#[no_mangle]
pub unsafe extern "C" fn redox_dup_v1(fd: usize, buf: *const u8, len: usize) -> RawResult {
Error::mux(syscall::dup(fd, core::slice::from_raw_parts(buf, len)))