Bump to 1.14.1
[platform/upstream/augeas.git] / doc / posix-functions / readlinkat.texi
1 @node readlinkat
2 @section @code{readlinkat}
3 @findex readlinkat
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/readlinkat.html}
6
7 Gnulib module: readlinkat
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function is missing on some platforms:
13 glibc 2.3.6, Mac OS X < 10.10, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8,
14 AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, MSVC 9, Interix 3.5, BeOS.
15 But the replacement function is not safe to be used in libraries and is not multithread-safe.
16 @item
17 Some platforms mistakenly succeed on @code{readlink("link/",buf,len)}:
18 Mac OS X 10.10.
19 @item
20 On some platforms, @code{readlinkat} returns @code{int} instead of
21 @code{ssize_t}:
22 AIX 7.1.
23 @item
24 @end itemize
25
26 Portability problems not fixed by Gnulib:
27 @itemize
28 @item
29 This function always fails on platforms that don't support symlinks:
30 mingw, MSVC 9.
31 @item
32 When @code{readlink} is called on a directory: In the case of NFS mounted
33 directories, Cygwin sets @code{errno} to @code{ENOENT} or @code{EIO} instead of
34 @code{EINVAL}.  To avoid this problem, check for a directory before calling
35 @code{readlink}.
36 @item
37 When @code{readlink} is called on a file that is not a symbolic link:
38 Irix may set @code{errno} to @code{ENXIO} instead of @code{EINVAL}.  Cygwin
39 may set errno to @code{EACCES} instead of @code{EINVAL}.
40 @item
41 Symlink contents do not always have a trailing null byte, and there is
42 no indication if symlink contents were truncated if the return value
43 matches the length.  Furthermore, AIX 5.1 and HP-UX 11 set
44 @code{errno} to @code{ERANGE} rather than returning truncated
45 contents, and Linux sets @code{errno} to @code{EINVAL} if the
46 requested length is zero.  Use the gnulib module areadlink for
47 improved ability to read symlink contents.
48 @end itemize