wasicall

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

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

func NewObserver(system System, before, after func(context.Context, Syscall)) System

NewObserver creates a wasi.System that notifies callbacks before and/or after a system call.

func NewRecorder

func NewRecorder(system System, write func(SyscallID, []byte)) System

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

type ArgsSizesGetSyscall struct {
	ArgCount    int
	StringBytes int
	Errno       Errno
}

func (*ArgsSizesGetSyscall) Error

func (s *ArgsSizesGetSyscall) Error() Errno

func (*ArgsSizesGetSyscall) ID

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 (*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 (c *Codec) DecodeArgsGet(buffer []byte, args []string) (_ []string, errno Errno, err error)

func (*Codec) DecodeArgsSizesGet

func (c *Codec) DecodeArgsSizesGet(buffer []byte) (argCount, stringBytes int, errno Errno, err error)

func (*Codec) DecodeClockResGet

func (c *Codec) DecodeClockResGet(buffer []byte) (id ClockID, timestamp Timestamp, errno Errno, err error)

func (*Codec) DecodeClockTimeGet

func (c *Codec) DecodeClockTimeGet(buffer []byte) (id ClockID, precision Timestamp, timestamp Timestamp, errno Errno, err error)

func (*Codec) DecodeEnvironGet

func (c *Codec) DecodeEnvironGet(buffer []byte, env []string) (_ []string, errno Errno, err error)

func (*Codec) DecodeEnvironSizesGet

func (c *Codec) DecodeEnvironSizesGet(buffer []byte) (envCount, stringBytes int, errno Errno, err error)

func (*Codec) DecodeFDAdvise

func (c *Codec) DecodeFDAdvise(buffer []byte) (fd FD, offset FileSize, length FileSize, advice Advice, errno Errno, err error)

func (*Codec) DecodeFDAllocate

func (c *Codec) DecodeFDAllocate(buffer []byte) (fd FD, offset FileSize, length FileSize, errno Errno, err error)

func (*Codec) DecodeFDClose

func (c *Codec) DecodeFDClose(buffer []byte) (fd FD, errno Errno, err error)

func (*Codec) DecodeFDDataSync

func (c *Codec) DecodeFDDataSync(buffer []byte) (fd FD, errno Errno, err error)

func (*Codec) DecodeFDFileStatGet

func (c *Codec) DecodeFDFileStatGet(buffer []byte) (fd FD, stat FileStat, errno Errno, err error)

func (*Codec) DecodeFDFileStatSetSize

func (c *Codec) DecodeFDFileStatSetSize(buffer []byte) (fd FD, size FileSize, errno Errno, err error)

func (*Codec) DecodeFDFileStatSetTimes

func (c *Codec) DecodeFDFileStatSetTimes(buffer []byte) (fd FD, accessTime, modifyTime Timestamp, flags FSTFlags, errno Errno, err error)

func (*Codec) DecodeFDPreStatDirName

func (c *Codec) DecodeFDPreStatDirName(buffer []byte) (fd FD, name string, errno Errno, err error)

func (*Codec) DecodeFDPreStatGet

func (c *Codec) DecodeFDPreStatGet(buffer []byte) (fd FD, stat PreStat, errno Errno, err error)

func (*Codec) DecodeFDPread

func (c *Codec) DecodeFDPread(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, offset FileSize, size Size, errno Errno, err error)

func (*Codec) DecodeFDPwrite

func (c *Codec) DecodeFDPwrite(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, offset FileSize, size Size, errno Errno, err error)

func (*Codec) DecodeFDRead

func (c *Codec) DecodeFDRead(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, size Size, errno Errno, err error)

func (*Codec) DecodeFDReadDir

func (c *Codec) DecodeFDReadDir(buffer []byte, entries []DirEntry) (fd FD, _ []DirEntry, cookie DirCookie, bufferSizeBytes int, errno Errno, err error)

func (*Codec) DecodeFDRenumber

func (c *Codec) DecodeFDRenumber(buffer []byte) (from, to FD, errno Errno, err error)

func (*Codec) DecodeFDSeek

func (c *Codec) DecodeFDSeek(buffer []byte) (fd FD, seekOffset FileDelta, whence Whence, offset FileSize, errno Errno, err error)

func (*Codec) DecodeFDStatGet

func (c *Codec) DecodeFDStatGet(buffer []byte) (fd FD, stat FDStat, errno Errno, err error)

func (*Codec) DecodeFDStatSetFlags

func (c *Codec) DecodeFDStatSetFlags(buffer []byte) (fd FD, flags FDFlags, errno Errno, err error)

func (*Codec) DecodeFDStatSetRights

func (c *Codec) DecodeFDStatSetRights(buffer []byte) (fd FD, rightsBase, rightsInheriting Rights, errno Errno, err error)

func (*Codec) DecodeFDSync

func (c *Codec) DecodeFDSync(buffer []byte) (fd FD, errno Errno, err error)

func (*Codec) DecodeFDTell

func (c *Codec) DecodeFDTell(buffer []byte) (fd FD, offset FileSize, errno Errno, err error)

func (*Codec) DecodeFDWrite

func (c *Codec) DecodeFDWrite(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, size Size, errno Errno, err error)

func (*Codec) DecodePathCreateDirectory

func (c *Codec) DecodePathCreateDirectory(buffer []byte) (fd FD, path string, errno Errno, err error)

func (*Codec) DecodePathFileStatGet

func (c *Codec) DecodePathFileStatGet(buffer []byte) (fd FD, lookupFlags LookupFlags, path string, fileStat FileStat, errno Errno, err error)

func (*Codec) DecodePathFileStatSetTimes

func (c *Codec) DecodePathFileStatSetTimes(buffer []byte) (fd FD, lookupFlags LookupFlags, path string, accessTime, modifyTime Timestamp, flags FSTFlags, errno Errno, err error)
func (c *Codec) DecodePathLink(buffer []byte) (oldFD FD, oldFlags LookupFlags, oldPath string, newFD FD, newPath string, errno Errno, err error)

func (*Codec) DecodePathOpen

func (c *Codec) DecodePathOpen(buffer []byte) (fd FD, dirFlags LookupFlags, path string, openFlags OpenFlags, rightsBase, rightsInheriting Rights, fdFlags FDFlags, newfd FD, errno Errno, err error)
func (c *Codec) DecodePathReadLink(buffer []byte) (fd FD, path string, output []byte, errno Errno, err error)

func (*Codec) DecodePathRemoveDirectory

func (c *Codec) DecodePathRemoveDirectory(buffer []byte) (fd FD, path string, errno Errno, err error)

func (*Codec) DecodePathRename

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 (*Codec) DecodePathUnlinkFile

func (c *Codec) DecodePathUnlinkFile(buffer []byte) (fd FD, path string, errno Errno, err error)

func (*Codec) DecodePollOneOff

func (c *Codec) DecodePollOneOff(buffer []byte, subscriptions []Subscription, events []Event) (_ []Subscription, _ []Event, errno Errno, err error)

func (*Codec) DecodeProcExit

func (c *Codec) DecodeProcExit(buffer []byte) (exitCode ExitCode, errno Errno, err error)

func (*Codec) DecodeProcRaise

func (c *Codec) DecodeProcRaise(buffer []byte) (signal Signal, errno Errno, err error)

func (*Codec) DecodeRandomGet

func (c *Codec) DecodeRandomGet(buffer []byte) (result []byte, errno Errno, err error)

func (*Codec) DecodeSchedYield

func (c *Codec) DecodeSchedYield(buffer []byte) (errno Errno, err error)

func (*Codec) DecodeSockAccept

func (c *Codec) DecodeSockAccept(buffer []byte) (fd FD, flags FDFlags, newfd FD, peer, addr SocketAddress, errno Errno, err error)

func (*Codec) DecodeSockAddressInfo

func (c *Codec) DecodeSockAddressInfo(buffer []byte, results []AddressInfo) (name, service string, hint AddressInfo, _ []AddressInfo, errno Errno, err error)

func (*Codec) DecodeSockBind

func (c *Codec) DecodeSockBind(buffer []byte) (fd FD, bind, addr SocketAddress, errno Errno, err error)

func (*Codec) DecodeSockConnect

func (c *Codec) DecodeSockConnect(buffer []byte) (fd FD, peer, addr SocketAddress, errno Errno, err error)

func (*Codec) DecodeSockGetOpt

func (c *Codec) DecodeSockGetOpt(buffer []byte) (fd FD, option SocketOption, value SocketOptionValue, errno Errno, err error)

func (*Codec) DecodeSockListen

func (c *Codec) DecodeSockListen(buffer []byte) (fd FD, backlog int, errno Errno, err error)

func (*Codec) DecodeSockLocalAddress

func (c *Codec) DecodeSockLocalAddress(buffer []byte) (fd FD, addr SocketAddress, errno Errno, err error)

func (*Codec) DecodeSockOpen

func (c *Codec) DecodeSockOpen(buffer []byte) (family ProtocolFamily, socketType SocketType, protocol Protocol, rightsBase, rightsInheriting Rights, fd FD, errno Errno, err error)

func (*Codec) DecodeSockRecv

func (c *Codec) DecodeSockRecv(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, iflags RIFlags, size Size, oflags ROFlags, errno Errno, err error)

func (*Codec) DecodeSockRecvFrom

func (c *Codec) DecodeSockRecvFrom(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, iflags RIFlags, size Size, oflags ROFlags, addr SocketAddress, errno Errno, err error)

func (*Codec) DecodeSockRemoteAddress

func (c *Codec) DecodeSockRemoteAddress(buffer []byte) (fd FD, addr SocketAddress, errno Errno, err error)

func (*Codec) DecodeSockSend

func (c *Codec) DecodeSockSend(buffer []byte) (fd FD, iovecs []IOVec, flags SIFlags, size Size, errno Errno, err error)

func (*Codec) DecodeSockSendTo

func (c *Codec) DecodeSockSendTo(buffer []byte, iovecs []IOVec) (fd FD, _ []IOVec, iflags SIFlags, addr SocketAddress, size Size, errno Errno, err error)

func (*Codec) DecodeSockSetOpt

func (c *Codec) DecodeSockSetOpt(buffer []byte) (fd FD, option SocketOption, value SocketOptionValue, errno Errno, err error)

func (*Codec) DecodeSockShutdown

func (c *Codec) DecodeSockShutdown(buffer []byte) (fd FD, flags SDFlags, errno Errno, err error)

func (*Codec) EncodeArgsGet

func (c *Codec) EncodeArgsGet(buffer []byte, args []string, errno Errno) []byte

func (*Codec) EncodeArgsSizesGet

func (c *Codec) EncodeArgsSizesGet(buffer []byte, argCount, stringBytes int, errno Errno) []byte

func (*Codec) EncodeClockResGet

func (c *Codec) EncodeClockResGet(buffer []byte, id ClockID, timestamp Timestamp, errno Errno) []byte

func (*Codec) EncodeClockTimeGet

func (c *Codec) EncodeClockTimeGet(buffer []byte, id ClockID, precision Timestamp, timestamp Timestamp, errno Errno) []byte

func (*Codec) EncodeEnvironGet

func (c *Codec) EncodeEnvironGet(buffer []byte, env []string, errno Errno) []byte

func (*Codec) EncodeEnvironSizesGet

func (c *Codec) EncodeEnvironSizesGet(buffer []byte, envCount, stringBytes int, errno Errno) []byte

func (*Codec) EncodeFDAdvise

func (c *Codec) EncodeFDAdvise(buffer []byte, fd FD, offset FileSize, length FileSize, advice Advice, errno Errno) []byte

func (*Codec) EncodeFDAllocate

func (c *Codec) EncodeFDAllocate(buffer []byte, fd FD, offset FileSize, length FileSize, errno Errno) []byte

func (*Codec) EncodeFDClose

func (c *Codec) EncodeFDClose(buffer []byte, fd FD, errno Errno) []byte

func (*Codec) EncodeFDDataSync

func (c *Codec) EncodeFDDataSync(buffer []byte, fd FD, errno Errno) []byte

func (*Codec) EncodeFDFileStatGet

func (c *Codec) EncodeFDFileStatGet(buffer []byte, fd FD, stat FileStat, errno Errno) []byte

func (*Codec) EncodeFDFileStatSetSize

func (c *Codec) EncodeFDFileStatSetSize(buffer []byte, fd FD, size FileSize, errno Errno) []byte

func (*Codec) EncodeFDFileStatSetTimes

func (c *Codec) EncodeFDFileStatSetTimes(buffer []byte, fd FD, accessTime, modifyTime Timestamp, flags FSTFlags, errno Errno) []byte

func (*Codec) EncodeFDPreStatDirName

func (c *Codec) EncodeFDPreStatDirName(buffer []byte, fd FD, name string, errno Errno) []byte

func (*Codec) EncodeFDPreStatGet

func (c *Codec) EncodeFDPreStatGet(buffer []byte, fd FD, stat PreStat, errno Errno) []byte

func (*Codec) EncodeFDPread

func (c *Codec) EncodeFDPread(buffer []byte, fd FD, iovecs []IOVec, offset FileSize, size Size, errno Errno) []byte

func (*Codec) EncodeFDPwrite

func (c *Codec) EncodeFDPwrite(buffer []byte, fd FD, iovecs []IOVec, offset FileSize, size Size, errno Errno) []byte

func (*Codec) EncodeFDRead

func (c *Codec) EncodeFDRead(buffer []byte, fd FD, iovecs []IOVec, size Size, errno Errno) []byte

func (*Codec) EncodeFDReadDir

func (c *Codec) EncodeFDReadDir(buffer []byte, fd FD, entries []DirEntry, cookie DirCookie, bufferSizeBytes int, errno Errno) []byte

func (*Codec) EncodeFDRenumber

func (c *Codec) EncodeFDRenumber(buffer []byte, from, to FD, errno Errno) []byte

func (*Codec) EncodeFDSeek

func (c *Codec) EncodeFDSeek(buffer []byte, fd FD, seekOffset FileDelta, whence Whence, offset FileSize, errno Errno) []byte

func (*Codec) EncodeFDStatGet

func (c *Codec) EncodeFDStatGet(buffer []byte, fd FD, stat FDStat, errno Errno) []byte

func (*Codec) EncodeFDStatSetFlags

func (c *Codec) EncodeFDStatSetFlags(buffer []byte, fd FD, flags FDFlags, errno Errno) []byte

func (*Codec) EncodeFDStatSetRights

func (c *Codec) EncodeFDStatSetRights(buffer []byte, fd FD, rightsBase, rightsInheriting Rights, errno Errno) []byte

func (*Codec) EncodeFDSync

func (c *Codec) EncodeFDSync(buffer []byte, fd FD, errno Errno) []byte

func (*Codec) EncodeFDTell

func (c *Codec) EncodeFDTell(buffer []byte, fd FD, offset FileSize, errno Errno) []byte

func (*Codec) EncodeFDWrite

func (c *Codec) EncodeFDWrite(buffer []byte, fd FD, iovecs []IOVec, size Size, errno Errno) []byte

func (*Codec) EncodePathCreateDirectory

func (c *Codec) EncodePathCreateDirectory(buffer []byte, fd FD, path string, errno Errno) []byte

func (*Codec) EncodePathFileStatGet

func (c *Codec) EncodePathFileStatGet(buffer []byte, fd FD, lookupFlags LookupFlags, path string, fileStat FileStat, errno Errno) []byte

func (*Codec) EncodePathFileStatSetTimes

func (c *Codec) EncodePathFileStatSetTimes(buffer []byte, fd FD, lookupFlags LookupFlags, path string, accessTime, modifyTime Timestamp, flags FSTFlags, errno Errno) []byte
func (c *Codec) EncodePathLink(buffer []byte, oldFD FD, oldFlags LookupFlags, oldPath string, newFD FD, newPath string, errno Errno) []byte

func (*Codec) EncodePathOpen

func (c *Codec) EncodePathOpen(buffer []byte, fd FD, dirFlags LookupFlags, path string, openFlags OpenFlags, rightsBase, rightsInheriting Rights, fdFlags FDFlags, newfd FD, errno Errno) []byte
func (c *Codec) EncodePathReadLink(buffer []byte, fd FD, path string, output []byte, errno Errno) []byte

func (*Codec) EncodePathRemoveDirectory

func (c *Codec) EncodePathRemoveDirectory(buffer []byte, fd FD, path string, errno Errno) []byte

func (*Codec) EncodePathRename

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 (*Codec) EncodePathUnlinkFile

func (c *Codec) EncodePathUnlinkFile(buffer []byte, fd FD, path string, errno Errno) []byte

func (*Codec) EncodePollOneOff

func (c *Codec) EncodePollOneOff(buffer []byte, subscriptions []Subscription, events []Event, errno Errno) []byte

func (*Codec) EncodeProcExit

func (c *Codec) EncodeProcExit(buffer []byte, exitCode ExitCode, errno Errno) []byte

func (*Codec) EncodeProcRaise

func (c *Codec) EncodeProcRaise(buffer []byte, signal Signal, errno Errno) []byte

func (*Codec) EncodeRandomGet

func (c *Codec) EncodeRandomGet(buffer []byte, b []byte, errno Errno) []byte

func (*Codec) EncodeSchedYield

func (c *Codec) EncodeSchedYield(buffer []byte, errno Errno) []byte

func (*Codec) EncodeSockAccept

func (c *Codec) EncodeSockAccept(buffer []byte, fd FD, flags FDFlags, newfd FD, peer, addr SocketAddress, errno Errno) []byte

func (*Codec) EncodeSockAddressInfo

func (c *Codec) EncodeSockAddressInfo(buffer []byte, name, service string, hint AddressInfo, results []AddressInfo, errno Errno) []byte

func (*Codec) EncodeSockBind

func (c *Codec) EncodeSockBind(buffer []byte, fd FD, bind, addr SocketAddress, errno Errno) []byte

func (*Codec) EncodeSockConnect

func (c *Codec) EncodeSockConnect(buffer []byte, fd FD, peer, addr SocketAddress, errno Errno) []byte

func (*Codec) EncodeSockGetOpt

func (c *Codec) EncodeSockGetOpt(buffer []byte, fd FD, option SocketOption, value SocketOptionValue, errno Errno) []byte

func (*Codec) EncodeSockListen

func (c *Codec) EncodeSockListen(buffer []byte, fd FD, backlog int, errno Errno) []byte

func (*Codec) EncodeSockLocalAddress

func (c *Codec) EncodeSockLocalAddress(buffer []byte, fd FD, addr SocketAddress, errno Errno) []byte

func (*Codec) EncodeSockOpen

func (c *Codec) EncodeSockOpen(buffer []byte, family ProtocolFamily, socketType SocketType, protocol Protocol, rightsBase, rightsInheriting Rights, fd FD, errno Errno) []byte

func (*Codec) EncodeSockRecv

func (c *Codec) EncodeSockRecv(buffer []byte, fd FD, iovecs []IOVec, iflags RIFlags, size Size, oflags ROFlags, errno Errno) []byte

func (*Codec) EncodeSockRecvFrom

func (c *Codec) EncodeSockRecvFrom(buffer []byte, fd FD, iovecs []IOVec, iflags RIFlags, size Size, oflags ROFlags, addr SocketAddress, errno Errno) []byte

func (*Codec) EncodeSockRemoteAddress

func (c *Codec) EncodeSockRemoteAddress(buffer []byte, fd FD, addr SocketAddress, errno Errno) []byte

func (*Codec) EncodeSockSend

func (c *Codec) EncodeSockSend(buffer []byte, fd FD, iovecs []IOVec, flags SIFlags, size Size, errno Errno) []byte

func (*Codec) EncodeSockSendTo

func (c *Codec) EncodeSockSendTo(buffer []byte, fd FD, iovecs []IOVec, iflags SIFlags, addr SocketAddress, size Size, errno Errno) []byte

func (*Codec) EncodeSockSetOpt

func (c *Codec) EncodeSockSetOpt(buffer []byte, fd FD, option SocketOption, value SocketOptionValue, errno Errno) []byte

func (*Codec) EncodeSockShutdown

func (c *Codec) EncodeSockShutdown(buffer []byte, fd FD, flags SDFlags, errno Errno) []byte

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.

func (*Decoder) Decode

func (r *Decoder) Decode(record timemachine.Record) (time.Time, Syscall, error)

Decode a syscall from a write. Slices in the returned syscall point to internal cache buffers can are invalidated on the next Decode call.

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

type EnvironSizesGetSyscall struct {
	EnvCount    int
	StringBytes int
	Errno       Errno
}

func (*EnvironSizesGetSyscall) Error

func (s *EnvironSizesGetSyscall) Error() Errno

func (*EnvironSizesGetSyscall) ID

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 (*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 (*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 (*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 (*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 (*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 (*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 (*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 (*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 (*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 (*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

type PathReadLinkSyscall struct {
	FD     FD
	Path   string
	Output []byte
	Errno  Errno
}

func (*PathReadLinkSyscall) Error

func (s *PathReadLinkSyscall) Error() Errno

func (*PathReadLinkSyscall) ID

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 (*PathRemoveDirectorySyscall) Params

func (s *PathRemoveDirectorySyscall) Params() []any

func (*PathRemoveDirectorySyscall) Results

func (s *PathRemoveDirectorySyscall) Results() []any

type PathRenameSyscall

type PathRenameSyscall struct {
	FD      FD
	OldPath string
	NewFD   FD
	NewPath string
	Errno   Errno
}

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

type PathSymlinkSyscall struct {
	OldPath string
	FD      FD
	NewPath string
	Errno   Errno
}

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 (*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 ReadError

type ReadError struct {
	// contains filtered or unexported fields
}

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(records stream.Reader[timemachine.Record]) *Reader

NewReader creates a Reader.

func (*Reader) ReadSyscall

func (r *Reader) ReadSyscall() (time.Time, Syscall, error)

ReadSyscall reads a recorded system call.

type Replay

type Replay struct {
	Stdout io.Writer
	Stderr io.Writer
	// contains filtered or unexported fields
}

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) ArgsGet

func (r *Replay) ArgsGet(ctx context.Context) (args []string, errno Errno)

func (*Replay) ArgsSizesGet

func (r *Replay) ArgsSizesGet(ctx context.Context) (int, int, Errno)

func (*Replay) ClockResGet

func (r *Replay) ClockResGet(ctx context.Context, id ClockID) (Timestamp, Errno)

func (*Replay) ClockTimeGet

func (r *Replay) ClockTimeGet(ctx context.Context, id ClockID, precision Timestamp) (Timestamp, Errno)

func (*Replay) Close

func (r *Replay) Close(ctx context.Context) error

func (*Replay) EnvironGet

func (r *Replay) EnvironGet(ctx context.Context) (env []string, errno Errno)

func (*Replay) EnvironSizesGet

func (r *Replay) EnvironSizesGet(ctx context.Context) (int, int, Errno)

func (*Replay) FDAdvise

func (r *Replay) FDAdvise(ctx context.Context, fd FD, offset FileSize, length FileSize, advice Advice) Errno

func (*Replay) FDAllocate

func (r *Replay) FDAllocate(ctx context.Context, fd FD, offset FileSize, length FileSize) Errno

func (*Replay) FDClose

func (r *Replay) FDClose(ctx context.Context, fd FD) Errno

func (*Replay) FDDataSync

func (r *Replay) FDDataSync(ctx context.Context, fd FD) Errno

func (*Replay) FDFileStatGet

func (r *Replay) FDFileStatGet(ctx context.Context, fd FD) (FileStat, Errno)

func (*Replay) FDFileStatSetSize

func (r *Replay) FDFileStatSetSize(ctx context.Context, fd FD, size FileSize) Errno

func (*Replay) FDFileStatSetTimes

func (r *Replay) FDFileStatSetTimes(ctx context.Context, fd FD, accessTime, modifyTime Timestamp, flags FSTFlags) Errno

func (*Replay) FDPreStatDirName

func (r *Replay) FDPreStatDirName(ctx context.Context, fd FD) (string, Errno)

func (*Replay) FDPreStatGet

func (r *Replay) FDPreStatGet(ctx context.Context, fd FD) (PreStat, Errno)

func (*Replay) FDPread

func (r *Replay) FDPread(ctx context.Context, fd FD, iovecs []IOVec, offset FileSize) (Size, Errno)

func (*Replay) FDPwrite

func (r *Replay) FDPwrite(ctx context.Context, fd FD, iovecs []IOVec, offset FileSize) (Size, Errno)

func (*Replay) FDRead

func (r *Replay) FDRead(ctx context.Context, fd FD, iovecs []IOVec) (Size, Errno)

func (*Replay) FDReadDir

func (r *Replay) FDReadDir(ctx context.Context, fd FD, entries []DirEntry, cookie DirCookie, bufferSizeBytes int) (int, Errno)

func (*Replay) FDRenumber

func (r *Replay) FDRenumber(ctx context.Context, from, to FD) Errno

func (*Replay) FDSeek

func (r *Replay) FDSeek(ctx context.Context, fd FD, offset FileDelta, whence Whence) (FileSize, Errno)

func (*Replay) FDStatGet

func (r *Replay) FDStatGet(ctx context.Context, fd FD) (FDStat, Errno)

func (*Replay) FDStatSetFlags

func (r *Replay) FDStatSetFlags(ctx context.Context, fd FD, flags FDFlags) Errno

func (*Replay) FDStatSetRights

func (r *Replay) FDStatSetRights(ctx context.Context, fd FD, rightsBase, rightsInheriting Rights) Errno

func (*Replay) FDSync

func (r *Replay) FDSync(ctx context.Context, fd FD) Errno

func (*Replay) FDTell

func (r *Replay) FDTell(ctx context.Context, fd FD) (FileSize, Errno)

func (*Replay) FDWrite

func (r *Replay) FDWrite(ctx context.Context, fd FD, iovecs []IOVec) (Size, Errno)

func (*Replay) PathCreateDirectory

func (r *Replay) PathCreateDirectory(ctx context.Context, fd FD, path string) Errno

func (*Replay) PathFileStatGet

func (r *Replay) PathFileStatGet(ctx context.Context, fd FD, lookupFlags LookupFlags, path string) (FileStat, Errno)

func (*Replay) PathFileStatSetTimes

func (r *Replay) PathFileStatSetTimes(ctx context.Context, fd FD, lookupFlags LookupFlags, path string, accessTime, modifyTime Timestamp, flags FSTFlags) Errno
func (r *Replay) PathLink(ctx context.Context, oldFD FD, oldFlags LookupFlags, oldPath string, newFD FD, newPath string) Errno

func (*Replay) PathOpen

func (r *Replay) PathOpen(ctx context.Context, fd FD, dirFlags LookupFlags, path string, openFlags OpenFlags, rightsBase, rightsInheriting Rights, fdFlags FDFlags) (FD, Errno)
func (r *Replay) PathReadLink(ctx context.Context, fd FD, path string, buffer []byte) (int, Errno)

func (*Replay) PathRemoveDirectory

func (r *Replay) PathRemoveDirectory(ctx context.Context, fd FD, path string) Errno

func (*Replay) PathRename

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 (*Replay) PathUnlinkFile

func (r *Replay) PathUnlinkFile(ctx context.Context, fd FD, path string) Errno

func (*Replay) PollOneOff

func (r *Replay) PollOneOff(ctx context.Context, subscriptions []Subscription, events []Event) (int, Errno)

func (*Replay) ProcExit

func (r *Replay) ProcExit(ctx context.Context, exitCode ExitCode) Errno

func (*Replay) ProcRaise

func (r *Replay) ProcRaise(ctx context.Context, signal Signal) Errno

func (*Replay) RandomGet

func (r *Replay) RandomGet(ctx context.Context, buffer []byte) Errno

func (*Replay) SchedYield

func (r *Replay) SchedYield(ctx context.Context) Errno

func (*Replay) SockAccept

func (r *Replay) SockAccept(ctx context.Context, fd FD, flags FDFlags) (FD, SocketAddress, SocketAddress, Errno)

func (*Replay) SockAddressInfo

func (r *Replay) SockAddressInfo(ctx context.Context, name, service string, hints AddressInfo, buffer []AddressInfo) (int, Errno)

func (*Replay) SockBind

func (r *Replay) SockBind(ctx context.Context, fd FD, bind SocketAddress) (SocketAddress, Errno)

func (*Replay) SockConnect

func (r *Replay) SockConnect(ctx context.Context, fd FD, peer SocketAddress) (SocketAddress, Errno)

func (*Replay) SockGetOpt

func (r *Replay) SockGetOpt(ctx context.Context, fd FD, option SocketOption) (SocketOptionValue, Errno)

func (*Replay) SockListen

func (r *Replay) SockListen(ctx context.Context, fd FD, backlog int) Errno

func (*Replay) SockLocalAddress

func (r *Replay) SockLocalAddress(ctx context.Context, fd FD) (SocketAddress, Errno)

func (*Replay) SockOpen

func (r *Replay) SockOpen(ctx context.Context, protocolFamily ProtocolFamily, socketType SocketType, protocol Protocol, rightsBase, rightsInheriting Rights) (FD, Errno)

func (*Replay) SockRecv

func (r *Replay) SockRecv(ctx context.Context, fd FD, iovecs []IOVec, iflags RIFlags) (Size, ROFlags, Errno)

func (*Replay) SockRecvFrom

func (r *Replay) SockRecvFrom(ctx context.Context, fd FD, iovecs []IOVec, iflags RIFlags) (Size, ROFlags, SocketAddress, Errno)

func (*Replay) SockRemoteAddress

func (r *Replay) SockRemoteAddress(ctx context.Context, fd FD) (SocketAddress, Errno)

func (*Replay) SockSend

func (r *Replay) SockSend(ctx context.Context, fd FD, iovecs []IOVec, iflags SIFlags) (Size, Errno)

func (*Replay) SockSendTo

func (r *Replay) SockSendTo(ctx context.Context, fd FD, iovecs []IOVec, iflags SIFlags, addr SocketAddress) (Size, Errno)

func (*Replay) SockSetOpt

func (r *Replay) SockSetOpt(ctx context.Context, fd FD, option SocketOption, value SocketOptionValue) Errno

func (*Replay) SockShutdown

func (r *Replay) SockShutdown(ctx context.Context, fd FD, flags SDFlags) Errno

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 (*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 (*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 (*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 (*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 (*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
)

func (SyscallID) String

func (s SyscallID) String() string

type UnexpectedSyscallError

type UnexpectedSyscallError struct {
	Recorded SyscallID
	Observed SyscallID
}

func (*UnexpectedSyscallError) Error

func (e *UnexpectedSyscallError) Error() string

type UnexpectedSyscallParamError

type UnexpectedSyscallParamError struct {
	Syscall SyscallID
	Name    string
	Actual  interface{}
	Expect  interface{}
}

func (*UnexpectedSyscallParamError) Error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL