Read the value of a symlink
path_readlink (
dir_fd: i32The file descriptor representing the base directory from which the symlink is understoodpath: i32A wasm pointer to a null-terminated string containing the path to the symlinkpath_len: i32The length of the path stringbuf: i32A wasm pointer to a buffer where the target path of the symlink will be writtenbuf_len: i32The available space in the buffer pointed to by bufbuf_used: i32A wasm pointer to a variable where the number of bytes written to the buffer will be stored
) => The path_readlink() function reads the target path that a symlink points to. It requires the PATH_READLINK right to be set on the base directory from which the symlink is understood.
On POSIX systems, a similar functionality is provided by the readlink() function. It reads the value of a symbolic link and stores it in a buffer. The readlink() function is part of the POSIX standard and is widely supported across different platforms.
Note
The path_readlink() function reads the target path of a symlink. It checks if the base directory has the necessary rights and reads the target path accordingly. On POSIX systems, a similar functionality is provided by the readlink() function.