shadow_rs/host/syscall/handler/
poll.rs
1use shadow_shim_helper_rs::syscall_types::ForeignPtr;
2
3use crate::cshadow as c;
4use crate::host::syscall::handler::{SyscallContext, SyscallHandler};
5use crate::host::syscall::types::SyscallError;
6
7impl SyscallHandler {
8 log_syscall!(
9 poll,
10 std::ffi::c_int,
11 *const std::ffi::c_void,
12 std::ffi::c_uint,
13 std::ffi::c_int,
14 );
15 pub fn poll(
16 ctx: &mut SyscallContext,
17 _ufds: ForeignPtr<linux_api::poll::pollfd>,
18 _nfds: std::ffi::c_uint,
19 _timeout_msecs: std::ffi::c_int,
20 ) -> Result<std::ffi::c_int, SyscallError> {
21 Self::legacy_syscall(c::syscallhandler_poll, ctx)
22 }
23
24 log_syscall!(
25 ppoll,
26 std::ffi::c_int,
27 *const std::ffi::c_void,
28 std::ffi::c_uint,
29 *const linux_api::time::kernel_timespec,
30 *const std::ffi::c_void,
31 libc::size_t,
32 );
33 pub fn ppoll(
34 ctx: &mut SyscallContext,
35 _ufds: ForeignPtr<linux_api::poll::pollfd>,
36 _nfds: std::ffi::c_uint,
37 _tsp: ForeignPtr<linux_api::time::kernel_timespec>,
38 _sigmask: ForeignPtr<linux_api::signal::sigset_t>,
39 _sigsetsize: libc::size_t,
40 ) -> Result<std::ffi::c_int, SyscallError> {
41 Self::legacy_syscall(c::syscallhandler_ppoll, ctx)
42 }
43}