Skip to content

Commit 8d6703a

Browse files
authored
Document behaviour of path_readlink when buf is too small (#554)
`readlink` and `readlinkat` in POSIX specify that if the buffer is too small to contain the link content, the first `buf_len` bytes will be written. We already state the behaviour of this function is similar to `readlinkat` but explicitly clarifying this case removes any ambiguity.
1 parent 60cff31 commit 8d6703a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

legacy/preview1/witx/wasi_snapshot_preview1.witx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,9 @@
386386
)
387387

388388
;;; Read the contents of a symbolic link.
389-
;;; Note: This is similar to `readlinkat` in POSIX.
389+
;;; Note: This is similar to `readlinkat` in POSIX. If `buf` is not large
390+
;;; enough to contain the contents of the link, the first `buf_len` bytes will be
391+
;;; be written to `buf`.
390392
(@interface func (export "path_readlink")
391393
(param $fd $fd)
392394
;;; The path of the symbolic link from which to read.

0 commit comments

Comments
 (0)