|READLINK(2)||System Calls Manual||READLINK(2)|
readlinkat — read value of a
char *restrict path, char
*restrict buf, size_t
fd, const char
*path, char *buf,
readlink() function places the
contents of the symbolic link path in the buffer
buf, which has size bufsiz.
readlink() does not append a
NUL character to buf.
readlinkat() function is equivalent to
readlink() except that where
path specifies a relative path, the symbolic link
whose contents are read is determined relative to the directory associated
with file descriptor fd instead of the current working
readlinkat() is passed the special
AT_FDCWD (defined in
<fcntl.h>) in the
fd parameter, the current working directory is used
and the behavior is identical to a call to
The call returns the count of characters placed in the buffer if it succeeds, or a -1 if an error occurs, placing the error code in the global variable errno.
readlinkat() will fail if:
NAME_MAXcharacters, or an entire pathname (including the terminating NUL) exceeded
readlinkat() will fail
AT_FDCWDnor a valid file descriptor.
readlinkat() functions conform to
IEEE Std 1003.1-2008 (“POSIX.1”).
readlink() system call first appeared
in 4.1cBSD. The
system call has been available since OpenBSD
|May 31, 2015||OpenBSD-current|