mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 04:13:24 +00:00
Add syscall epoll_pwait
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
1435dd0896
commit
2b67dee1fc
@ -2,7 +2,7 @@
|
||||
|
||||
use core::time::Duration;
|
||||
|
||||
use super::{SyscallReturn, SYS_EPOLL_CREATE1, SYS_EPOLL_CTL, SYS_EPOLL_WAIT};
|
||||
use super::{SyscallReturn, SYS_EPOLL_CREATE1, SYS_EPOLL_CTL, SYS_EPOLL_PWAIT, SYS_EPOLL_WAIT};
|
||||
use crate::{
|
||||
events::IoEvents,
|
||||
fs::{
|
||||
@ -137,6 +137,20 @@ pub fn sys_epoll_wait(
|
||||
Ok(SyscallReturn::Return(epoll_events.len() as _))
|
||||
}
|
||||
|
||||
pub fn sys_epoll_pwait(
|
||||
epfd: FileDescripter,
|
||||
events_addr: Vaddr,
|
||||
max_events: i32,
|
||||
timeout: i32,
|
||||
sigmask: Vaddr, //TODO: handle sigmask
|
||||
) -> Result<SyscallReturn> {
|
||||
log_syscall_entry!(SYS_EPOLL_PWAIT);
|
||||
if sigmask != 0 {
|
||||
warn!("epoll_pwait cannot handle signal mask, yet");
|
||||
}
|
||||
sys_epoll_wait(epfd, events_addr, max_events, timeout)
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Pod)]
|
||||
#[repr(C, packed)]
|
||||
struct c_epoll_event {
|
||||
|
Reference in New Issue
Block a user