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 BindFS(fs sys.FS) (sys.FS, io.Closer)
- 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 DirHandle
- type LutimensFS
- type ReadFS
- func (r *ReadFS) Chmod(path string, perm fs.FileMode) sys.Errno
- func (r *ReadFS) Link(_, _ string) sys.Errno
- func (r *ReadFS) Lutimens(string, int64, int64) 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 BindFS ¶ added in v0.6.0
BindFS returns fs as one module instance uses it, and what releases it when the instance is done, or nil when nothing needs to. A DirFS, bare or behind a ReadFS, gets its own handle on its directory.
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 DirHandle ¶ added in v0.6.0
type DirHandle interface {
// DirFS returns the directory as a filesystem rooted at it, which the
// file owns and closes with it.
DirFS() (sys.FS, sys.Errno)
}
DirHandle is an open directory that paths can be resolved through, so they reach it wherever it has been renamed to since it was opened.
type LutimensFS ¶ added in v0.6.0
LutimensFS is a sys.FS that sets the times of a symlink itself, where Utimens sets those of what it points to.
type ReadFS ¶
Source Files
¶
- adapter.go
- datasync_linux.go
- dir.go
- dirfs.go
- dirfs_beneath_linux.go
- dirfs_fstatat_linux.go
- dirfs_lutimens.go
- dirfs_lutimens_unix.go
- dirfs_name.go
- dirfs_nofollow.go
- dirfs_root.go
- dirhandle_linux.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
- sock.go
- sock_supported.go
- sock_unix.go
- stat.go
- stat_supported.go
- stat_time_posix.go
- sync.go
- sysfs.go