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
Create a hard link
path_link (
old_fd: i32fd: i32The file descriptor representing the directory that the old_path is relative toold_flags: i32Flags to control how the old_path is understoodold_path: i32A wasm pointer to a null-terminated string containing the old file pathold_path_len: i32The length of the old_path stringnew_fd: i32The file descriptor representing the directory that the new_path is relative tonew_path: i32A wasm pointer to a null-terminated string containing the new file pathnew_path_len: i32The length of the new_path string
) =>
error: i32 

WARNING: I think this documentation from wasmer may be incorrect, based on the implementation details in wasix-libc

The path_link() function creates a hard link between two files. It creates a new directory entry with the specified name in the destination directory, which refers to the same underlying file as the source file.

On POSIX systems, a similar functionality is provided by the link() function. It creates a new link (directory entry) for an existing file. The new link and the original file refer to the same inode and share the same content.

Note

The path_link() function creates a hard link between two files. It checks if the necessary rights are present on both the source and target directories. It then creates a new directory entry in the target directory with the specified name, linking it to the source file.

On POSIX systems, a similar functionality is provided by the link() function.

Read More