Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

rights_t

Public Struct
std.os.wasi.rights_t
pub const rights_t = packed struct(u64)

Fields

FD_DATASYNC: bool = false

The right to invoke fd_datasync. If PATH_OPEN is set, includes the right to invoke path_open with fdflags_t.dsync.

FD_READ: bool = false

The right to invoke fd_read and sock_recv. If FD_SEEK is set, includes the right to invoke fd_pread.

FD_SEEK: bool = false

The right to invoke fd_seek. This flag implies FD_TELL.

FD_FDSTAT_SET_FLAGS: bool = false

The right to invoke fd_fdstat_set_flags.

FD_SYNC: bool = false

The right to invoke fd_sync. If PATH_OPEN is set, includes the right to invoke path_open with fdflags_t.RSYNC and fdflags_t.DSYNC.

FD_TELL: bool = false

The right to invoke fd_seek in such a way that the file offset remains unaltered (i.e. whence_t.CUR with offset zero), or to invoke fd_tell.

FD_WRITE: bool = false

The right to invoke fd_write and sock_send. If FD_SEEK is set, includes the right to invoke fd_pwrite.

FD_ADVISE: bool = false

The right to invoke fd_advise.

FD_ALLOCATE: bool = false

The right to invoke fd_allocate.

PATH_CREATE_DIRECTORY: bool = false

The right to invoke path_create_directory.

PATH_CREATE_FILE: bool = false

If PATH_OPEN is set, the right to invoke path_open with oflags_t.CREAT.

PATH_LINK_SOURCE: bool = false

The right to invoke path_link with the file descriptor as the source directory.

PATH_LINK_TARGET: bool = false

The right to invoke path_link with the file descriptor as the target directory.

PATH_OPEN: bool = false

The right to invoke path_open.

FD_READDIR: bool = false

The right to invoke fd_readdir.

PATH_READLINK: bool = false

The right to invoke path_readlink.

PATH_RENAME_SOURCE: bool = false

The right to invoke path_rename with the file descriptor as the source directory.

PATH_RENAME_TARGET: bool = false

The right to invoke path_rename with the file descriptor as the target directory.

PATH_FILESTAT_GET: bool = false

The right to invoke path_filestat_get.

PATH_FILESTAT_SET_SIZE: bool = false

The right to change a file's size. If PATH_OPEN is set, includes the right to invoke path_open with oflags_t.TRUNC. Note: there is no function named path_filestat_set_size. This follows POSIX design, which only has ftruncate and does not provide ftruncateat. While such function would be desirable from the API design perspective, there are virtually no use cases for it since no code written for POSIX systems would use it. Moreover, implementing it would require multiple syscalls, leading to inferior performance.

PATH_FILESTAT_SET_TIMES: bool = false

The right to invoke path_filestat_set_times.

FD_FILESTAT_GET: bool = false

The right to invoke fd_filestat_get.

FD_FILESTAT_SET_SIZE: bool = false

The right to invoke fd_filestat_set_size.

FD_FILESTAT_SET_TIMES: bool = false

The right to invoke fd_filestat_set_times.

PATH_SYMLINK: bool = false

The right to invoke path_symlink.

PATH_REMOVE_DIRECTORY: bool = false

The right to invoke path_remove_directory.

PATH_UNLINK_FILE: bool = false

The right to invoke path_unlink_file.

POLL_FD_READWRITE: bool = false

If FD_READ is set, includes the right to invoke poll_oneoff to subscribe to eventtype_t.FD_READ. If FD_WRITE is set, includes the right to invoke poll_oneoff to subscribe to eventtype_t.FD_WRITE.

SOCK_SHUTDOWN: bool = false

The right to invoke sock_shutdown.

SOCK_ACCEPT: bool = false

The right to invoke sock_accept.

_: u34 = 0

File

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