wasmer_wasix/journal/effector/syscalls/
epoll_ctl.rs1use super::*;
2
3impl JournalEffector {
4 pub fn save_epoll_ctl(
5 ctx: &mut FunctionEnvMut<'_, WasiEnv>,
6 epfd: Fd,
7 op: EpollCtl,
8 fd: Fd,
9 event: Option<EpollEventCtl>,
10 ) -> anyhow::Result<()> {
11 Self::save_event(
12 ctx,
13 JournalEntry::EpollCtlV1 {
14 epfd,
15 op,
16 fd,
17 event,
18 },
19 )
20 }
21
22 pub fn apply_epoll_ctl(
23 ctx: &mut FunctionEnvMut<'_, WasiEnv>,
24 pfd: Fd,
25 op: EpollCtl,
26 fd: Fd,
27 event: Option<EpollEventCtl>,
28 ) -> anyhow::Result<()> {
29 crate::syscalls::epoll_ctl_internal(ctx, pfd, op, fd, event.as_ref())
30 .map_err(|err| {
31 anyhow::format_err!(
32 "journal restore error: failed to epoll ctl (pfd={pfd}, op={op:?}, fd={fd}) - {err}")
33 })?
34 .map_err(|err| {
35 anyhow::format_err!(
36 "journal restore error: failed to epoll ctl (pfd={pfd}, op={op:?}, fd={fd}) - {err}")
37 })?;
38
39 Ok(())
40 }
41}