1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-22 08:06:17 +04:00

Merge pull request #66 from wfly1998/master

update rboot; fix problem of sys_poll
This commit is contained in:
Chen 2020-08-25 09:51:10 +08:00 committed by GitHub
commit 87e4039dd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -116,7 +116,7 @@ impl Syscall<'_> {
pub async fn sys_poll(
&mut self,
ufds: UserInOutPtr<PollFd>,
mut ufds: UserInOutPtr<PollFd>,
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<PollFd>,
polls: &'a mut Vec<PollFd>,
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(

2
rboot

@ -1 +1 @@
Subproject commit e610182ba0c12bb19394e40b79b0ab0c26436e49
Subproject commit ea29a73dcf579fcf4215542423a60f75f4244d37