pub fn open_position(contents: &str, dtid: u64, syscall: u64) -> Option<usize>Expand description
Where an open sits in a run’s log (contents): the position, as the
comparator counts records (detcore::logdiff::log_record_events), of the
record on which thread dtid finished its syscall number syscall, an
open. None when the log does not show that record exactly once: a log
without it says nothing, and a thread number and syscall count can repeat
(a thread that execs from a non-leader thread takes the leader’s number and
keeps its own count), so a repeated one is ambiguous; also None for a log
the comparator could not read either.
The open’s record is a syscall_result whose Hermit-written prefix reads
[syscall][detcore, dtid D] finish syscall #N: followed by openat(,
open( or creat(, the calls Detcore’s openat handler serves. The prefix
is read where it first occurs in the record, before any guest-chosen text
such as a path.