wasmer_wasix/journal/effector/syscalls/
clock_time.rs1use super::*;
2
3impl JournalEffector {
4 pub fn save_clock_time_set(
5 ctx: &mut FunctionEnvMut<'_, WasiEnv>,
6 clock_id: Snapshot0Clockid,
7 time: Timestamp,
8 ) -> anyhow::Result<()> {
9 Self::save_event(ctx, JournalEntry::SetClockTimeV1 { clock_id, time })
10 }
11
12 pub fn apply_clock_time_set(
13 ctx: &mut FunctionEnvMut<'_, WasiEnv>,
14 clock_id: Snapshot0Clockid,
15 time: Timestamp,
16 ) -> anyhow::Result<()> {
17 let ret = crate::syscalls::clock_time_set_internal(ctx, clock_id, time);
18 if ret != Errno::Success {
19 bail!(
20 "journal restore error: failed to set clock time (clock_id={clock_id:?}, time={time}) - {ret}"
21 );
22 }
23 Ok(())
24 }
25}