ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

wasi:path_open

T1 wasm syscall syscall
WASI Preview 1 Syscall: path_open
SourceWASI Snapshot Preview 1 System Call Interface (WebAssembly/WASI) (wasi_syscalls)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeWASI Preview 1 (wasip1)
WebAssembly WASI Preview 1 (Wasmtime, WasmEdge, Wasmer, WAMR, Node.js)
License & VersionW3C Community CLA
wasi_snapshot_preview1
Upstreamhttps://github.com/WebAssembly/WASI/blob/wasi-0.1/preview1/witx/wasi_snapshot_preview1.witx
Privilegeguest->host
ExtensionsWASI, wasip1, wasi_snapshot_preview1

Summary

WASI wasi_snapshot_preview1 host syscall path_open. Open a file or directory. The returned file descriptor is not guaranteed to be the lowest-numbered file descriptor not currently open; it is randomized to prevent applications from depending on making assumptions about indexes, since this is error-prone in multi-threaded contexts. The returned file descriptor is guaranteed to be less than 2**31. Note: This is…

Syntax / Encoding

wasi_snapshot_preview1::path_open(fd: $fd, dirflags: $lookupflags, path: string, oflags: $oflags, fs_rights_base: $rights, fs_rights_inheriting: $rights, fdflags: $fdflags) -> (expected $fd (error $errno))

Operands

NameDescription
fdWASI parameter `fd` of type `$fd`
dirflagsFlags determining the method of how the path is resolved.
pathThe relative path of the file or directory to open, relative to the `path_open::fd` directory.
oflagsThe method by which to open the file.
fs_rights_baseThe initial rights of the newly created file descriptor. The implementation is allowed to return a file descriptor with fewer rights than specified, if and only if those rights do not apply to the type of file being opened. The *base* rights are rights that will apply to operations using the file descriptor itself, while the *inheriting* rights are rights that apply to file descriptors derived from it.
fs_rights_inheritingWASI parameter `fs_rights_inheriting` of type `$rights`
fdflagsWASI parameter `fdflags` of type `$fdflags`
errorThe file descriptor of the file that has been opened.