readlink: fix cygwin 1.5.x bug with return type
[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 On some platforms, @code{readlink} returns @code{int} instead of
13 @code{ssize_t}:
14 FreeBSD 6.0, OpenBSD 3.8, Cygwin 1.5.x.
15 @item
16 This function is missing on some platforms:
17 mingw.
18 @end itemize
19
20 Portability problems not fixed by Gnulib:
21 @itemize
22 @item
23 When @code{readlink} is called on a directory: In the case of NFS mounted
24 directories, Cygwin sets @code{errno} to @code{ENOENT} or @code{EIO} instead of
25 @code{EINVAL}.  To avoid this problem, check for a directory before calling
26 @code{readlink}.
27 @item
28 When @code{readlink} is called on a file that is not a symbolic link:
29 Irix may set @code{errno} to @code{ENXIO} instead of @code{EINVAL}.  Cygwin
30 may set errno to @code{EACCES} instead of @code{EINVAL}.
31 @end itemize