Update syscall and rust, add fcntl for permissions

This commit is contained in:
Jeremy Soller 2016-11-15 16:12:51 -07:00
parent 16f5c82796
commit 37395f36ea
12 changed files with 26 additions and 8 deletions

View file

@ -9,3 +9,7 @@ event = { path = "../../crates/event/" }
io = { path = "../../crates/io/" } io = { path = "../../crates/io/" }
netutils = { path = "../../programs/netutils/" } netutils = { path = "../../programs/netutils/" }
redox_syscall = { path = "../../syscall/" } redox_syscall = { path = "../../syscall/" }
[replace]
"libc:0.2.17" = { git = "https://github.com/rust-lang/libc.git" }
"rand:0.3.14" = { git = "https://github.com/rust-lang-nursery/rand.git" }

View file

@ -9,3 +9,7 @@ event = { path = "../../crates/event/" }
io = { path = "../../crates/io/" } io = { path = "../../crates/io/" }
netutils = { path = "../../programs/netutils/" } netutils = { path = "../../programs/netutils/" }
redox_syscall = { path = "../../syscall/" } redox_syscall = { path = "../../syscall/" }
[replace]
"libc:0.2.17" = { git = "https://github.com/rust-lang/libc.git" }
"rand:0.3.14" = { git = "https://github.com/rust-lang-nursery/rand.git" }

View file

@ -6,7 +6,7 @@ use scheme::{AtomicSchemeId, ATOMIC_SCHEMEID_INIT};
use sync::WaitCondition; use sync::WaitCondition;
use syscall::error::{Error, Result, EAGAIN, EBADF, EINVAL, EPIPE}; use syscall::error::{Error, Result, EAGAIN, EBADF, EINVAL, EPIPE};
use syscall::flag::{F_GETFL, F_SETFL, O_CLOEXEC, O_NONBLOCK}; use syscall::flag::{F_GETFL, F_SETFL, O_ACCMODE, O_CLOEXEC, O_NONBLOCK};
use syscall::scheme::Scheme; use syscall::scheme::Scheme;
/// Pipes list /// Pipes list
@ -155,7 +155,7 @@ impl PipeRead {
match cmd { match cmd {
F_GETFL => Ok(self.flags.load(Ordering::SeqCst)), F_GETFL => Ok(self.flags.load(Ordering::SeqCst)),
F_SETFL => { F_SETFL => {
self.flags.store(arg, Ordering::SeqCst); self.flags.store(arg & ! O_ACCMODE, Ordering::SeqCst);
Ok(0) Ok(0)
}, },
_ => Err(Error::new(EINVAL)) _ => Err(Error::new(EINVAL))
@ -229,7 +229,7 @@ impl PipeWrite {
match cmd { match cmd {
F_GETFL => Ok(self.flags.load(Ordering::SeqCst)), F_GETFL => Ok(self.flags.load(Ordering::SeqCst)),
F_SETFL => { F_SETFL => {
self.flags.store(arg, Ordering::SeqCst); self.flags.store(arg & ! O_ACCMODE, Ordering::SeqCst);
Ok(0) Ok(0)
}, },
_ => Err(Error::new(EINVAL)) _ => Err(Error::new(EINVAL))

@ -1 +1 @@
Subproject commit 1b92d72f5b4a2c693be659ee56708076fea44dc0 Subproject commit 81bde2c5484eb8d2345194a60f8fd556f2c54853

@ -1 +1 @@
Subproject commit ba16f79ada8ef33960007143004f59e15c7610c4 Subproject commit 6305f222ad6c1b00fce6930b7df5cb2a659df8b4

2
rust

@ -1 +1 @@
Subproject commit 73f24d47dee367563019b18ac5089b91eded2753 Subproject commit 2e5c821619c7b62ec46c8a4f90ead4e59fb6c36e

View file

@ -6,3 +6,7 @@ version = "0.1.0"
event = { path = "../../crates/event/" } event = { path = "../../crates/event/" }
netutils = { path = "../../programs/netutils/" } netutils = { path = "../../programs/netutils/" }
redox_syscall = { path = "../../syscall/" } redox_syscall = { path = "../../syscall/" }
[replace]
"libc:0.2.17" = { git = "https://github.com/rust-lang/libc.git" }
"rand:0.3.14" = { git = "https://github.com/rust-lang-nursery/rand.git" }

View file

@ -6,3 +6,7 @@ version = "0.1.0"
event = { path = "../../crates/event/" } event = { path = "../../crates/event/" }
netutils = { path = "../../programs/netutils/" } netutils = { path = "../../programs/netutils/" }
redox_syscall = { path = "../../syscall/" } redox_syscall = { path = "../../syscall/" }
[replace]
"libc:0.2.17" = { git = "https://github.com/rust-lang/libc.git" }
"rand:0.3.14" = { git = "https://github.com/rust-lang-nursery/rand.git" }

@ -1 +1 @@
Subproject commit 8449c5b6ad87ced01bcb82627cb85a8981337210 Subproject commit 8a22d9666927cd2d7040711b7db4eb4dcf73fc48

View file

@ -10,3 +10,4 @@ redox_syscall = { path = "../../syscall/" }
[replace] [replace]
"libc:0.2.17" = { git = "https://github.com/rust-lang/libc.git" } "libc:0.2.17" = { git = "https://github.com/rust-lang/libc.git" }
"rand:0.3.14" = { git = "https://github.com/rust-lang-nursery/rand.git" }

View file

@ -10,3 +10,4 @@ redox_syscall = { path = "../../syscall/" }
[replace] [replace]
"libc:0.2.17" = { git = "https://github.com/rust-lang/libc.git" } "libc:0.2.17" = { git = "https://github.com/rust-lang/libc.git" }
"rand:0.3.14" = { git = "https://github.com/rust-lang-nursery/rand.git" }

@ -1 +1 @@
Subproject commit f48cbf22f3cf85e73f2dd778c3764ad430cd30e8 Subproject commit cd6f7c219cc295e9d0b9f5068b107fd13f12af90