Documentation ¶
Index ¶
- func NewErrnoSystem(errno Errno) System
- func NewExitSystem(exitCode int) System
- func NewFallbackSystem(primary, secondary System) System
- func NewObserver(system System, before, after func(context.Context, Syscall)) System
- func NewRecorder(system System, write func(SyscallID, []byte)) System
- type ArgsGetSyscall
- type ArgsSizesGetSyscall
- type ClockResGetSyscall
- type ClockTimeGetSyscall
- type Codec
- func (c *Codec) DecodeArgsGet(buffer []byte, args []string) (_ []string, errno Errno, err error)
- func (c *Codec) DecodeArgsSizesGet(buffer []byte) (argCount, stringBytes int, errno Errno, err error)
- func (c *Codec) DecodeClockResGet(buffer []byte) (id ClockID, timestamp Timestamp, errno Errno, err error)
- func (c *Codec) DecodeClockTimeGet(buffer []byte) (id ClockID, precision Timestamp, timestamp Timestamp, errno Errno, err error)
- func (c *Codec) DecodeEnvironGet(buffer []byte, env []string) (_ []string, errno Errno, err error)
- func (c *Codec) DecodeEnvironSizesGet(buffer []byte) (envCount, stringBytes int, errno Errno, err error)
- func (c *Codec) DecodeFDAdvise(buffer []byte) (fd FD, offset FileSize, length FileSize, advice Advice, errno Errno, err error)
- func (c *Codec) DecodeFDAllocate(buffer []byte) (fd FD, offset FileSize, length FileSize, errno Errno, err error)
- func (c *Codec) DecodeFDClose(buffer []byte) (fd FD, errno Errno, err error)
- func (c *Codec) DecodeFDDataSync(buffer []byte) (fd FD, errno Errno, err error)
- func (c *Codec) DecodeFDFileStatGet(buffer []byte) (fd FD, stat FileStat, errno Errno, err error)
- func (c *Codec) DecodeFDFileStatSetSize(buffer []byte) (fd FD, size FileSize, errno Errno, err error)
- func (c *Codec) DecodeFDFileStatSetTimes(buffer []byte) (fd FD, accessTime, modifyTime Timestamp, flags FSTFlags, errno Errno, ...)
- func (c *Codec) DecodeFDPreStatDirName(buffer []byte) (fd FD, name string, errno Errno, err error)
- func (c *Codec) DecodeFDPreStatGet(buffer []byte) (fd FD, stat PreStat, errno Errno, err error)
- func (c *Codec) DecodeFDPread(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, offset FileSize, size Size, errno Errno, err error)
- func (c *Codec) DecodeFDPwrite(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, offset FileSize, size Size, errno Errno, err error)
- func (c *Codec) DecodeFDRead(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, size Size, errno Errno, err error)
- func (c *Codec) DecodeFDReadDir(buffer []byte, entries []DirEntry) (fd FD, _ []DirEntry, cookie DirCookie, bufferSizeBytes int, errno Errno, ...)
- func (c *Codec) DecodeFDRenumber(buffer []byte) (from, to FD, errno Errno, err error)
- func (c *Codec) DecodeFDSeek(buffer []byte) (fd FD, seekOffset FileDelta, whence Whence, offset FileSize, errno Errno, ...)
- func (c *Codec) DecodeFDStatGet(buffer []byte) (fd FD, stat FDStat, errno Errno, err error)
- func (c *Codec) DecodeFDStatSetFlags(buffer []byte) (fd FD, flags FDFlags, errno Errno, err error)
- func (c *Codec) DecodeFDStatSetRights(buffer []byte) (fd FD, rightsBase, rightsInheriting Rights, errno Errno, err error)
- func (c *Codec) DecodeFDSync(buffer []byte) (fd FD, errno Errno, err error)
- func (c *Codec) DecodeFDTell(buffer []byte) (fd FD, offset FileSize, errno Errno, err error)
- func (c *Codec) DecodeFDWrite(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, size Size, errno Errno, err error)
- func (c *Codec) DecodePathCreateDirectory(buffer []byte) (fd FD, path string, errno Errno, err error)
- func (c *Codec) DecodePathFileStatGet(buffer []byte) (fd FD, lookupFlags LookupFlags, path string, fileStat FileStat, errno Errno, ...)
- func (c *Codec) DecodePathFileStatSetTimes(buffer []byte) (fd FD, lookupFlags LookupFlags, path string, accessTime, modifyTime Timestamp, ...)
- func (c *Codec) DecodePathLink(buffer []byte) (oldFD FD, oldFlags LookupFlags, oldPath string, newFD FD, newPath string, ...)
- func (c *Codec) DecodePathOpen(buffer []byte) (fd FD, dirFlags LookupFlags, path string, openFlags OpenFlags, ...)
- func (c *Codec) DecodePathReadLink(buffer []byte) (fd FD, path string, output []byte, errno Errno, err error)
- func (c *Codec) DecodePathRemoveDirectory(buffer []byte) (fd FD, path string, errno Errno, err error)
- func (c *Codec) DecodePathRename(buffer []byte) (fd FD, oldPath string, newFD FD, newPath string, errno Errno, err error)
- func (c *Codec) DecodePathSymlink(buffer []byte) (oldPath string, fd FD, newPath string, errno Errno, err error)
- func (c *Codec) DecodePathUnlinkFile(buffer []byte) (fd FD, path string, errno Errno, err error)
- func (c *Codec) DecodePollOneOff(buffer []byte, subscriptions []Subscription, events []Event) (_ []Subscription, _ []Event, errno Errno, err error)
- func (c *Codec) DecodeProcExit(buffer []byte) (exitCode ExitCode, errno Errno, err error)
- func (c *Codec) DecodeProcRaise(buffer []byte) (signal Signal, errno Errno, err error)
- func (c *Codec) DecodeRandomGet(buffer []byte) (result []byte, errno Errno, err error)
- func (c *Codec) DecodeSchedYield(buffer []byte) (errno Errno, err error)
- func (c *Codec) DecodeSockAccept(buffer []byte) (fd FD, flags FDFlags, newfd FD, peer, addr SocketAddress, errno Errno, ...)
- func (c *Codec) DecodeSockAddressInfo(buffer []byte, results []AddressInfo) (name, service string, hint AddressInfo, _ []AddressInfo, errno Errno, ...)
- func (c *Codec) DecodeSockBind(buffer []byte) (fd FD, bind, addr SocketAddress, errno Errno, err error)
- func (c *Codec) DecodeSockConnect(buffer []byte) (fd FD, peer, addr SocketAddress, errno Errno, err error)
- func (c *Codec) DecodeSockGetOpt(buffer []byte) (fd FD, option SocketOption, value SocketOptionValue, errno Errno, err error)
- func (c *Codec) DecodeSockListen(buffer []byte) (fd FD, backlog int, errno Errno, err error)
- func (c *Codec) DecodeSockLocalAddress(buffer []byte) (fd FD, addr SocketAddress, errno Errno, err error)
- func (c *Codec) DecodeSockOpen(buffer []byte) (family ProtocolFamily, socketType SocketType, protocol Protocol, ...)
- func (c *Codec) DecodeSockRecv(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, iflags RIFlags, size Size, oflags ROFlags, errno Errno, ...)
- func (c *Codec) DecodeSockRecvFrom(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, iflags RIFlags, size Size, oflags ROFlags, ...)
- func (c *Codec) DecodeSockRemoteAddress(buffer []byte) (fd FD, addr SocketAddress, errno Errno, err error)
- func (c *Codec) DecodeSockSend(buffer []byte) (fd FD, iovecs []IOVec, flags SIFlags, size Size, errno Errno, err error)
- func (c *Codec) DecodeSockSendTo(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, iflags SIFlags, addr SocketAddress, size Size, errno Errno, ...)
- func (c *Codec) DecodeSockSetOpt(buffer []byte) (fd FD, option SocketOption, value SocketOptionValue, errno Errno, err error)
- func (c *Codec) DecodeSockShutdown(buffer []byte) (fd FD, flags SDFlags, errno Errno, err error)
- func (c *Codec) EncodeArgsGet(buffer []byte, args []string, errno Errno) []byte
- func (c *Codec) EncodeArgsSizesGet(buffer []byte, argCount, stringBytes int, errno Errno) []byte
- func (c *Codec) EncodeClockResGet(buffer []byte, id ClockID, timestamp Timestamp, errno Errno) []byte
- func (c *Codec) EncodeClockTimeGet(buffer []byte, id ClockID, precision Timestamp, timestamp Timestamp, ...) []byte
- func (c *Codec) EncodeEnvironGet(buffer []byte, env []string, errno Errno) []byte
- func (c *Codec) EncodeEnvironSizesGet(buffer []byte, envCount, stringBytes int, errno Errno) []byte
- func (c *Codec) EncodeFDAdvise(buffer []byte, fd FD, offset FileSize, length FileSize, advice Advice, ...) []byte
- func (c *Codec) EncodeFDAllocate(buffer []byte, fd FD, offset FileSize, length FileSize, errno Errno) []byte
- func (c *Codec) EncodeFDClose(buffer []byte, fd FD, errno Errno) []byte
- func (c *Codec) EncodeFDDataSync(buffer []byte, fd FD, errno Errno) []byte
- func (c *Codec) EncodeFDFileStatGet(buffer []byte, fd FD, stat FileStat, errno Errno) []byte
- func (c *Codec) EncodeFDFileStatSetSize(buffer []byte, fd FD, size FileSize, errno Errno) []byte
- func (c *Codec) EncodeFDFileStatSetTimes(buffer []byte, fd FD, accessTime, modifyTime Timestamp, flags FSTFlags, ...) []byte
- func (c *Codec) EncodeFDPreStatDirName(buffer []byte, fd FD, name string, errno Errno) []byte
- func (c *Codec) EncodeFDPreStatGet(buffer []byte, fd FD, stat PreStat, errno Errno) []byte
- func (c *Codec) EncodeFDPread(buffer []byte, fd FD, iovecs []IOVec, offset FileSize, size Size, errno Errno) []byte
- func (c *Codec) EncodeFDPwrite(buffer []byte, fd FD, iovecs []IOVec, offset FileSize, size Size, errno Errno) []byte
- func (c *Codec) EncodeFDRead(buffer []byte, fd FD, iovecs []IOVec, size Size, errno Errno) []byte
- func (c *Codec) EncodeFDReadDir(buffer []byte, fd FD, entries []DirEntry, cookie DirCookie, ...) []byte
- func (c *Codec) EncodeFDRenumber(buffer []byte, from, to FD, errno Errno) []byte
- func (c *Codec) EncodeFDSeek(buffer []byte, fd FD, seekOffset FileDelta, whence Whence, offset FileSize, ...) []byte
- func (c *Codec) EncodeFDStatGet(buffer []byte, fd FD, stat FDStat, errno Errno) []byte
- func (c *Codec) EncodeFDStatSetFlags(buffer []byte, fd FD, flags FDFlags, errno Errno) []byte
- func (c *Codec) EncodeFDStatSetRights(buffer []byte, fd FD, rightsBase, rightsInheriting Rights, errno Errno) []byte
- func (c *Codec) EncodeFDSync(buffer []byte, fd FD, errno Errno) []byte
- func (c *Codec) EncodeFDTell(buffer []byte, fd FD, offset FileSize, errno Errno) []byte
- func (c *Codec) EncodeFDWrite(buffer []byte, fd FD, iovecs []IOVec, size Size, errno Errno) []byte
- func (c *Codec) EncodePathCreateDirectory(buffer []byte, fd FD, path string, errno Errno) []byte
- func (c *Codec) EncodePathFileStatGet(buffer []byte, fd FD, lookupFlags LookupFlags, path string, fileStat FileStat, ...) []byte
- func (c *Codec) EncodePathFileStatSetTimes(buffer []byte, fd FD, lookupFlags LookupFlags, path string, ...) []byte
- func (c *Codec) EncodePathLink(buffer []byte, oldFD FD, oldFlags LookupFlags, oldPath string, newFD FD, ...) []byte
- func (c *Codec) EncodePathOpen(buffer []byte, fd FD, dirFlags LookupFlags, path string, openFlags OpenFlags, ...) []byte
- func (c *Codec) EncodePathReadLink(buffer []byte, fd FD, path string, output []byte, errno Errno) []byte
- func (c *Codec) EncodePathRemoveDirectory(buffer []byte, fd FD, path string, errno Errno) []byte
- func (c *Codec) EncodePathRename(buffer []byte, fd FD, oldPath string, newFD FD, newPath string, errno Errno) []byte
- func (c *Codec) EncodePathSymlink(buffer []byte, oldPath string, fd FD, newPath string, errno Errno) []byte
- func (c *Codec) EncodePathUnlinkFile(buffer []byte, fd FD, path string, errno Errno) []byte
- func (c *Codec) EncodePollOneOff(buffer []byte, subscriptions []Subscription, events []Event, errno Errno) []byte
- func (c *Codec) EncodeProcExit(buffer []byte, exitCode ExitCode, errno Errno) []byte
- func (c *Codec) EncodeProcRaise(buffer []byte, signal Signal, errno Errno) []byte
- func (c *Codec) EncodeRandomGet(buffer []byte, b []byte, errno Errno) []byte
- func (c *Codec) EncodeSchedYield(buffer []byte, errno Errno) []byte
- func (c *Codec) EncodeSockAccept(buffer []byte, fd FD, flags FDFlags, newfd FD, peer, addr SocketAddress, ...) []byte
- func (c *Codec) EncodeSockAddressInfo(buffer []byte, name, service string, hint AddressInfo, results []AddressInfo, ...) []byte
- func (c *Codec) EncodeSockBind(buffer []byte, fd FD, bind, addr SocketAddress, errno Errno) []byte
- func (c *Codec) EncodeSockConnect(buffer []byte, fd FD, peer, addr SocketAddress, errno Errno) []byte
- func (c *Codec) EncodeSockGetOpt(buffer []byte, fd FD, option SocketOption, value SocketOptionValue, ...) []byte
- func (c *Codec) EncodeSockListen(buffer []byte, fd FD, backlog int, errno Errno) []byte
- func (c *Codec) EncodeSockLocalAddress(buffer []byte, fd FD, addr SocketAddress, errno Errno) []byte
- func (c *Codec) EncodeSockOpen(buffer []byte, family ProtocolFamily, socketType SocketType, protocol Protocol, ...) []byte
- func (c *Codec) EncodeSockRecv(buffer []byte, fd FD, iovecs []IOVec, iflags RIFlags, size Size, ...) []byte
- func (c *Codec) EncodeSockRecvFrom(buffer []byte, fd FD, iovecs []IOVec, iflags RIFlags, size Size, ...) []byte
- func (c *Codec) EncodeSockRemoteAddress(buffer []byte, fd FD, addr SocketAddress, errno Errno) []byte
- func (c *Codec) EncodeSockSend(buffer []byte, fd FD, iovecs []IOVec, flags SIFlags, size Size, errno Errno) []byte
- func (c *Codec) EncodeSockSendTo(buffer []byte, fd FD, iovecs []IOVec, iflags SIFlags, addr SocketAddress, ...) []byte
- func (c *Codec) EncodeSockSetOpt(buffer []byte, fd FD, option SocketOption, value SocketOptionValue, ...) []byte
- func (c *Codec) EncodeSockShutdown(buffer []byte, fd FD, flags SDFlags, errno Errno) []byte
- type DecodeError
- type Decoder
- type EnvironGetSyscall
- type EnvironSizesGetSyscall
- type FDAdviseSyscall
- type FDAllocateSyscall
- type FDCloseSyscall
- type FDDataSyncSyscall
- type FDFileStatGetSyscall
- type FDFileStatSetSizeSyscall
- type FDFileStatSetTimesSyscall
- type FDPreStatDirNameSyscall
- type FDPreStatGetSyscall
- type FDPreadSyscall
- type FDPwriteSyscall
- type FDReadDirSyscall
- type FDReadSyscall
- type FDRenumberSyscall
- type FDSeekSyscall
- type FDStatGetSyscall
- type FDStatSetFlagsSyscall
- type FDStatSetRightsSyscall
- type FDSyncSyscall
- type FDTellSyscall
- type FDWriteSyscall
- type PathCreateDirectorySyscall
- type PathFileStatGetSyscall
- type PathFileStatSetTimesSyscall
- type PathLinkSyscall
- type PathOpenSyscall
- type PathReadLinkSyscall
- type PathRemoveDirectorySyscall
- type PathRenameSyscall
- type PathSymlinkSyscall
- type PathUnlinkFileSyscall
- type PollOneOffSyscall
- type ProcExitSyscall
- type ProcRaiseSyscall
- type RandomGetSyscall
- type ReadError
- type Reader
- type Replay
- func (r *Replay) ArgsGet(ctx context.Context) (args []string, errno Errno)
- func (r *Replay) ArgsSizesGet(ctx context.Context) (int, int, Errno)
- func (r *Replay) ClockResGet(ctx context.Context, id ClockID) (Timestamp, Errno)
- func (r *Replay) ClockTimeGet(ctx context.Context, id ClockID, precision Timestamp) (Timestamp, Errno)
- func (r *Replay) Close(ctx context.Context) error
- func (r *Replay) EnvironGet(ctx context.Context) (env []string, errno Errno)
- func (r *Replay) EnvironSizesGet(ctx context.Context) (int, int, Errno)
- func (r *Replay) FDAdvise(ctx context.Context, fd FD, offset FileSize, length FileSize, advice Advice) Errno
- func (r *Replay) FDAllocate(ctx context.Context, fd FD, offset FileSize, length FileSize) Errno
- func (r *Replay) FDClose(ctx context.Context, fd FD) Errno
- func (r *Replay) FDDataSync(ctx context.Context, fd FD) Errno
- func (r *Replay) FDFileStatGet(ctx context.Context, fd FD) (FileStat, Errno)
- func (r *Replay) FDFileStatSetSize(ctx context.Context, fd FD, size FileSize) Errno
- func (r *Replay) FDFileStatSetTimes(ctx context.Context, fd FD, accessTime, modifyTime Timestamp, flags FSTFlags) Errno
- func (r *Replay) FDPreStatDirName(ctx context.Context, fd FD) (string, Errno)
- func (r *Replay) FDPreStatGet(ctx context.Context, fd FD) (PreStat, Errno)
- func (r *Replay) FDPread(ctx context.Context, fd FD, iovecs []IOVec, offset FileSize) (Size, Errno)
- func (r *Replay) FDPwrite(ctx context.Context, fd FD, iovecs []IOVec, offset FileSize) (Size, Errno)
- func (r *Replay) FDRead(ctx context.Context, fd FD, iovecs []IOVec) (Size, Errno)
- func (r *Replay) FDReadDir(ctx context.Context, fd FD, entries []DirEntry, cookie DirCookie, ...) (int, Errno)
- func (r *Replay) FDRenumber(ctx context.Context, from, to FD) Errno
- func (r *Replay) FDSeek(ctx context.Context, fd FD, offset FileDelta, whence Whence) (FileSize, Errno)
- func (r *Replay) FDStatGet(ctx context.Context, fd FD) (FDStat, Errno)
- func (r *Replay) FDStatSetFlags(ctx context.Context, fd FD, flags FDFlags) Errno
- func (r *Replay) FDStatSetRights(ctx context.Context, fd FD, rightsBase, rightsInheriting Rights) Errno
- func (r *Replay) FDSync(ctx context.Context, fd FD) Errno
- func (r *Replay) FDTell(ctx context.Context, fd FD) (FileSize, Errno)
- func (r *Replay) FDWrite(ctx context.Context, fd FD, iovecs []IOVec) (Size, Errno)
- func (r *Replay) PathCreateDirectory(ctx context.Context, fd FD, path string) Errno
- func (r *Replay) PathFileStatGet(ctx context.Context, fd FD, lookupFlags LookupFlags, path string) (FileStat, Errno)
- func (r *Replay) PathFileStatSetTimes(ctx context.Context, fd FD, lookupFlags LookupFlags, path string, ...) Errno
- func (r *Replay) PathLink(ctx context.Context, oldFD FD, oldFlags LookupFlags, oldPath string, newFD FD, ...) Errno
- func (r *Replay) PathOpen(ctx context.Context, fd FD, dirFlags LookupFlags, path string, ...) (FD, Errno)
- func (r *Replay) PathReadLink(ctx context.Context, fd FD, path string, buffer []byte) (int, Errno)
- func (r *Replay) PathRemoveDirectory(ctx context.Context, fd FD, path string) Errno
- func (r *Replay) PathRename(ctx context.Context, fd FD, oldPath string, newFD FD, newPath string) Errno
- func (r *Replay) PathSymlink(ctx context.Context, oldPath string, fd FD, newPath string) Errno
- func (r *Replay) PathUnlinkFile(ctx context.Context, fd FD, path string) Errno
- func (r *Replay) PollOneOff(ctx context.Context, subscriptions []Subscription, events []Event) (int, Errno)
- func (r *Replay) ProcExit(ctx context.Context, exitCode ExitCode) Errno
- func (r *Replay) ProcRaise(ctx context.Context, signal Signal) Errno
- func (r *Replay) RandomGet(ctx context.Context, buffer []byte) Errno
- func (r *Replay) SchedYield(ctx context.Context) Errno
- func (r *Replay) SockAccept(ctx context.Context, fd FD, flags FDFlags) (FD, SocketAddress, SocketAddress, Errno)
- func (r *Replay) SockAddressInfo(ctx context.Context, name, service string, hints AddressInfo, ...) (int, Errno)
- func (r *Replay) SockBind(ctx context.Context, fd FD, bind SocketAddress) (SocketAddress, Errno)
- func (r *Replay) SockConnect(ctx context.Context, fd FD, peer SocketAddress) (SocketAddress, Errno)
- func (r *Replay) SockGetOpt(ctx context.Context, fd FD, option SocketOption) (SocketOptionValue, Errno)
- func (r *Replay) SockListen(ctx context.Context, fd FD, backlog int) Errno
- func (r *Replay) SockLocalAddress(ctx context.Context, fd FD) (SocketAddress, Errno)
- func (r *Replay) SockOpen(ctx context.Context, protocolFamily ProtocolFamily, socketType SocketType, ...) (FD, Errno)
- func (r *Replay) SockRecv(ctx context.Context, fd FD, iovecs []IOVec, iflags RIFlags) (Size, ROFlags, Errno)
- func (r *Replay) SockRecvFrom(ctx context.Context, fd FD, iovecs []IOVec, iflags RIFlags) (Size, ROFlags, SocketAddress, Errno)
- func (r *Replay) SockRemoteAddress(ctx context.Context, fd FD) (SocketAddress, Errno)
- func (r *Replay) SockSend(ctx context.Context, fd FD, iovecs []IOVec, iflags SIFlags) (Size, Errno)
- func (r *Replay) SockSendTo(ctx context.Context, fd FD, iovecs []IOVec, iflags SIFlags, addr SocketAddress) (Size, Errno)
- func (r *Replay) SockSetOpt(ctx context.Context, fd FD, option SocketOption, value SocketOptionValue) Errno
- func (r *Replay) SockShutdown(ctx context.Context, fd FD, flags SDFlags) Errno
- type SchedYieldSyscall
- type SockAcceptSyscall
- type SockAddressInfoSyscall
- type SockBindSyscall
- type SockConnectSyscall
- type SockGetOptSyscall
- type SockListenSyscall
- type SockLocalAddressSyscall
- type SockOpenSyscall
- type SockRecvFromSyscall
- type SockRecvSyscall
- type SockRemoteAddressSyscall
- type SockSendSyscall
- type SockSendToSyscall
- type SockSetOptSyscall
- type SockShutdownSyscall
- type Syscall
- type SyscallID
- type UnexpectedSyscallError
- type UnexpectedSyscallParamError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrnoSystem ¶
func NewErrnoSystem(errno Errno) System
NewErrnoSystem creates a wasi.System that returns an errno for all calls.
func NewExitSystem ¶
func NewExitSystem(exitCode int) System
NewExitSystem creates a wasi.System that exits all calls with the exit code.
func NewFallbackSystem ¶
func NewFallbackSystem(primary, secondary System) System
NewFallbackSystem creates a wasi.System that wraps two other wasi.System instances, a primary and a secondary. Calls are first forwarded to the primary system, and then forwarded to the secondary system when the primary returns wasi.ENOSYS.
func NewObserver ¶
NewObserver creates a wasi.System that notifies callbacks before and/or after a system call.
func NewRecorder ¶
NewRecorder creates a wasi.System that records system calls.
The provided write function must consume the write immediately as it's reused across function calls.
Types ¶
type ArgsGetSyscall ¶
type ArgsGetSyscall struct { Args []string Errno Errno }
func (*ArgsGetSyscall) Error ¶
func (s *ArgsGetSyscall) Error() Errno
func (*ArgsGetSyscall) ID ¶
func (s *ArgsGetSyscall) ID() SyscallID
func (*ArgsGetSyscall) Params ¶
func (s *ArgsGetSyscall) Params() []any
func (*ArgsGetSyscall) Results ¶
func (s *ArgsGetSyscall) Results() []any
type ArgsSizesGetSyscall ¶
func (*ArgsSizesGetSyscall) Error ¶
func (s *ArgsSizesGetSyscall) Error() Errno
func (*ArgsSizesGetSyscall) ID ¶
func (s *ArgsSizesGetSyscall) ID() SyscallID
func (*ArgsSizesGetSyscall) Params ¶
func (s *ArgsSizesGetSyscall) Params() []any
func (*ArgsSizesGetSyscall) Results ¶
func (s *ArgsSizesGetSyscall) Results() []any
type ClockResGetSyscall ¶
type ClockResGetSyscall struct { ClockID ClockID Timestamp Timestamp Errno Errno }
func (*ClockResGetSyscall) Error ¶
func (s *ClockResGetSyscall) Error() Errno
func (*ClockResGetSyscall) ID ¶
func (s *ClockResGetSyscall) ID() SyscallID
func (*ClockResGetSyscall) Params ¶
func (s *ClockResGetSyscall) Params() []any
func (*ClockResGetSyscall) Results ¶
func (s *ClockResGetSyscall) Results() []any
type ClockTimeGetSyscall ¶
type ClockTimeGetSyscall struct { ClockID ClockID Precision Timestamp Timestamp Timestamp Errno Errno }
func (*ClockTimeGetSyscall) Error ¶
func (s *ClockTimeGetSyscall) Error() Errno
func (*ClockTimeGetSyscall) ID ¶
func (s *ClockTimeGetSyscall) ID() SyscallID
func (*ClockTimeGetSyscall) Params ¶
func (s *ClockTimeGetSyscall) Params() []any
func (*ClockTimeGetSyscall) Results ¶
func (s *ClockTimeGetSyscall) Results() []any
type Codec ¶
type Codec struct{}
Codec is responsible for encoding and decoding system call inputs and outputs.
The system calls are sealed so there's no need for forwards or backwards compatibility. Rather than use protobuf or flatbuffers or similar, we use simple bespoke encoders. We aren't too concerned with succinctness since the records are ultimately compressed.
Other things that have been tried:
- varints (bb159c7, discussed in stealthrocket/timecraft#11)
- omitting return values except for errno when errno!=ESUCCESS (532bfbb, discussed in stealthrocket/timecraft#11)
func (*Codec) DecodeArgsGet ¶
func (*Codec) DecodeArgsSizesGet ¶
func (*Codec) DecodeClockResGet ¶
func (*Codec) DecodeClockTimeGet ¶
func (*Codec) DecodeEnvironGet ¶
func (*Codec) DecodeEnvironSizesGet ¶
func (*Codec) DecodeFDAdvise ¶
func (*Codec) DecodeFDAllocate ¶
func (*Codec) DecodeFDClose ¶
func (*Codec) DecodeFDDataSync ¶
func (*Codec) DecodeFDFileStatGet ¶
func (*Codec) DecodeFDFileStatSetSize ¶
func (*Codec) DecodeFDFileStatSetTimes ¶
func (*Codec) DecodeFDPreStatDirName ¶
func (*Codec) DecodeFDPreStatGet ¶
func (*Codec) DecodeFDPread ¶
func (*Codec) DecodeFDPwrite ¶
func (*Codec) DecodeFDRead ¶
func (*Codec) DecodeFDReadDir ¶
func (*Codec) DecodeFDRenumber ¶
func (*Codec) DecodeFDSeek ¶
func (*Codec) DecodeFDStatGet ¶
func (*Codec) DecodeFDStatSetFlags ¶
func (*Codec) DecodeFDStatSetRights ¶
func (*Codec) DecodeFDSync ¶
func (*Codec) DecodeFDTell ¶
func (*Codec) DecodeFDWrite ¶
func (*Codec) DecodePathCreateDirectory ¶
func (*Codec) DecodePathFileStatGet ¶
func (*Codec) DecodePathFileStatSetTimes ¶
func (*Codec) DecodePathLink ¶
func (*Codec) DecodePathOpen ¶
func (*Codec) DecodePathReadLink ¶
func (*Codec) DecodePathRemoveDirectory ¶
func (*Codec) DecodePathRename ¶
func (*Codec) DecodePathSymlink ¶
func (*Codec) DecodePathUnlinkFile ¶
func (*Codec) DecodePollOneOff ¶
func (*Codec) DecodeProcExit ¶
func (*Codec) DecodeProcRaise ¶
func (*Codec) DecodeRandomGet ¶
func (*Codec) DecodeSchedYield ¶
func (*Codec) DecodeSockAccept ¶
func (*Codec) DecodeSockAddressInfo ¶
func (*Codec) DecodeSockBind ¶
func (*Codec) DecodeSockConnect ¶
func (*Codec) DecodeSockGetOpt ¶
func (*Codec) DecodeSockListen ¶
func (*Codec) DecodeSockLocalAddress ¶
func (*Codec) DecodeSockOpen ¶
func (*Codec) DecodeSockRecv ¶
func (*Codec) DecodeSockRecvFrom ¶
func (*Codec) DecodeSockRemoteAddress ¶
func (*Codec) DecodeSockSend ¶
func (*Codec) DecodeSockSendTo ¶
func (*Codec) DecodeSockSetOpt ¶
func (*Codec) DecodeSockShutdown ¶
func (*Codec) EncodeArgsGet ¶
func (*Codec) EncodeArgsSizesGet ¶
func (*Codec) EncodeClockResGet ¶
func (*Codec) EncodeClockTimeGet ¶
func (*Codec) EncodeEnvironGet ¶
func (*Codec) EncodeEnvironSizesGet ¶
func (*Codec) EncodeFDAdvise ¶
func (*Codec) EncodeFDAllocate ¶
func (*Codec) EncodeFDClose ¶
func (*Codec) EncodeFDDataSync ¶
func (*Codec) EncodeFDFileStatGet ¶
func (*Codec) EncodeFDFileStatSetSize ¶
func (*Codec) EncodeFDFileStatSetTimes ¶
func (*Codec) EncodeFDPreStatDirName ¶
func (*Codec) EncodeFDPreStatGet ¶
func (*Codec) EncodeFDPread ¶
func (*Codec) EncodeFDPwrite ¶
func (*Codec) EncodeFDRead ¶
func (*Codec) EncodeFDReadDir ¶
func (*Codec) EncodeFDRenumber ¶
func (*Codec) EncodeFDSeek ¶
func (*Codec) EncodeFDStatGet ¶
func (*Codec) EncodeFDStatSetFlags ¶
func (*Codec) EncodeFDStatSetRights ¶
func (*Codec) EncodeFDSync ¶
func (*Codec) EncodeFDTell ¶
func (*Codec) EncodeFDWrite ¶
func (*Codec) EncodePathCreateDirectory ¶
func (*Codec) EncodePathFileStatGet ¶
func (*Codec) EncodePathFileStatSetTimes ¶
func (*Codec) EncodePathLink ¶
func (*Codec) EncodePathOpen ¶
func (*Codec) EncodePathReadLink ¶
func (*Codec) EncodePathRemoveDirectory ¶
func (*Codec) EncodePathRename ¶
func (*Codec) EncodePathSymlink ¶
func (*Codec) EncodePathUnlinkFile ¶
func (*Codec) EncodePollOneOff ¶
func (*Codec) EncodeProcExit ¶
func (*Codec) EncodeProcRaise ¶
func (*Codec) EncodeRandomGet ¶
func (*Codec) EncodeSchedYield ¶
func (*Codec) EncodeSockAccept ¶
func (*Codec) EncodeSockAddressInfo ¶
func (*Codec) EncodeSockBind ¶
func (*Codec) EncodeSockConnect ¶
func (*Codec) EncodeSockGetOpt ¶
func (*Codec) EncodeSockListen ¶
func (*Codec) EncodeSockLocalAddress ¶
func (*Codec) EncodeSockOpen ¶
func (*Codec) EncodeSockRecv ¶
func (*Codec) EncodeSockRecvFrom ¶
func (*Codec) EncodeSockRemoteAddress ¶
func (*Codec) EncodeSockSend ¶
func (*Codec) EncodeSockSendTo ¶
func (*Codec) EncodeSockSetOpt ¶
func (*Codec) EncodeSockShutdown ¶
type DecodeError ¶
type DecodeError struct { Record timemachine.Record // contains filtered or unexported fields }
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes syscalls from records.
type EnvironGetSyscall ¶
type EnvironGetSyscall struct { Env []string Errno Errno }
func (*EnvironGetSyscall) Error ¶
func (s *EnvironGetSyscall) Error() Errno
func (*EnvironGetSyscall) ID ¶
func (s *EnvironGetSyscall) ID() SyscallID
func (*EnvironGetSyscall) Params ¶
func (s *EnvironGetSyscall) Params() []any
func (*EnvironGetSyscall) Results ¶
func (s *EnvironGetSyscall) Results() []any
type EnvironSizesGetSyscall ¶
func (*EnvironSizesGetSyscall) Error ¶
func (s *EnvironSizesGetSyscall) Error() Errno
func (*EnvironSizesGetSyscall) ID ¶
func (s *EnvironSizesGetSyscall) ID() SyscallID
func (*EnvironSizesGetSyscall) Params ¶
func (s *EnvironSizesGetSyscall) Params() []any
func (*EnvironSizesGetSyscall) Results ¶
func (s *EnvironSizesGetSyscall) Results() []any
type FDAdviseSyscall ¶
type FDAdviseSyscall struct { FD FD Offset FileSize Length FileSize Advice Advice Errno Errno }
func (*FDAdviseSyscall) Error ¶
func (s *FDAdviseSyscall) Error() Errno
func (*FDAdviseSyscall) ID ¶
func (s *FDAdviseSyscall) ID() SyscallID
func (*FDAdviseSyscall) Params ¶
func (s *FDAdviseSyscall) Params() []any
func (*FDAdviseSyscall) Results ¶
func (s *FDAdviseSyscall) Results() []any
type FDAllocateSyscall ¶
type FDAllocateSyscall struct { FD FD Offset FileSize Length FileSize Errno Errno }
func (*FDAllocateSyscall) Error ¶
func (s *FDAllocateSyscall) Error() Errno
func (*FDAllocateSyscall) ID ¶
func (s *FDAllocateSyscall) ID() SyscallID
func (*FDAllocateSyscall) Params ¶
func (s *FDAllocateSyscall) Params() []any
func (*FDAllocateSyscall) Results ¶
func (s *FDAllocateSyscall) Results() []any
type FDCloseSyscall ¶
type FDCloseSyscall struct { FD FD Errno Errno }
func (*FDCloseSyscall) Error ¶
func (s *FDCloseSyscall) Error() Errno
func (*FDCloseSyscall) ID ¶
func (s *FDCloseSyscall) ID() SyscallID
func (*FDCloseSyscall) Params ¶
func (s *FDCloseSyscall) Params() []any
func (*FDCloseSyscall) Results ¶
func (s *FDCloseSyscall) Results() []any
type FDDataSyncSyscall ¶
type FDDataSyncSyscall struct { FD FD Errno Errno }
func (*FDDataSyncSyscall) Error ¶
func (s *FDDataSyncSyscall) Error() Errno
func (*FDDataSyncSyscall) ID ¶
func (s *FDDataSyncSyscall) ID() SyscallID
func (*FDDataSyncSyscall) Params ¶
func (s *FDDataSyncSyscall) Params() []any
func (*FDDataSyncSyscall) Results ¶
func (s *FDDataSyncSyscall) Results() []any
type FDFileStatGetSyscall ¶
type FDFileStatGetSyscall struct { FD FD Stat FileStat Errno Errno }
func (*FDFileStatGetSyscall) Error ¶
func (s *FDFileStatGetSyscall) Error() Errno
func (*FDFileStatGetSyscall) ID ¶
func (s *FDFileStatGetSyscall) ID() SyscallID
func (*FDFileStatGetSyscall) Params ¶
func (s *FDFileStatGetSyscall) Params() []any
func (*FDFileStatGetSyscall) Results ¶
func (s *FDFileStatGetSyscall) Results() []any
type FDFileStatSetSizeSyscall ¶
type FDFileStatSetSizeSyscall struct { FD FD Size FileSize Errno Errno }
func (*FDFileStatSetSizeSyscall) Error ¶
func (s *FDFileStatSetSizeSyscall) Error() Errno
func (*FDFileStatSetSizeSyscall) ID ¶
func (s *FDFileStatSetSizeSyscall) ID() SyscallID
func (*FDFileStatSetSizeSyscall) Params ¶
func (s *FDFileStatSetSizeSyscall) Params() []any
func (*FDFileStatSetSizeSyscall) Results ¶
func (s *FDFileStatSetSizeSyscall) Results() []any
type FDFileStatSetTimesSyscall ¶
type FDFileStatSetTimesSyscall struct { FD FD AccessTime Timestamp ModifyTime Timestamp Flags FSTFlags Errno Errno }
func (*FDFileStatSetTimesSyscall) Error ¶
func (s *FDFileStatSetTimesSyscall) Error() Errno
func (*FDFileStatSetTimesSyscall) ID ¶
func (s *FDFileStatSetTimesSyscall) ID() SyscallID
func (*FDFileStatSetTimesSyscall) Params ¶
func (s *FDFileStatSetTimesSyscall) Params() []any
func (*FDFileStatSetTimesSyscall) Results ¶
func (s *FDFileStatSetTimesSyscall) Results() []any
type FDPreStatDirNameSyscall ¶
type FDPreStatDirNameSyscall struct { FD FD Name string Errno Errno }
func (*FDPreStatDirNameSyscall) Error ¶
func (s *FDPreStatDirNameSyscall) Error() Errno
func (*FDPreStatDirNameSyscall) ID ¶
func (s *FDPreStatDirNameSyscall) ID() SyscallID
func (*FDPreStatDirNameSyscall) Params ¶
func (s *FDPreStatDirNameSyscall) Params() []any
func (*FDPreStatDirNameSyscall) Results ¶
func (s *FDPreStatDirNameSyscall) Results() []any
type FDPreStatGetSyscall ¶
type FDPreStatGetSyscall struct { FD FD Stat PreStat Errno Errno }
func (*FDPreStatGetSyscall) Error ¶
func (s *FDPreStatGetSyscall) Error() Errno
func (*FDPreStatGetSyscall) ID ¶
func (s *FDPreStatGetSyscall) ID() SyscallID
func (*FDPreStatGetSyscall) Params ¶
func (s *FDPreStatGetSyscall) Params() []any
func (*FDPreStatGetSyscall) Results ¶
func (s *FDPreStatGetSyscall) Results() []any
type FDPreadSyscall ¶
type FDPreadSyscall struct { FD FD IOVecs []IOVec Offset FileSize Size Size Errno Errno }
func (*FDPreadSyscall) Error ¶
func (s *FDPreadSyscall) Error() Errno
func (*FDPreadSyscall) ID ¶
func (s *FDPreadSyscall) ID() SyscallID
func (*FDPreadSyscall) Params ¶
func (s *FDPreadSyscall) Params() []any
func (*FDPreadSyscall) Results ¶
func (s *FDPreadSyscall) Results() []any
type FDPwriteSyscall ¶
type FDPwriteSyscall struct { FD FD IOVecs []IOVec Offset FileSize Size Size Errno Errno }
func (*FDPwriteSyscall) Error ¶
func (s *FDPwriteSyscall) Error() Errno
func (*FDPwriteSyscall) ID ¶
func (s *FDPwriteSyscall) ID() SyscallID
func (*FDPwriteSyscall) Params ¶
func (s *FDPwriteSyscall) Params() []any
func (*FDPwriteSyscall) Results ¶
func (s *FDPwriteSyscall) Results() []any
type FDReadDirSyscall ¶
type FDReadDirSyscall struct { FD FD Entries []DirEntry Cookie DirCookie BufferSizeBytes int Errno Errno }
func (*FDReadDirSyscall) Error ¶
func (s *FDReadDirSyscall) Error() Errno
func (*FDReadDirSyscall) ID ¶
func (s *FDReadDirSyscall) ID() SyscallID
func (*FDReadDirSyscall) Params ¶
func (s *FDReadDirSyscall) Params() []any
func (*FDReadDirSyscall) Results ¶
func (s *FDReadDirSyscall) Results() []any
type FDReadSyscall ¶
type FDReadSyscall struct { FD FD IOVecs []IOVec Size Size Errno Errno }
func (*FDReadSyscall) Error ¶
func (s *FDReadSyscall) Error() Errno
func (*FDReadSyscall) ID ¶
func (s *FDReadSyscall) ID() SyscallID
func (*FDReadSyscall) Params ¶
func (s *FDReadSyscall) Params() []any
func (*FDReadSyscall) Results ¶
func (s *FDReadSyscall) Results() []any
type FDRenumberSyscall ¶
type FDRenumberSyscall struct { From FD To FD Errno Errno }
func (*FDRenumberSyscall) Error ¶
func (s *FDRenumberSyscall) Error() Errno
func (*FDRenumberSyscall) ID ¶
func (s *FDRenumberSyscall) ID() SyscallID
func (*FDRenumberSyscall) Params ¶
func (s *FDRenumberSyscall) Params() []any
func (*FDRenumberSyscall) Results ¶
func (s *FDRenumberSyscall) Results() []any
type FDSeekSyscall ¶
type FDSeekSyscall struct { FD FD Offset FileDelta Whence Whence Size FileSize Errno Errno }
func (*FDSeekSyscall) Error ¶
func (s *FDSeekSyscall) Error() Errno
func (*FDSeekSyscall) ID ¶
func (s *FDSeekSyscall) ID() SyscallID
func (*FDSeekSyscall) Params ¶
func (s *FDSeekSyscall) Params() []any
func (*FDSeekSyscall) Results ¶
func (s *FDSeekSyscall) Results() []any
type FDStatGetSyscall ¶
type FDStatGetSyscall struct { FD FD Stat FDStat Errno Errno }
func (*FDStatGetSyscall) Error ¶
func (s *FDStatGetSyscall) Error() Errno
func (*FDStatGetSyscall) ID ¶
func (s *FDStatGetSyscall) ID() SyscallID
func (*FDStatGetSyscall) Params ¶
func (s *FDStatGetSyscall) Params() []any
func (*FDStatGetSyscall) Results ¶
func (s *FDStatGetSyscall) Results() []any
type FDStatSetFlagsSyscall ¶
type FDStatSetFlagsSyscall struct { FD FD Flags FDFlags Errno Errno }
func (*FDStatSetFlagsSyscall) Error ¶
func (s *FDStatSetFlagsSyscall) Error() Errno
func (*FDStatSetFlagsSyscall) ID ¶
func (s *FDStatSetFlagsSyscall) ID() SyscallID
func (*FDStatSetFlagsSyscall) Params ¶
func (s *FDStatSetFlagsSyscall) Params() []any
func (*FDStatSetFlagsSyscall) Results ¶
func (s *FDStatSetFlagsSyscall) Results() []any
type FDStatSetRightsSyscall ¶
type FDStatSetRightsSyscall struct { FD FD RightsBase Rights RightsInheriting Rights Errno Errno }
func (*FDStatSetRightsSyscall) Error ¶
func (s *FDStatSetRightsSyscall) Error() Errno
func (*FDStatSetRightsSyscall) ID ¶
func (s *FDStatSetRightsSyscall) ID() SyscallID
func (*FDStatSetRightsSyscall) Params ¶
func (s *FDStatSetRightsSyscall) Params() []any
func (*FDStatSetRightsSyscall) Results ¶
func (s *FDStatSetRightsSyscall) Results() []any
type FDSyncSyscall ¶
type FDSyncSyscall struct { FD FD Errno Errno }
func (*FDSyncSyscall) Error ¶
func (s *FDSyncSyscall) Error() Errno
func (*FDSyncSyscall) ID ¶
func (s *FDSyncSyscall) ID() SyscallID
func (*FDSyncSyscall) Params ¶
func (s *FDSyncSyscall) Params() []any
func (*FDSyncSyscall) Results ¶
func (s *FDSyncSyscall) Results() []any
type FDTellSyscall ¶
type FDTellSyscall struct { FD FD Size FileSize Errno Errno }
func (*FDTellSyscall) Error ¶
func (s *FDTellSyscall) Error() Errno
func (*FDTellSyscall) ID ¶
func (s *FDTellSyscall) ID() SyscallID
func (*FDTellSyscall) Params ¶
func (s *FDTellSyscall) Params() []any
func (*FDTellSyscall) Results ¶
func (s *FDTellSyscall) Results() []any
type FDWriteSyscall ¶
type FDWriteSyscall struct { FD FD IOVecs []IOVec Size Size Errno Errno }
func (*FDWriteSyscall) Error ¶
func (s *FDWriteSyscall) Error() Errno
func (*FDWriteSyscall) ID ¶
func (s *FDWriteSyscall) ID() SyscallID
func (*FDWriteSyscall) Params ¶
func (s *FDWriteSyscall) Params() []any
func (*FDWriteSyscall) Results ¶
func (s *FDWriteSyscall) Results() []any
type PathCreateDirectorySyscall ¶
type PathCreateDirectorySyscall struct { FD FD Path string Errno Errno }
func (*PathCreateDirectorySyscall) Error ¶
func (s *PathCreateDirectorySyscall) Error() Errno
func (*PathCreateDirectorySyscall) ID ¶
func (s *PathCreateDirectorySyscall) ID() SyscallID
func (*PathCreateDirectorySyscall) Params ¶
func (s *PathCreateDirectorySyscall) Params() []any
func (*PathCreateDirectorySyscall) Results ¶
func (s *PathCreateDirectorySyscall) Results() []any
type PathFileStatGetSyscall ¶
type PathFileStatGetSyscall struct { FD FD LookupFlags LookupFlags Path string Stat FileStat Errno Errno }
func (*PathFileStatGetSyscall) Error ¶
func (s *PathFileStatGetSyscall) Error() Errno
func (*PathFileStatGetSyscall) ID ¶
func (s *PathFileStatGetSyscall) ID() SyscallID
func (*PathFileStatGetSyscall) Params ¶
func (s *PathFileStatGetSyscall) Params() []any
func (*PathFileStatGetSyscall) Results ¶
func (s *PathFileStatGetSyscall) Results() []any
type PathFileStatSetTimesSyscall ¶
type PathFileStatSetTimesSyscall struct { FD FD LookupFlags LookupFlags Path string AccessTime Timestamp ModifyTime Timestamp Flags FSTFlags Errno Errno }
func (*PathFileStatSetTimesSyscall) Error ¶
func (s *PathFileStatSetTimesSyscall) Error() Errno
func (*PathFileStatSetTimesSyscall) ID ¶
func (s *PathFileStatSetTimesSyscall) ID() SyscallID
func (*PathFileStatSetTimesSyscall) Params ¶
func (s *PathFileStatSetTimesSyscall) Params() []any
func (*PathFileStatSetTimesSyscall) Results ¶
func (s *PathFileStatSetTimesSyscall) Results() []any
type PathLinkSyscall ¶
type PathLinkSyscall struct { OldFD FD OldFlags LookupFlags OldPath string NewFD FD NewPath string Errno Errno }
func (*PathLinkSyscall) Error ¶
func (s *PathLinkSyscall) Error() Errno
func (*PathLinkSyscall) ID ¶
func (s *PathLinkSyscall) ID() SyscallID
func (*PathLinkSyscall) Params ¶
func (s *PathLinkSyscall) Params() []any
func (*PathLinkSyscall) Results ¶
func (s *PathLinkSyscall) Results() []any
type PathOpenSyscall ¶
type PathOpenSyscall struct { FD FD DirFlags LookupFlags Path string OpenFlags OpenFlags RightsBase Rights RightsInheriting Rights FDFlags FDFlags NewFD FD Errno Errno }
func (*PathOpenSyscall) Error ¶
func (s *PathOpenSyscall) Error() Errno
func (*PathOpenSyscall) ID ¶
func (s *PathOpenSyscall) ID() SyscallID
func (*PathOpenSyscall) Params ¶
func (s *PathOpenSyscall) Params() []any
func (*PathOpenSyscall) Results ¶
func (s *PathOpenSyscall) Results() []any
type PathReadLinkSyscall ¶
func (*PathReadLinkSyscall) Error ¶
func (s *PathReadLinkSyscall) Error() Errno
func (*PathReadLinkSyscall) ID ¶
func (s *PathReadLinkSyscall) ID() SyscallID
func (*PathReadLinkSyscall) Params ¶
func (s *PathReadLinkSyscall) Params() []any
func (*PathReadLinkSyscall) Results ¶
func (s *PathReadLinkSyscall) Results() []any
type PathRemoveDirectorySyscall ¶
type PathRemoveDirectorySyscall struct { FD FD Path string Errno Errno }
func (*PathRemoveDirectorySyscall) Error ¶
func (s *PathRemoveDirectorySyscall) Error() Errno
func (*PathRemoveDirectorySyscall) ID ¶
func (s *PathRemoveDirectorySyscall) ID() SyscallID
func (*PathRemoveDirectorySyscall) Params ¶
func (s *PathRemoveDirectorySyscall) Params() []any
func (*PathRemoveDirectorySyscall) Results ¶
func (s *PathRemoveDirectorySyscall) Results() []any
type PathRenameSyscall ¶
func (*PathRenameSyscall) Error ¶
func (s *PathRenameSyscall) Error() Errno
func (*PathRenameSyscall) ID ¶
func (s *PathRenameSyscall) ID() SyscallID
func (*PathRenameSyscall) Params ¶
func (s *PathRenameSyscall) Params() []any
func (*PathRenameSyscall) Results ¶
func (s *PathRenameSyscall) Results() []any
type PathSymlinkSyscall ¶
func (*PathSymlinkSyscall) Error ¶
func (s *PathSymlinkSyscall) Error() Errno
func (*PathSymlinkSyscall) ID ¶
func (s *PathSymlinkSyscall) ID() SyscallID
func (*PathSymlinkSyscall) Params ¶
func (s *PathSymlinkSyscall) Params() []any
func (*PathSymlinkSyscall) Results ¶
func (s *PathSymlinkSyscall) Results() []any
type PathUnlinkFileSyscall ¶
type PathUnlinkFileSyscall struct { FD FD Path string Errno Errno }
func (*PathUnlinkFileSyscall) Error ¶
func (s *PathUnlinkFileSyscall) Error() Errno
func (*PathUnlinkFileSyscall) ID ¶
func (s *PathUnlinkFileSyscall) ID() SyscallID
func (*PathUnlinkFileSyscall) Params ¶
func (s *PathUnlinkFileSyscall) Params() []any
func (*PathUnlinkFileSyscall) Results ¶
func (s *PathUnlinkFileSyscall) Results() []any
type PollOneOffSyscall ¶
type PollOneOffSyscall struct { Subscriptions []Subscription Events []Event Errno Errno }
func (*PollOneOffSyscall) Error ¶
func (s *PollOneOffSyscall) Error() Errno
func (*PollOneOffSyscall) ID ¶
func (s *PollOneOffSyscall) ID() SyscallID
func (*PollOneOffSyscall) Params ¶
func (s *PollOneOffSyscall) Params() []any
func (*PollOneOffSyscall) Results ¶
func (s *PollOneOffSyscall) Results() []any
type ProcExitSyscall ¶
type ProcExitSyscall struct { ExitCode ExitCode Errno Errno }
func (*ProcExitSyscall) Error ¶
func (s *ProcExitSyscall) Error() Errno
func (*ProcExitSyscall) ID ¶
func (s *ProcExitSyscall) ID() SyscallID
func (*ProcExitSyscall) Params ¶
func (s *ProcExitSyscall) Params() []any
func (*ProcExitSyscall) Results ¶
func (s *ProcExitSyscall) Results() []any
type ProcRaiseSyscall ¶
type ProcRaiseSyscall struct { Signal Signal Errno Errno }
func (*ProcRaiseSyscall) Error ¶
func (s *ProcRaiseSyscall) Error() Errno
func (*ProcRaiseSyscall) ID ¶
func (s *ProcRaiseSyscall) ID() SyscallID
func (*ProcRaiseSyscall) Params ¶
func (s *ProcRaiseSyscall) Params() []any
func (*ProcRaiseSyscall) Results ¶
func (s *ProcRaiseSyscall) Results() []any
type RandomGetSyscall ¶
type RandomGetSyscall struct { B []byte Errno Errno }
func (*RandomGetSyscall) Error ¶
func (s *RandomGetSyscall) Error() Errno
func (*RandomGetSyscall) ID ¶
func (s *RandomGetSyscall) ID() SyscallID
func (*RandomGetSyscall) Params ¶
func (s *RandomGetSyscall) Params() []any
func (*RandomGetSyscall) Results ¶
func (s *RandomGetSyscall) Results() []any
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
type Replay ¶
Replay implements wasi.System by replaying system calls recorded in a log.
During replay, records are pulled from the log and then used to answer system calls. No actual system calls are ever made. The WebAssembly module should thus be identical to the one used to create the log records.
When the replay is complete, the implementation will return ENOSYS for subsequent system calls, and the EOF method will return true.
When an error occurs, the replay will panic and the execution of the WebAssembly module will be halted. The following errors may occur:
- ReadError: there was an error reading from the log
- DecodeError: there was an error decoding a write from the log
- UnexpectedSyscallError: a system call was made that did not match the next write in the log
- UnexpectedSyscallParamError: a system call was made with input that did not match the next write in the log
The error may also be a compound error, indicating that multiple errors were encountered. In this case, the error will implement interface{ Unwrap() []error }.
func NewReplay ¶
func NewReplay(records stream.Reader[timemachine.Record]) *Replay
NewReplay creates a Replay.
func (*Replay) ClockResGet ¶
func (*Replay) ClockTimeGet ¶
func (*Replay) EnvironGet ¶
func (*Replay) EnvironSizesGet ¶
func (*Replay) FDAllocate ¶
func (*Replay) FDDataSync ¶
func (*Replay) FDFileStatGet ¶
func (*Replay) FDFileStatSetSize ¶
func (*Replay) FDFileStatSetTimes ¶
func (*Replay) FDPreStatDirName ¶
func (*Replay) FDPreStatGet ¶
func (*Replay) FDRenumber ¶
func (*Replay) FDStatSetFlags ¶
func (*Replay) FDStatSetRights ¶
func (*Replay) PathCreateDirectory ¶
func (*Replay) PathFileStatGet ¶
func (*Replay) PathFileStatSetTimes ¶
func (*Replay) PathReadLink ¶
func (*Replay) PathRemoveDirectory ¶
func (*Replay) PathRename ¶
func (*Replay) PathSymlink ¶
func (*Replay) PathUnlinkFile ¶
func (*Replay) PollOneOff ¶
func (*Replay) SchedYield ¶
func (*Replay) SockAccept ¶
func (*Replay) SockAddressInfo ¶
func (*Replay) SockConnect ¶
func (*Replay) SockGetOpt ¶
func (*Replay) SockListen ¶
func (*Replay) SockLocalAddress ¶
func (*Replay) SockRecvFrom ¶
func (*Replay) SockRemoteAddress ¶
func (*Replay) SockSendTo ¶
func (*Replay) SockSetOpt ¶
func (*Replay) SockShutdown ¶
type SchedYieldSyscall ¶
type SchedYieldSyscall struct {
Errno Errno
}
func (*SchedYieldSyscall) Error ¶
func (s *SchedYieldSyscall) Error() Errno
func (*SchedYieldSyscall) ID ¶
func (s *SchedYieldSyscall) ID() SyscallID
func (*SchedYieldSyscall) Params ¶
func (s *SchedYieldSyscall) Params() []any
func (*SchedYieldSyscall) Results ¶
func (s *SchedYieldSyscall) Results() []any
type SockAcceptSyscall ¶
type SockAcceptSyscall struct { FD FD Flags FDFlags NewFD FD Peer SocketAddress Addr SocketAddress Errno Errno }
func (*SockAcceptSyscall) Error ¶
func (s *SockAcceptSyscall) Error() Errno
func (*SockAcceptSyscall) ID ¶
func (s *SockAcceptSyscall) ID() SyscallID
func (*SockAcceptSyscall) Params ¶
func (s *SockAcceptSyscall) Params() []any
func (*SockAcceptSyscall) Results ¶
func (s *SockAcceptSyscall) Results() []any
type SockAddressInfoSyscall ¶
type SockAddressInfoSyscall struct { Name string Service string Hints AddressInfo Res []AddressInfo Errno Errno }
func (*SockAddressInfoSyscall) Error ¶
func (s *SockAddressInfoSyscall) Error() Errno
func (*SockAddressInfoSyscall) ID ¶
func (s *SockAddressInfoSyscall) ID() SyscallID
func (*SockAddressInfoSyscall) Params ¶
func (s *SockAddressInfoSyscall) Params() []any
func (*SockAddressInfoSyscall) Results ¶
func (s *SockAddressInfoSyscall) Results() []any
type SockBindSyscall ¶
type SockBindSyscall struct { FD FD Bind SocketAddress Addr SocketAddress Errno Errno }
func (*SockBindSyscall) Error ¶
func (s *SockBindSyscall) Error() Errno
func (*SockBindSyscall) ID ¶
func (s *SockBindSyscall) ID() SyscallID
func (*SockBindSyscall) Params ¶
func (s *SockBindSyscall) Params() []any
func (*SockBindSyscall) Results ¶
func (s *SockBindSyscall) Results() []any
type SockConnectSyscall ¶
type SockConnectSyscall struct { FD FD Peer SocketAddress Addr SocketAddress Errno Errno }
func (*SockConnectSyscall) Error ¶
func (s *SockConnectSyscall) Error() Errno
func (*SockConnectSyscall) ID ¶
func (s *SockConnectSyscall) ID() SyscallID
func (*SockConnectSyscall) Params ¶
func (s *SockConnectSyscall) Params() []any
func (*SockConnectSyscall) Results ¶
func (s *SockConnectSyscall) Results() []any
type SockGetOptSyscall ¶
type SockGetOptSyscall struct { FD FD Option SocketOption Value SocketOptionValue Errno Errno }
func (*SockGetOptSyscall) Error ¶
func (s *SockGetOptSyscall) Error() Errno
func (*SockGetOptSyscall) ID ¶
func (s *SockGetOptSyscall) ID() SyscallID
func (*SockGetOptSyscall) Params ¶
func (s *SockGetOptSyscall) Params() []any
func (*SockGetOptSyscall) Results ¶
func (s *SockGetOptSyscall) Results() []any
type SockListenSyscall ¶
type SockListenSyscall struct { FD FD Backlog int Errno Errno }
func (*SockListenSyscall) Error ¶
func (s *SockListenSyscall) Error() Errno
func (*SockListenSyscall) ID ¶
func (s *SockListenSyscall) ID() SyscallID
func (*SockListenSyscall) Params ¶
func (s *SockListenSyscall) Params() []any
func (*SockListenSyscall) Results ¶
func (s *SockListenSyscall) Results() []any
type SockLocalAddressSyscall ¶
type SockLocalAddressSyscall struct { FD FD Addr SocketAddress Errno Errno }
func (*SockLocalAddressSyscall) Error ¶
func (s *SockLocalAddressSyscall) Error() Errno
func (*SockLocalAddressSyscall) ID ¶
func (s *SockLocalAddressSyscall) ID() SyscallID
func (*SockLocalAddressSyscall) Params ¶
func (s *SockLocalAddressSyscall) Params() []any
func (*SockLocalAddressSyscall) Results ¶
func (s *SockLocalAddressSyscall) Results() []any
type SockOpenSyscall ¶
type SockOpenSyscall struct { Family ProtocolFamily SocketType SocketType Protocol Protocol RightsBase Rights RightsInheriting Rights FD FD Errno Errno }
func (*SockOpenSyscall) Error ¶
func (s *SockOpenSyscall) Error() Errno
func (*SockOpenSyscall) ID ¶
func (s *SockOpenSyscall) ID() SyscallID
func (*SockOpenSyscall) Params ¶
func (s *SockOpenSyscall) Params() []any
func (*SockOpenSyscall) Results ¶
func (s *SockOpenSyscall) Results() []any
type SockRecvFromSyscall ¶
type SockRecvFromSyscall struct { FD FD IOVecs []IOVec IFlags RIFlags Size Size OFlags ROFlags Addr SocketAddress Errno Errno }
func (*SockRecvFromSyscall) Error ¶
func (s *SockRecvFromSyscall) Error() Errno
func (*SockRecvFromSyscall) ID ¶
func (s *SockRecvFromSyscall) ID() SyscallID
func (*SockRecvFromSyscall) Params ¶
func (s *SockRecvFromSyscall) Params() []any
func (*SockRecvFromSyscall) Results ¶
func (s *SockRecvFromSyscall) Results() []any
type SockRecvSyscall ¶
type SockRecvSyscall struct { FD FD IOVecs []IOVec IFlags RIFlags Size Size OFlags ROFlags Errno Errno }
func (*SockRecvSyscall) Error ¶
func (s *SockRecvSyscall) Error() Errno
func (*SockRecvSyscall) ID ¶
func (s *SockRecvSyscall) ID() SyscallID
func (*SockRecvSyscall) Params ¶
func (s *SockRecvSyscall) Params() []any
func (*SockRecvSyscall) Results ¶
func (s *SockRecvSyscall) Results() []any
type SockRemoteAddressSyscall ¶
type SockRemoteAddressSyscall struct { FD FD Addr SocketAddress Errno Errno }
func (*SockRemoteAddressSyscall) Error ¶
func (s *SockRemoteAddressSyscall) Error() Errno
func (*SockRemoteAddressSyscall) ID ¶
func (s *SockRemoteAddressSyscall) ID() SyscallID
func (*SockRemoteAddressSyscall) Params ¶
func (s *SockRemoteAddressSyscall) Params() []any
func (*SockRemoteAddressSyscall) Results ¶
func (s *SockRemoteAddressSyscall) Results() []any
type SockSendSyscall ¶
type SockSendSyscall struct { FD FD IOVecs []IOVec IFlags SIFlags Size Size Errno Errno }
func (*SockSendSyscall) Error ¶
func (s *SockSendSyscall) Error() Errno
func (*SockSendSyscall) ID ¶
func (s *SockSendSyscall) ID() SyscallID
func (*SockSendSyscall) Params ¶
func (s *SockSendSyscall) Params() []any
func (*SockSendSyscall) Results ¶
func (s *SockSendSyscall) Results() []any
type SockSendToSyscall ¶
type SockSendToSyscall struct { FD FD IOVecs []IOVec IFlags SIFlags Addr SocketAddress Size Size Errno Errno }
func (*SockSendToSyscall) Error ¶
func (s *SockSendToSyscall) Error() Errno
func (*SockSendToSyscall) ID ¶
func (s *SockSendToSyscall) ID() SyscallID
func (*SockSendToSyscall) Params ¶
func (s *SockSendToSyscall) Params() []any
func (*SockSendToSyscall) Results ¶
func (s *SockSendToSyscall) Results() []any
type SockSetOptSyscall ¶
type SockSetOptSyscall struct { FD FD Option SocketOption Value SocketOptionValue Errno Errno }
func (*SockSetOptSyscall) Error ¶
func (s *SockSetOptSyscall) Error() Errno
func (*SockSetOptSyscall) ID ¶
func (s *SockSetOptSyscall) ID() SyscallID
func (*SockSetOptSyscall) Params ¶
func (s *SockSetOptSyscall) Params() []any
func (*SockSetOptSyscall) Results ¶
func (s *SockSetOptSyscall) Results() []any
type SockShutdownSyscall ¶
type SockShutdownSyscall struct { FD FD Flags SDFlags Errno Errno }
func (*SockShutdownSyscall) Error ¶
func (s *SockShutdownSyscall) Error() Errno
func (*SockShutdownSyscall) ID ¶
func (s *SockShutdownSyscall) ID() SyscallID
func (*SockShutdownSyscall) Params ¶
func (s *SockShutdownSyscall) Params() []any
func (*SockShutdownSyscall) Results ¶
func (s *SockShutdownSyscall) Results() []any
type Syscall ¶
type Syscall interface { // ID is the syscall identifier. ID() SyscallID // Params is the set of input parameters. Params() []any // Results is the set of return values. Results() []any // Error is the system call error, or ESUCCESS if no // error occurred. Error() Errno // contains filtered or unexported methods }
Syscall is a system call.
It carries an identifier for the syscall, the inputs passed to the underlying system call, and the value(s) it returns.
type SyscallID ¶
type SyscallID int
SyscallID is a system call identifier.
const ( ArgsSizesGet SyscallID = iota ArgsGet EnvironSizesGet EnvironGet ClockResGet ClockTimeGet FDAdvise FDAllocate FDClose FDDataSync FDStatGet FDStatSetFlags FDStatSetRights FDFileStatGet FDFileStatSetSize FDFileStatSetTimes FDPread FDPreStatGet FDPreStatDirName FDPwrite FDRead FDReadDir FDRenumber FDSeek FDSync FDTell FDWrite PathCreateDirectory PathFileStatGet PathFileStatSetTimes PathLink PathOpen PathReadLink PathRemoveDirectory PathRename PathSymlink PathUnlinkFile PollOneOff ProcExit ProcRaise SchedYield RandomGet SockAccept SockRecv SockSend SockShutdown SockOpen SockBind SockConnect SockListen SockSendTo SockRecvFrom SockGetOpt SockSetOpt SockLocalAddress SockRemoteAddress SockAddressInfo )
type UnexpectedSyscallError ¶
func (*UnexpectedSyscallError) Error ¶
func (e *UnexpectedSyscallError) Error() string
type UnexpectedSyscallParamError ¶
type UnexpectedSyscallParamError struct { Syscall SyscallID Name string Actual interface{} Expect interface{} }
func (*UnexpectedSyscallParamError) Error ¶
func (e *UnexpectedSyscallParamError) Error() string