From 341451c90ba250a177babc27696cf069b615d7b6 Mon Sep 17 00:00:00 2001 From: Yukiteru Lee Date: Tue, 25 Aug 2020 09:22:21 +0800 Subject: [PATCH 1/2] update rboot --- rboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rboot b/rboot index e610182b..ea29a73d 160000 --- a/rboot +++ b/rboot @@ -1 +1 @@ -Subproject commit e610182ba0c12bb19394e40b79b0ab0c26436e49 +Subproject commit ea29a73dcf579fcf4215542423a60f75f4244d37 From ec4871278d1f1778cd84958cb3dd27f2d0f73fce Mon Sep 17 00:00:00 2001 From: Yukiteru Lee Date: Tue, 25 Aug 2020 09:22:33 +0800 Subject: [PATCH 2/2] fix problem of sys_poll --- kernel/src/syscall/fs.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kernel/src/syscall/fs.rs b/kernel/src/syscall/fs.rs index 32e101f1..a74a4b89 100644 --- a/kernel/src/syscall/fs.rs +++ b/kernel/src/syscall/fs.rs @@ -116,7 +116,7 @@ impl Syscall<'_> { pub async fn sys_poll( &mut self, - ufds: UserInOutPtr, + mut ufds: UserInOutPtr, nfds: usize, timeout_msecs: usize, ) -> SysResult { @@ -132,7 +132,7 @@ impl Syscall<'_> { // check whether the fds is valid and is owned by this process let condvars = alloc::vec![&(*TICK_ACTIVITY), &(*SOCKET_ACTIVITY)]; - let polls = ufds.read_array(nfds).unwrap(); + let mut polls = ufds.read_array(nfds).unwrap(); if !proc.pid.is_init() { info!("poll: fds: {:?}", polls); @@ -142,7 +142,7 @@ impl Syscall<'_> { #[must_use = "future does nothing unless polled/`await`-ed"] struct PollFuture<'a> { - polls: Vec, + polls: &'a mut Vec, syscall: &'a Syscall<'a>, } @@ -193,10 +193,12 @@ impl Syscall<'_> { } let future = PollFuture { - polls, + polls: &mut polls, syscall: self, }; - future.await + let res = future.await; + ufds.write_array(&polls)?; + res } pub fn sys_pselect6(