avoid some overlong lines from posix urls, etc.
[gnulib.git] / doc / posix-functions / readlink.texi
1 @node readlink
2 @section @code{readlink}
3 @findex readlink
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/readlink.html}
6
7 Gnulib module: readlink
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 Some platforms mistakenly succeed on @code{readlink("link/",buf,len)}:
13 FreeBSD 7.2, Solaris 9.
14 @item
15 On some platforms, @code{readlink} returns @code{int} instead of
16 @code{ssize_t}:
17 FreeBSD 6.0, OpenBSD 3.8, Cygwin 1.5.x.
18 @item
19 This function is missing on some platforms:
20 mingw.
21 @end itemize
22
23 Portability problems not fixed by Gnulib:
24 @itemize
25 @item
26 When @code{readlink} is called on a directory: In the case of NFS mounted
27 directories, Cygwin sets @code{errno} to @code{ENOENT} or @code{EIO} instead of
28 @code{EINVAL}.  To avoid this problem, check for a directory before calling
29 @code{readlink}.
30 @item
31 When @code{readlink} is called on a file that is not a symbolic link:
32 Irix may set @code{errno} to @code{ENXIO} instead of @code{EINVAL}.  Cygwin
33 may set errno to @code{EACCES} instead of @code{EINVAL}.
34 @item
35 Symlink contents do not always have a trailing null byte, and there is
36 no indication if symlink contents were truncated if the return value
37 matches the length.  Furthermore, AIX 5.1 and HP-UX 11 set
38 @code{errno} to @code{ERANGE} rather than returning truncated
39 contents, and Linux sets @code{errno} to @code{EINVAL} if the
40 requested length is zero.  Use the gnulib module areadlink for
41 improved ability to read symlink contents.
42 @end itemize