Skip to main content

prepare_exec

Function prepare_exec 

Source
pub async fn prepare_exec<G, T>(
    guest: &mut G,
    mm: MmId,
    fd_blocking: BTreeSet<RawFd>,
    robust_wakes: Vec<(DetTid, FutexID)>,
    exe: Option<ExecRecord>,
)
where G: Guest<Detcore<T>>, T: RecordOrReplay,
Expand description

Notifies the coordinator that guest is about to execve, recording the pre-exec address space mm and any file-descriptor blocking overrides. A backend that handles execve outside Detcore’s syscall handler must call this before the native syscall so the next image reconnects to the existing scheduler identity and logical clock.

robust_wakes are the owner-death wakes a successful exec makes Linux deliver, from Detcore::exec_robust_list_wakes, where the backend runs the native execve outside Detcore’s handler; the coordinator delivers them at the new image’s reconnect, or when the caller’s thread ends without one, and drops them at cancel_exec. A backend whose execve Detcore handles stages them in its own thread state instead and passes none.

exe is the image the exec runs, where the caller resolved it (crate::exec_record::ExecRecord::resolve); the new image’s /proc/<pid>/exe link answers from it.