sysfs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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 wazy's public API has a "sys" package, which was named after https://github.com/golang/sys.

Index

Constants

View Source
const MSG_PEEK = syscall.MSG_PEEK

MSG_PEEK is the constant syscall.MSG_PEEK

Variables

This section is empty.

Functions

func DirFS

func DirFS(dir string) sys.FS

func NewStdioFile

func NewStdioFile(stdin bool, f fs.File) (sys.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 sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)

func OpenFile

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

func OpenOSFile

func OpenOSFile(path string, flag sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)

func PollReadiness

func PollReadiness(files []sys.Pollable, timeoutMillis int32) (ready []bool, errno sys.Errno, ok bool)

PollReadiness polls files for POLLIN readiness with a single _poll syscall over all of them, so it returns as soon as ANY file is ready — the any-ready semantics poll_oneoff requires — instead of blocking on each file in turn.

ready[i] reports whether files[i] became readable (nil if none did before the timeout). ok is false when any file cannot expose a raw fd (e.g. sockets); the caller must then fall back to sequential Poll. timeoutMillis matches _poll: a negative value blocks indefinitely.

Types

type AdaptFS

type AdaptFS struct {
	FS fs.FS
}

func (*AdaptFS) Chmod

func (a *AdaptFS) Chmod(string, fs.FileMode) sys.Errno

Chmod implements the same method as documented on sys.FS

func (a *AdaptFS) Link(string, string) sys.Errno

Link implements the same method as documented on sys.FS

func (*AdaptFS) Lstat

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

Lstat implements the same method as documented on sys.FS

func (*AdaptFS) Mkdir

func (a *AdaptFS) Mkdir(string, fs.FileMode) sys.Errno

Mkdir implements the same method as documented on sys.FS

func (*AdaptFS) OpenFile

func (a *AdaptFS) OpenFile(path string, flag sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)

OpenFile implements the same method as documented on sys.FS

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

Readlink implements the same method as documented on sys.FS

func (*AdaptFS) Rename

func (a *AdaptFS) Rename(string, string) sys.Errno

Rename implements the same method as documented on sys.FS

func (*AdaptFS) Rmdir

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

Rmdir implements the same method as documented on sys.FS

func (*AdaptFS) Stat

func (a *AdaptFS) Stat(path string) (sys.Stat_t, sys.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) sys.Errno

Symlink implements the same method as documented on sys.FS

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

Unlink implements the same method as documented on sys.FS

func (*AdaptFS) Utimens

func (a *AdaptFS) Utimens(string, int64, int64) sys.Errno

Utimens implements the same method as documented on sys.FS

type ReadFS

type ReadFS struct {
	sys.FS
}

func (*ReadFS) Chmod

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

Chmod implements the same method as documented on sys.FS

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

Link implements the same method as documented on sys.FS

func (*ReadFS) Mkdir

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

Mkdir implements the same method as documented on sys.FS

func (*ReadFS) OpenFile

func (r *ReadFS) OpenFile(path string, flag sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)

OpenFile implements the same method as documented on sys.FS

func (*ReadFS) Rename

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

Rename implements the same method as documented on sys.FS

func (*ReadFS) Rmdir

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

Rmdir implements the same method as documented on sys.FS

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

Symlink implements the same method as documented on sys.FS

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

Unlink implements the same method as documented on sys.FS

func (*ReadFS) Utimens

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

Utimens implements the same method as documented on sys.FS

Jump to

Keyboard shortcuts

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