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
- func DirFS(dir string) sys.FS
- func NewStdioFile(stdin bool, f fs.File) (sys.File, error)
- func NewTCPListenerFile(tl *net.TCPListener) socketapi.TCPSock
- func OpenFSFile(fs fs.FS, path string, flag sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)
- func OpenFile(path string, flag sys.Oflag, perm fs.FileMode) (*os.File, sys.Errno)
- func OpenOSFile(path string, flag sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)
- func PollReadiness(files []sys.Pollable, timeoutMillis int32) (ready []bool, errno sys.Errno, ok bool)
- type AdaptFS
- func (a *AdaptFS) Chmod(string, fs.FileMode) sys.Errno
- func (a *AdaptFS) Link(string, string) sys.Errno
- func (a *AdaptFS) Lstat(path string) (sys.Stat_t, sys.Errno)
- func (a *AdaptFS) Mkdir(string, fs.FileMode) sys.Errno
- func (a *AdaptFS) OpenFile(path string, flag sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)
- func (a *AdaptFS) Readlink(string) (string, sys.Errno)
- func (a *AdaptFS) Rename(string, string) sys.Errno
- func (a *AdaptFS) Rmdir(string) sys.Errno
- func (a *AdaptFS) Stat(path string) (sys.Stat_t, sys.Errno)
- func (a *AdaptFS) String() string
- func (a *AdaptFS) Symlink(string, string) sys.Errno
- func (a *AdaptFS) Unlink(string) sys.Errno
- func (a *AdaptFS) Utimens(string, int64, int64) sys.Errno
- type ReadFS
- func (r *ReadFS) Chmod(path string, perm fs.FileMode) sys.Errno
- func (r *ReadFS) Link(_, _ string) sys.Errno
- func (r *ReadFS) Mkdir(path string, perm fs.FileMode) sys.Errno
- func (r *ReadFS) OpenFile(path string, flag sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)
- func (r *ReadFS) Rename(from, to string) sys.Errno
- func (r *ReadFS) Rmdir(path string) sys.Errno
- func (r *ReadFS) Symlink(_, _ string) sys.Errno
- func (r *ReadFS) Unlink(path string) sys.Errno
- func (r *ReadFS) Utimens(path string, atim, mtim int64) sys.Errno
Constants ¶
const MSG_PEEK = syscall.MSG_PEEK
MSG_PEEK is the constant syscall.MSG_PEEK
Variables ¶
This section is empty.
Functions ¶
func NewTCPListenerFile ¶
func NewTCPListenerFile(tl *net.TCPListener) socketapi.TCPSock
NewTCPListenerFile creates a socketapi.TCPSock for a given *net.TCPListener.
func OpenFSFile ¶
func OpenOSFile ¶
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 ReadFS ¶
Source Files
¶
- adapter.go
- datasync_linux.go
- dir.go
- dirfs.go
- file.go
- file_unix.go
- futimens.go
- futimens_linux.go
- ino_unix.go
- nonblock_unix.go
- oflag.go
- open_file_supported.go
- open_file_unix.go
- osfile.go
- poll.go
- poll_batch.go
- poll_linux.go
- readdir_linux.go
- readfs.go
- rename_unix.go
- sock.go
- sock_supported.go
- sock_unix.go
- stat.go
- stat_supported.go
- sync.go
- sysfs.go
- unlink_unix.go