summaryrefslogtreecommitdiff
path: root/doc/ref
diff options
context:
space:
mode:
authorMaxime Devos <maximedevos@telenet.be>2021-11-16 11:06:25 +0000
committerLudovic Courtès <ludo@gnu.org>2022-10-21 17:39:38 +0200
commit30247dc414fb38329f580b1d41abbe202285adbe (patch)
tree65ba8b4cbd3ef778c6b58fefabfe553bb53b38e0 /doc/ref
parent273bfe7510da8ab740e65df11b72d9bb801885f3 (diff)
downloadguile-30247dc414fb38329f580b1d41abbe202285adbe.tar.gz
Allow file ports in ‘readlink’.
* configure.ac: Detect whether ‘readlinkat’ is defined. * libguile/filesys.c (scm_readlink): Support file ports when ‘readlinkat’ exists. (scm_init_filesys): Provide ‘chdir-ports’ when it exists. * doc/ref/posix.texi (File System): Document it. * test-suite/tests/filesys.test ("readlink"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/ref')
-rw-r--r--doc/ref/posix.texi9
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index ed6c30c9f..d2344d400 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -775,8 +775,13 @@ file it points to. @var{path} must be a string.
@deffn {Scheme Procedure} readlink path
@deffnx {C Function} scm_readlink (path)
-Return the value of the symbolic link named by @var{path} (a
-string), i.e., the file that the link points to.
+Return the value of the symbolic link named by @var{path} (a string, or
+a port if supported by the system), i.e., the file that the link points
+to.
+
+To read a symbolic link represented by a port, the symbolic link must
+have been opened with the @code{O_NOFOLLOW} and @code{O_PATH} flags.
+@code{(provided? 'readlink-port)} reports whether ports are supported.
@end deffn
@findex fchown