* Implement open operation
* Comment out the code for dup2
This commit is contained in:
Generated
+21
-12
@@ -205,9 +205,9 @@ version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "goblin"
|
||||
version = "0.10.5"
|
||||
version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "983a6aafb3b12d4c41ea78d39e189af4298ce747353945ff5105b54a056e5cd9"
|
||||
checksum = "0d494b2004fbc8cf419a6d2115488df4e11140f6f4abd877519de1bbd90c5370"
|
||||
dependencies = [
|
||||
"log",
|
||||
"plain",
|
||||
@@ -263,7 +263,7 @@ dependencies = [
|
||||
"bitflags",
|
||||
"libc",
|
||||
"plain",
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.8.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -283,9 +283,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.29"
|
||||
version = "0.4.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
||||
checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5"
|
||||
|
||||
[[package]]
|
||||
name = "md-5"
|
||||
@@ -299,9 +299,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.8.0"
|
||||
version = "2.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
||||
checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8"
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
@@ -436,7 +436,7 @@ name = "redox-ioctl"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"drm-sys",
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -456,7 +456,7 @@ dependencies = [
|
||||
"libredox",
|
||||
"plain",
|
||||
"redox-path",
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -466,13 +466,22 @@ source = "git+https://gitlab.redox-os.org/EuclidDivisionLemma/event?branch=spawn
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"libredox",
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.8.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.8.0"
|
||||
source = "git+https://gitlab.redox-os.org/EuclidDivisionLemma/syscall/?branch=spawn#5ae449893d6bc3731ad122d8320372cfbe83c245"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c7591fa2c6b601dfcfe5f043f65a1c39fcdf50efefcd7f1572e538c1f4b398d"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.9.0"
|
||||
source = "git+https://gitlab.redox-os.org/EuclidDivisionLemma/syscall/?branch=spawn#4a768587a071f8c87e915c6b0836d272bed1d56c"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
@@ -509,7 +518,7 @@ dependencies = [
|
||||
"redox-path",
|
||||
"redox-rt",
|
||||
"redox_event",
|
||||
"redox_syscall",
|
||||
"redox_syscall 0.9.0",
|
||||
"sc",
|
||||
"scrypt",
|
||||
"sha-crypt",
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ ioslice = { version = "0.6", default-features = false }
|
||||
plain = "0.2"
|
||||
redox-path = "0.3"
|
||||
redox_protocols = { package = "libredox", version = "0.1.17", default-features = false, features = ["protocol"] }
|
||||
redox_syscall = "0.8.0"
|
||||
redox_syscall = "0.9.0"
|
||||
[build-dependencies]
|
||||
cc = "1"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ description = "Ioctl definitions and (de)serialization for Redox"
|
||||
|
||||
[dependencies]
|
||||
drm-sys = "0.8.0"
|
||||
redox_syscall = "0.8"
|
||||
redox_syscall = "0.9"
|
||||
|
||||
[patch.crates-io]
|
||||
redox_syscall = {git = "https://gitlab.redox-os.org/EuclidDivisionLemma/syscall/", branch = "spawn"}
|
||||
|
||||
+19
-10
@@ -1273,7 +1273,16 @@ impl Pal for Sys {
|
||||
path,
|
||||
flag,
|
||||
mode,
|
||||
} => todo!(),
|
||||
} => {
|
||||
let src_fd =
|
||||
Sys::open(unsafe { CStr::from_ptr(path) }, flag, mode)? as usize;
|
||||
syscall::sendfd(
|
||||
new_file_table.as_raw_fd(),
|
||||
src_fd,
|
||||
0,
|
||||
u64::try_from(fd).map_err(|_| Errno(EBADFD))?,
|
||||
)?;
|
||||
}
|
||||
crate::header::spawn::Operation::Close(fd) => {
|
||||
new_file_table.call_wo(
|
||||
&(fd as usize).to_ne_bytes(),
|
||||
@@ -1284,15 +1293,15 @@ impl Pal for Sys {
|
||||
crate::header::spawn::Operation::Chdir(_) => todo!(),
|
||||
crate::header::spawn::Operation::FChdir(_) => todo!(),
|
||||
crate::header::spawn::Operation::Dup2(old, new) => {
|
||||
new_file_table.call_wo(
|
||||
[(old as usize).to_ne_bytes(), (new as usize).to_ne_bytes()]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.collect::<Vec<u8>>()
|
||||
.as_slice(),
|
||||
syscall::CallFlags::empty(),
|
||||
&[syscall::flag::FileTableVerb::Dup2 as u64],
|
||||
)?;
|
||||
// new_file_table.call_wo(
|
||||
// [(old as usize).to_ne_bytes(), (new as usize).to_ne_bytes()]
|
||||
// .into_iter()
|
||||
// .flatten()
|
||||
// .collect::<Vec<u8>>()
|
||||
// .as_slice(),
|
||||
// syscall::CallFlags::empty(),
|
||||
// &[syscall::flag::FileTableVerb::Dup2 as u64],
|
||||
// )?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user