interface virtual-file-system-wasip1-core {
resource wasip1 {
environ-sizes-get-import: static func(environ-count-ptr: s32, environ-size-ptr: s32) -> s32;
environ-get-import: static func(environ-ptr-ptr: s32, environ-buf-ptr: s32) -> s32;
proc-exit-import: static func(code: s32);
proc-raise-import: static func(sig: s32) -> s32;
random-get-import: static func(buf-ptr: s32, buf-len: s32) -> s32;
sched-yield-import: static func() -> s32;
clock-time-get-import: static func(id: s32, precision: s64, timestamp-ptr: s32) -> s32;
clock-res-get-import: static func(id: s32, timestamp-ptr: s32) -> s32;
// https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#-fd_readdirfd-fd-buf-pointeru8-buf_len-size-cookie-dircookie---resultsize-errno
fd-advise-import: static func(fd: s32, offset: s64, len: s64, advice: s8) -> s32;
fd-allocate-import: static func(fd: s32, offset: s64, len: s64) -> s32;
fd-datasync-import: static func(fd: s32) -> s32;
fd-fdstat-get-import: static func(fd: s32, fdstat-ptr: s32) -> s32;
fd-fdstat-set-flags-import: static func(fd: s32, fdflags: s16) -> s32;
fd-fdstat-set-rights-import: static func(fd: s32, fs-rights-base: s64, fs-rights-inheriting: s64) -> s32;
fd-write-import: static func(fd: s32, iovs-ptr: s32, iovs-len: s32, written-ptr: s32) -> s32;
fd-pwrite-import: static func(fd: s32, iovs-ptr: s32, iovs-len: s32, offset: s64, written-ptr: s32) -> s32;
fd-readdir-import: static func(fd: s32, buf-ptr: s32, buf-len: s32, cookie: s64, buf-used-ptr: s32) -> s32;
fd-close-import: static func(fd: s32) -> s32;
fd-prestat-get-import: static func(fd: s32, prestat-ptr: s32) -> s32;
fd-prestat-dir-name-import: static func(fd: s32, path-ptr: s32, path-len: s32) -> s32;
fd-filestat-get-import: static func(fd: s32, filestat-ptr: s32) -> s32;
fd-read-import: static func(fd: s32, iovs-ptr: s32, iovs-len: s32, nread-ptr: s32) -> s32;
fd-pread-import: static func(fd: s32, iovs-ptr: s32, iovs-len: s32, offset: s64, nread-ptr: s32) -> s32;
fd-filestat-set-size-import: static func(fd: s32, size: s64) -> s32;
fd-filestat-set-times-import: static func(fd: s32, atim: s64, mtim: s64, fst-flags: s16) -> s32;
fd-renumber-import: static func(fd: s32, new-fd: s32) -> s32;
fd-seek-import: static func(fd: s32, offset: s64, whence: s8, new-offset-ptr: s32) -> s32;
fd-sync-import: static func(fd: s32) -> s32;
fd-tell-import: static func(fd: s32, offset-ptr: s32) -> s32;
path-open-import: static func(
fd: s32,
dirflags: s32,
path-ptr: s32,
path-len: s32,
oflags: s32,
fs-rights-base: s64,
fs-rights-inheriting: s64,
fdflags: s32,
fd-out-ptr: s32
) -> s32;
path-create-directory-import: static func(fd: s32, path-ptr: s32, path-len: s32) -> s32;
path-filestat-get-import: static func(fd: s32, lookupflags: s32, path-ptr: s32, path-len: s32, filestat-ptr: s32) -> s32;
path-filestat-set-times-import: static func(fd: s32, lookupflags: s32, path-ptr: s32, path-len: s32, atim: s64, mtim: s64, fst-flags: s16) -> s32;
path-link-import: static func(
old-fd: s32,
old-flags: s32,
old-path-ptr: s32,
old-path-len: s32,
new-fd: s32,
new-path-ptr: s32,
new-path-len: s32
) -> s32;
path-readlink-import: static func(fd: s32, path-ptr: s32, path-len: s32, buf-ptr: s32, buf-len: s32, buf-used-ptr: s32) -> s32;
path-remove-directory-import: static func(fd: s32, path-ptr: s32, path-len: s32) -> s32;
path-rename-import: static func(
old-fd: s32,
old-path-ptr: s32,
old-path-len: s32,
new-fd: s32,
new-path-ptr: s32,
new-path-len: s32
) -> s32;
path-symlink-import: static func(
old-path-ptr: s32,
old-path-len: s32,
fd: s32,
new-path-ptr: s32,
new-path-len: s32
) -> s32;
path-unlink-file-import: static func(fd: s32, path-ptr: s32, path-len: s32) -> s32;
poll-oneoff-import: static func(
subscription-ptr: s32,
results-ptr: s32,
n-subscriptions: s32,
stored-ptr: s32
) -> s32;
args-get-import: static func(args-ptr-ptr: s32, args-buf-ptr: s32) -> s32;
args-sizes-get-import: static func(args-count-ptr: s32, args-size-ptr: s32) -> s32;
sock-accept-import: static func(fd: s32, fdflags: s16, socket-fd-ptr: s32) -> s32;
sock-recv-import: static func(fd: s32, receiver-ptr: s32, receiver-len: s32, ri-flags: s16, nread-ptr: s32, ro-flags: s16) -> s32;
sock-send-import: static func(fd: s32, sender-ptr: s32, sender-len: s32, si-flags: s16, nwritten-ptr: s32) -> s32;
sock-shutdown-import: static func(fd: s32, how: s8) -> s32;
}
}