| ... | ... | @@ -315,35 +315,77 @@ pub const SOCK = struct { |
| 315 | 315 | }; |
| 316 | 316 | |
| 317 | 317 | pub 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 | 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 | 323 | FD_READ: bool = false, |
| 324 | /// The right to invoke fd_seek. This flag implies FD_TELL. |
| 320 | 325 | FD_SEEK: bool = false, |
| 326 | /// The right to invoke fd_fdstat_set_flags. |
| 321 | 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 | 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 | 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 | 336 | FD_WRITE: bool = false, |
| 337 | /// The right to invoke fd_advise. |
| 325 | 338 | FD_ADVISE: bool = false, |
| 339 | /// The right to invoke fd_allocate. |
| 326 | 340 | FD_ALLOCATE: bool = false, |
| 341 | /// The right to invoke path_create_directory. |
| 327 | 342 | PATH_CREATE_DIRECTORY: bool = false, |
| 343 | /// If PATH_OPEN is set, the right to invoke path_open with oflags_t.CREAT. |
| 328 | 344 | PATH_CREATE_FILE: bool = false, |
| 345 | /// The right to invoke path_link with the file descriptor as the source directory. |
| 329 | 346 | PATH_LINK_SOURCE: bool = false, |
| 347 | /// The right to invoke path_link with the file descriptor as the target directory. |
| 330 | 348 | PATH_LINK_TARGET: bool = false, |
| 349 | /// The right to invoke path_open. |
| 331 | 350 | PATH_OPEN: bool = false, |
| 351 | /// The right to invoke fd_readdir. |
| 332 | 352 | FD_READDIR: bool = false, |
| 353 | /// The right to invoke path_readlink. |
| 333 | 354 | PATH_READLINK: bool = false, |
| 355 | /// The right to invoke path_rename with the file descriptor as the source directory. |
| 334 | 356 | PATH_RENAME_SOURCE: bool = false, |
| 357 | /// The right to invoke path_rename with the file descriptor as the target directory. |
| 335 | 358 | PATH_RENAME_TARGET: bool = false, |
| 359 | /// The right to invoke path_filestat_get. |
| 336 | 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 | 367 | PATH_FILESTAT_SET_SIZE: bool = false, |
| 368 | /// The right to invoke path_filestat_set_times. |
| 338 | 369 | PATH_FILESTAT_SET_TIMES: bool = false, |
| 370 | /// The right to invoke fd_filestat_get. |
| 339 | 371 | FD_FILESTAT_GET: bool = false, |
| 372 | /// The right to invoke fd_filestat_set_size. |
| 340 | 373 | FD_FILESTAT_SET_SIZE: bool = false, |
| 374 | /// The right to invoke fd_filestat_set_times. |
| 341 | 375 | FD_FILESTAT_SET_TIMES: bool = false, |
| 376 | /// The right to invoke path_symlink. |
| 342 | 377 | PATH_SYMLINK: bool = false, |
| 378 | /// The right to invoke path_remove_directory. |
| 343 | 379 | PATH_REMOVE_DIRECTORY: bool = false, |
| 380 | /// The right to invoke path_unlink_file. |
| 344 | 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 | 385 | POLL_FD_READWRITE: bool = false, |
| 386 | /// The right to invoke sock_shutdown. |
| 346 | 387 | SOCK_SHUTDOWN: bool = false, |
| 388 | /// The right to invoke sock_accept. |
| 347 | 389 | SOCK_ACCEPT: bool = false, |
| 348 | 390 | _: u34 = 0, |
| 349 | 391 | }; |