wasmer_wasix/journal/effector/syscalls/
fd_pipe.rs1use super::*;
2
3impl JournalEffector {
4 pub fn save_fd_pipe(
5 ctx: &mut FunctionEnvMut<'_, WasiEnv>,
6 read_fd: Fd,
7 write_fd: Fd,
8 ) -> anyhow::Result<()> {
9 Self::save_event(ctx, JournalEntry::CreatePipeV1 { read_fd, write_fd })
10 }
11
12 pub fn apply_fd_pipe(
13 ctx: &mut FunctionEnvMut<'_, WasiEnv>,
14 read_fd: Fd,
15 write_fd: Fd,
16 ) -> anyhow::Result<()> {
17 crate::syscalls::fd_pipe_internal(ctx, Some(read_fd), Some(write_fd)).map_err(|err| {
18 anyhow::format_err!("journal restore error: failed to create pipe - {err}")
19 })?;
20
21 Ok(())
22 }
23}