@@ -315,35 +315,77 @@ pub const SOCK = struct {
315315};
316316
317317pub 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.
318320 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.
319323 FD_READ : bool = false ,
324+ /// The right to invoke fd_seek. This flag implies FD_TELL.
320325 FD_SEEK : bool = false ,
326+ /// The right to invoke fd_fdstat_set_flags.
321327 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.
322330 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.
323333 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.
324336 FD_WRITE : bool = false ,
337+ /// The right to invoke fd_advise.
325338 FD_ADVISE : bool = false ,
339+ /// The right to invoke fd_allocate.
326340 FD_ALLOCATE : bool = false ,
341+ /// The right to invoke path_create_directory.
327342 PATH_CREATE_DIRECTORY : bool = false ,
343+ /// If PATH_OPEN is set, the right to invoke path_open with oflags_t.CREAT.
328344 PATH_CREATE_FILE : bool = false ,
345+ /// The right to invoke path_link with the file descriptor as the source directory.
329346 PATH_LINK_SOURCE : bool = false ,
347+ /// The right to invoke path_link with the file descriptor as the target directory.
330348 PATH_LINK_TARGET : bool = false ,
349+ /// The right to invoke path_open.
331350 PATH_OPEN : bool = false ,
351+ /// The right to invoke fd_readdir.
332352 FD_READDIR : bool = false ,
353+ /// The right to invoke path_readlink.
333354 PATH_READLINK : bool = false ,
355+ /// The right to invoke path_rename with the file descriptor as the source directory.
334356 PATH_RENAME_SOURCE : bool = false ,
357+ /// The right to invoke path_rename with the file descriptor as the target directory.
335358 PATH_RENAME_TARGET : bool = false ,
359+ /// The right to invoke path_filestat_get.
336360 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.
337367 PATH_FILESTAT_SET_SIZE : bool = false ,
368+ /// The right to invoke path_filestat_set_times.
338369 PATH_FILESTAT_SET_TIMES : bool = false ,
370+ /// The right to invoke fd_filestat_get.
339371 FD_FILESTAT_GET : bool = false ,
372+ /// The right to invoke fd_filestat_set_size.
340373 FD_FILESTAT_SET_SIZE : bool = false ,
374+ /// The right to invoke fd_filestat_set_times.
341375 FD_FILESTAT_SET_TIMES : bool = false ,
376+ /// The right to invoke path_symlink.
342377 PATH_SYMLINK : bool = false ,
378+ /// The right to invoke path_remove_directory.
343379 PATH_REMOVE_DIRECTORY : bool = false ,
380+ /// The right to invoke path_unlink_file.
344381 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.
345385 POLL_FD_READWRITE : bool = false ,
386+ /// The right to invoke sock_shutdown.
346387 SOCK_SHUTDOWN : bool = false ,
388+ /// The right to invoke sock_accept.
347389 SOCK_ACCEPT : bool = false ,
348390 _ : u34 = 0 ,
349391};
0 commit comments