authorgravatar for achan1989@gmail.comachan1989 <achan1989@gmail.com> 2024-10-06 09:44:52+01:00
committergravatar for achan1989@gmail.comachan1989 <achan1989@gmail.com> 2024-10-06 09:44:52+01:00
log1d8844dd5653d6496cbedbf75bdf8d367c16f690
tree50759255225e93c7e3ac786dcdb61bea82969a53
parent0d85284e4d5729c316f812c68004f3fa7847d9e2

Copy in WASI rights_t documentation


1 files changed, 42 insertions(+), 0 deletions(-)

lib/std/os/wasi.zig+42
...@@ -315,35 +315,77 @@ pub const SOCK = struct {...@@ -315,35 +315,77 @@ pub const SOCK = struct {
315};315};
316316
317pub const rights_t = packed struct(u64) {317pub const rights_t = packed struct(u64) {
318 /// The right to invoke fd_datasync. If PATH_OPEN is set, includes the right to invoke
319 /// path_open with fdflags_t.dsync.
318 FD_DATASYNC: bool = false,320 FD_DATASYNC: bool = false,
321 /// The right to invoke fd_read and sock_recv. If FD_SEEK is set, includes the right to invoke
322 /// fd_pread.
319 FD_READ: bool = false,323 FD_READ: bool = false,
324 /// The right to invoke fd_seek. This flag implies FD_TELL.
320 FD_SEEK: bool = false,325 FD_SEEK: bool = false,
326 /// The right to invoke fd_fdstat_set_flags.
321 FD_FDSTAT_SET_FLAGS: bool = false,327 FD_FDSTAT_SET_FLAGS: bool = false,
328 /// The right to invoke fd_sync. If PATH_OPEN is set, includes the right to invoke path_open
329 /// with fdflags_t.RSYNC and fdflags_t.DSYNC.
322 FD_SYNC: bool = false,330 FD_SYNC: bool = false,
331 /// The right to invoke fd_seek in such a way that the file offset remains unaltered (i.e.
332 /// whence_t.CUR with offset zero), or to invoke fd_tell.
323 FD_TELL: bool = false,333 FD_TELL: bool = false,
334 /// The right to invoke fd_write and sock_send. If FD_SEEK is set, includes the right to invoke
335 /// fd_pwrite.
324 FD_WRITE: bool = false,336 FD_WRITE: bool = false,
337 /// The right to invoke fd_advise.
325 FD_ADVISE: bool = false,338 FD_ADVISE: bool = false,
339 /// The right to invoke fd_allocate.
326 FD_ALLOCATE: bool = false,340 FD_ALLOCATE: bool = false,
341 /// The right to invoke path_create_directory.
327 PATH_CREATE_DIRECTORY: bool = false,342 PATH_CREATE_DIRECTORY: bool = false,
343 /// If PATH_OPEN is set, the right to invoke path_open with oflags_t.CREAT.
328 PATH_CREATE_FILE: bool = false,344 PATH_CREATE_FILE: bool = false,
345 /// The right to invoke path_link with the file descriptor as the source directory.
329 PATH_LINK_SOURCE: bool = false,346 PATH_LINK_SOURCE: bool = false,
347 /// The right to invoke path_link with the file descriptor as the target directory.
330 PATH_LINK_TARGET: bool = false,348 PATH_LINK_TARGET: bool = false,
349 /// The right to invoke path_open.
331 PATH_OPEN: bool = false,350 PATH_OPEN: bool = false,
351 /// The right to invoke fd_readdir.
332 FD_READDIR: bool = false,352 FD_READDIR: bool = false,
353 /// The right to invoke path_readlink.
333 PATH_READLINK: bool = false,354 PATH_READLINK: bool = false,
355 /// The right to invoke path_rename with the file descriptor as the source directory.
334 PATH_RENAME_SOURCE: bool = false,356 PATH_RENAME_SOURCE: bool = false,
357 /// The right to invoke path_rename with the file descriptor as the target directory.
335 PATH_RENAME_TARGET: bool = false,358 PATH_RENAME_TARGET: bool = false,
359 /// The right to invoke path_filestat_get.
336 PATH_FILESTAT_GET: bool = false,360 PATH_FILESTAT_GET: bool = false,
361 /// The right to change a file's size. If PATH_OPEN is set, includes the right to invoke
362 /// path_open with oflags_t.TRUNC. Note: there is no function named path_filestat_set_size.
363 /// This follows POSIX design, which only has ftruncate and does not provide ftruncateat. While
364 /// such function would be desirable from the API design perspective, there are virtually no
365 /// use cases for it since no code written for POSIX systems would use it. Moreover,
366 /// implementing it would require multiple syscalls, leading to inferior performance.
337 PATH_FILESTAT_SET_SIZE: bool = false,367 PATH_FILESTAT_SET_SIZE: bool = false,
368 /// The right to invoke path_filestat_set_times.
338 PATH_FILESTAT_SET_TIMES: bool = false,369 PATH_FILESTAT_SET_TIMES: bool = false,
370 /// The right to invoke fd_filestat_get.
339 FD_FILESTAT_GET: bool = false,371 FD_FILESTAT_GET: bool = false,
372 /// The right to invoke fd_filestat_set_size.
340 FD_FILESTAT_SET_SIZE: bool = false,373 FD_FILESTAT_SET_SIZE: bool = false,
374 /// The right to invoke fd_filestat_set_times.
341 FD_FILESTAT_SET_TIMES: bool = false,375 FD_FILESTAT_SET_TIMES: bool = false,
376 /// The right to invoke path_symlink.
342 PATH_SYMLINK: bool = false,377 PATH_SYMLINK: bool = false,
378 /// The right to invoke path_remove_directory.
343 PATH_REMOVE_DIRECTORY: bool = false,379 PATH_REMOVE_DIRECTORY: bool = false,
380 /// The right to invoke path_unlink_file.
344 PATH_UNLINK_FILE: bool = false,381 PATH_UNLINK_FILE: bool = false,
382 /// If FD_READ is set, includes the right to invoke poll_oneoff to subscribe to
383 /// eventtype_t.FD_READ. If FD_WRITE is set, includes the right to invoke poll_oneoff to
384 /// subscribe to eventtype_t.FD_WRITE.
345 POLL_FD_READWRITE: bool = false,385 POLL_FD_READWRITE: bool = false,
386 /// The right to invoke sock_shutdown.
346 SOCK_SHUTDOWN: bool = false,387 SOCK_SHUTDOWN: bool = false,
388 /// The right to invoke sock_accept.
347 SOCK_ACCEPT: bool = false,389 SOCK_ACCEPT: bool = false,
348 _: u34 = 0,390 _: u34 = 0,
349};391};