package sysfs

import "github.com/tetratelabs/wazero/internal/sysfs"

Package sysfs includes a low-level filesystem interface and utilities needed for WebAssembly host functions (ABI) such as WASI.

The name sysfs was chosen because wazero's public API has a "sys" package, which was named after https://github.com/golang/sys.

Index

Constants

const MSG_PEEK = syscall.MSG_PEEK

MSG_PEEK is the constant syscall.MSG_PEEK

Functions

func DirFS

func DirFS(dir string) experimentalsys.FS

func NewStdioFile

func NewStdioFile(stdin bool, f fs.File) (fsapi.File, error)

func NewTCPListenerFile

func NewTCPListenerFile(tl *net.TCPListener) socketapi.TCPSock

NewTCPListenerFile creates a socketapi.TCPSock for a given *net.TCPListener.

func OpenFSFile

func OpenFSFile(fs fs.FS, path string, flag experimentalsys.Oflag, perm fs.FileMode) (experimentalsys.File, experimentalsys.Errno)

func OpenFile

func OpenFile(path string, flag experimentalsys.Oflag, perm fs.FileMode) (*os.File, experimentalsys.Errno)

func OpenOSFile

Types

type AdaptFS

type AdaptFS struct {
	FS fs.FS
}

func (*AdaptFS) Chmod

Chmod implements the same method as documented on sys.FS

Link implements the same method as documented on sys.FS

func (*AdaptFS) Lstat

func (a *AdaptFS) Lstat(path string) (sys.Stat_t, experimentalsys.Errno)

Lstat implements the same method as documented on sys.FS

func (*AdaptFS) Mkdir

Mkdir implements the same method as documented on sys.FS

func (*AdaptFS) OpenFile

OpenFile implements the same method as documented on sys.FS

func (a *AdaptFS) Readlink(string) (string, experimentalsys.Errno)

Readlink implements the same method as documented on sys.FS

func (*AdaptFS) Rename

Rename implements the same method as documented on sys.FS

func (*AdaptFS) Rmdir

func (a *AdaptFS) Rmdir(string) experimentalsys.Errno

Rmdir implements the same method as documented on sys.FS

func (*AdaptFS) Stat

func (a *AdaptFS) Stat(path string) (sys.Stat_t, experimentalsys.Errno)

Stat implements the same method as documented on sys.FS

func (*AdaptFS) String

func (a *AdaptFS) String() string

String implements fmt.Stringer

func (a *AdaptFS) Symlink(string, string) experimentalsys.Errno

Symlink implements the same method as documented on sys.FS

func (a *AdaptFS) Unlink(string) experimentalsys.Errno

Unlink implements the same method as documented on sys.FS

func (*AdaptFS) Utimens

Utimens implements the same method as documented on sys.FS

type ReadFS

type ReadFS struct {
	experimentalsys.FS
}

func (*ReadFS) Chmod

func (r *ReadFS) Chmod(path string, perm fs.FileMode) experimentalsys.Errno

Chmod implements the same method as documented on sys.FS

func (r *ReadFS) Link(_, _ string) experimentalsys.Errno

Link implements the same method as documented on sys.FS

func (*ReadFS) Mkdir

func (r *ReadFS) Mkdir(path string, perm fs.FileMode) experimentalsys.Errno

Mkdir implements the same method as documented on sys.FS

func (*ReadFS) OpenFile

OpenFile implements the same method as documented on sys.FS

func (*ReadFS) Rename

func (r *ReadFS) Rename(from, to string) experimentalsys.Errno

Rename implements the same method as documented on sys.FS

func (*ReadFS) Rmdir

func (r *ReadFS) Rmdir(path string) experimentalsys.Errno

Rmdir implements the same method as documented on sys.FS

func (r *ReadFS) Symlink(_, _ string) experimentalsys.Errno

Symlink implements the same method as documented on sys.FS

func (r *ReadFS) Unlink(path string) experimentalsys.Errno

Unlink implements the same method as documented on sys.FS

func (*ReadFS) Utimens

func (r *ReadFS) Utimens(path string, atim, mtim int64) experimentalsys.Errno

Utimens implements the same method as documented on sys.FS

Source Files

adapter.go datasync_linux.go dir.go dirfs.go dirfs_supported.go file.go file_unix.go futimens.go futimens_linux.go ino.go nonblock_unix.go oflag.go open_file_linux.go open_file_notwindows.go osfile.go poll.go poll_linux.go readfs.go rename.go sock.go sock_supported.go sock_unix.go stat.go stat_linux.go sync.go sysfs.go unlink.go

Version
v1.9.0 (latest)
Published
Feb 18, 2025
Platform
linux/amd64
Imports
14 packages
Last checked
4 days ago

Tools for package owners.