Index wasi args_get args_sizes_get clock_res_get clock_time_get environ_get environ_sizes_get fd_advise fd_allocate fd_close fd_datasync fd_fdstat_get fd_fdstat_set_flags fd_fdstat_set_rights fd_filestat_get fd_filestat_set_size fd_filestat_set_times fd_pread fd_prestat_dir_name fd_prestat_get fd_pwrite fd_read fd_readdir fd_renumber fd_seek fd_sync fd_tell fd_write file_stat_flags filestat iovec lookup_flags path_create_directory path_filestat_get path_filestat_set_times path_link path_open path_readlink path_remove_directory path_rename path_symlink path_unlink_file poll_oneoff proc_exit proc_raise random_get sched_yield sock_accept sock_recv sock_send sock_shutdown
Set the rights of a file descriptor. This can only be used to remove rights
fd_fdstat_set_rights (
ctx: i32A mutable reference to the function environmentfd: i32The file descriptor to apply the new rights tofs_rights_base: i32The base rights to apply to the file descriptorfs_rights_inheriting: i32The inheriting rights to apply to the file descriptor
) =>
error: i32 

The fd_fdstat_set_rights() function is used to set the rights of a file descriptor. It allows modifying the access rights associated with the file descriptor by applying new rights or removing existing rights.

In POSIX systems, file descriptors are associated with access rights that define the operations that can be performed on the file or resource represented by the descriptor. These access rights control actions such as reading, writing, or seeking within the file. The fd_fdstat_set_rights() function enables applications to modify the access rights associated with a file descriptor, restricting or expanding the available operations.

Note

The fd_fdstat_set_rights() function is used to modify the access rights associated with a file descriptor. It allows applications to set or remove rights from the file descriptor. However, it can only be used to remove rights, not add new ones.

Please note that when setting new rights, they must be a subset of the current rights. If any of the new rights are not included in the current rights, the function will return Errno::Notcapable.

Read More