Add pselect6 syscall

This commit is contained in:
Yuke Peng
2024-06-29 17:10:45 +08:00
committed by Tate, Hongliang Tian
parent 02bf6a9b47
commit 8726d858f2
4 changed files with 31 additions and 1 deletions

View File

@ -290,7 +290,7 @@ provided by Linux on x86-64 architecture.
| 267 | readlinkat | ✅ |
| 268 | fchmodat | ✅ |
| 269 | faccessat | ✅ |
| 270 | pselect6 | |
| 270 | pselect6 | |
| 271 | ppoll | ❌ |
| 272 | unshare | ❌ |
| 273 | set_robust_list | ✅ |

View File

@ -69,6 +69,7 @@ use crate::syscall::{
pread64::sys_pread64,
preadv::{sys_preadv, sys_preadv2, sys_readv},
prlimit64::sys_prlimit64,
pselect6::sys_pselect6,
pwrite64::sys_pwrite64,
pwritev::{sys_pwritev, sys_pwritev2, sys_writev},
read::sys_read,
@ -280,6 +281,7 @@ impl_syscall_nums_and_dispatch_fn! {
SYS_READLINKAT = 267 => sys_readlinkat(args[..4]);
SYS_FCHMODAT = 268 => sys_fchmodat(args[..3]);
SYS_FACCESSAT = 269 => sys_faccessat(args[..3]);
SYS_PSELECT6 = 270 => sys_pselect6(args[..6]);
SYS_SET_ROBUST_LIST = 273 => sys_set_robust_list(args[..2]);
SYS_UTIMENSAT = 280 => sys_utimensat(args[..4]);
SYS_EPOLL_PWAIT = 281 => sys_epoll_pwait(args[..6]);

View File

@ -76,6 +76,7 @@ mod prctl;
mod pread64;
mod preadv;
mod prlimit64;
mod pselect6;
mod pwrite64;
mod pwritev;
mod read;

View File

@ -0,0 +1,27 @@
// SPDX-License-Identifier: MPL-2.0
use super::{select::sys_select, SyscallReturn};
use crate::{fs::file_table::FileDesc, prelude::*};
pub fn sys_pselect6(
nfds: FileDesc,
readfds_addr: Vaddr,
writefds_addr: Vaddr,
exceptfds_addr: Vaddr,
timeval_addr: Vaddr,
sigmask_addr: Vaddr,
) -> Result<SyscallReturn> {
// TODO: Support signal mask
if sigmask_addr != 0 {
error!("[SYS_PSELECT6] Not support sigmask now");
return Err(Error::new(Errno::ENOSYS));
}
sys_select(
nfds,
readfds_addr,
writefds_addr,
exceptfds_addr,
timeval_addr,
)
}