Merge branch 'libredox2' into 'master'
Switch remaining clock_gettimes to libredox. See merge request redox-os/netstack!47
This commit is contained in:
Generated
+12
-33
@@ -51,9 +51,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "2.4.2"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
|
||||
checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
@@ -261,7 +261,7 @@ version = "0.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"bitflags 2.5.0",
|
||||
"libc",
|
||||
"redox_syscall 0.4.1",
|
||||
]
|
||||
@@ -272,7 +272,7 @@ version = "0.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "86b5213a34db3434d9c562c16af0d4da82653193805009da815cbc020e8b39df"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"bitflags 2.5.0",
|
||||
"libc",
|
||||
"redox_syscall 0.4.1",
|
||||
]
|
||||
@@ -283,7 +283,7 @@ version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"bitflags 2.5.0",
|
||||
"ioslice",
|
||||
"libc",
|
||||
"redox_syscall 0.5.1",
|
||||
@@ -342,7 +342,7 @@ dependencies = [
|
||||
"redox-daemon",
|
||||
"redox_event 0.3.0",
|
||||
"redox_termios",
|
||||
"termion 2.0.3",
|
||||
"termion",
|
||||
"url",
|
||||
]
|
||||
|
||||
@@ -453,14 +453,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "redox-log"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cbf6d33a003a5c0b94ec11f10c7c797303f236592964ddb1bfb93e1b438a1557"
|
||||
checksum = "dbd7c67eb2d8e610a74a8f1e67eecd3042f87b1aebfa620de4b40257265a54f2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"log",
|
||||
"smallvec",
|
||||
"termion 1.5.6",
|
||||
"termion",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -469,7 +469,7 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "35eb92c4487aacb8d4326ae0d4d443237528a42f41b95d62858d95c6a42f0272"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"bitflags 2.5.0",
|
||||
"libredox 0.0.4",
|
||||
"redox_syscall 0.4.1",
|
||||
]
|
||||
@@ -480,7 +480,7 @@ version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "69609faa5d5992247a4ef379917bb3e39be281405d6a0ccd4f942429400b956f"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"bitflags 2.5.0",
|
||||
"libredox 0.1.3",
|
||||
]
|
||||
|
||||
@@ -502,15 +502,6 @@ dependencies = [
|
||||
"smoltcp",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.4.1"
|
||||
@@ -526,7 +517,7 @@ version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"bitflags 2.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -613,18 +604,6 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termion"
|
||||
version = "1.5.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"numtoa",
|
||||
"redox_syscall 0.2.16",
|
||||
"redox_termios",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termion"
|
||||
version = "2.0.3"
|
||||
|
||||
+5
-6
@@ -11,6 +11,7 @@ use std::str::FromStr;
|
||||
use std::rc::Rc;
|
||||
use std::net::Ipv4Addr;
|
||||
|
||||
use libredox::flag;
|
||||
use syscall::data::TimeSpec;
|
||||
use syscall::{Error as SyscallError, EventFlags as SyscallEventFlags, Packet as SyscallPacket, Result as SyscallResult, SchemeMut};
|
||||
use syscall;
|
||||
@@ -430,9 +431,8 @@ impl SchemeMut for Dnsd<'_> {
|
||||
}
|
||||
let fd = self.next_fd;
|
||||
self.next_fd += 1;
|
||||
let mut cur_time = TimeSpec::default();
|
||||
syscall::clock_gettime(syscall::CLOCK_MONOTONIC, &mut cur_time)?;
|
||||
let dns_file = self.domains.file_from_domain(&domain, fd, &cur_time, self.queue);
|
||||
let cur_time = libredox::call::clock_gettime(flag::CLOCK_MONOTONIC)?;
|
||||
let dns_file = self.domains.file_from_domain(&domain, fd, &TimeSpec { tv_sec: cur_time.tv_sec, tv_nsec: cur_time.tv_nsec as i32 }, self.queue);
|
||||
self.files.insert(fd, dns_file);
|
||||
trace!("Open {} {}", &domain, fd);
|
||||
Ok(fd)
|
||||
@@ -462,11 +462,10 @@ impl SchemeMut for Dnsd<'_> {
|
||||
.get_mut(&fd)
|
||||
.ok_or_else(|| SyscallError::new(syscall::EBADF))?;
|
||||
|
||||
let mut cur_time = TimeSpec::default();
|
||||
syscall::clock_gettime(syscall::CLOCK_MONOTONIC, &mut cur_time)?;
|
||||
let cur_time = libredox::call::clock_gettime(flag::CLOCK_MONOTONIC)?;
|
||||
|
||||
if let DnsFile::Waiting { ref domain } = *file {
|
||||
*file = self.domains.file_from_domain(domain, fd, &cur_time, self.queue);
|
||||
*file = self.domains.file_from_domain(domain, fd, &TimeSpec { tv_sec: cur_time.tv_sec, tv_nsec: cur_time.tv_nsec as i32 }, self.queue);
|
||||
}
|
||||
|
||||
match *file {
|
||||
|
||||
@@ -10,7 +10,7 @@ use std::ops::DerefMut;
|
||||
use std::rc::Rc;
|
||||
use std::str;
|
||||
|
||||
use libredox::flag::CLOCK_MONOTONIC;
|
||||
use libredox::flag::{self, CLOCK_MONOTONIC};
|
||||
use syscall::{self, KSMSG_CANCEL};
|
||||
use syscall::data::TimeSpec;
|
||||
use syscall::flag::{EVENT_READ, EVENT_WRITE};
|
||||
@@ -317,9 +317,8 @@ where
|
||||
}
|
||||
|
||||
pub fn notify_sockets(&mut self) -> Result<()> {
|
||||
let mut cur_time = TimeSpec::default();
|
||||
syscall::clock_gettime(syscall::CLOCK_MONOTONIC, &mut cur_time)
|
||||
.map_err(|e| Error::from_syscall_error(e, "Can't get time"))?;
|
||||
let cur_time = libredox::call::clock_gettime(flag::CLOCK_MONOTONIC)
|
||||
.map_err(|e| Error::from_syscall_error(e.into(), "Can't get time"))?;
|
||||
|
||||
// Notify non-blocking sockets
|
||||
for (&fd, ref mut file) in &mut self.files {
|
||||
@@ -345,7 +344,7 @@ where
|
||||
Some(until)
|
||||
if (until.tv_sec < cur_time.tv_sec
|
||||
|| (until.tv_sec == cur_time.tv_sec
|
||||
&& until.tv_nsec < cur_time.tv_nsec)) =>
|
||||
&& i64::from(until.tv_nsec) < cur_time.tv_nsec)) =>
|
||||
{
|
||||
self.wait_queue.remove(i);
|
||||
packet.a = (-syscall::ETIMEDOUT) as usize;
|
||||
|
||||
Reference in New Issue
Block a user