READLINK(2) BSD READLINK(2)
NAME
readlink - read value of a symbolic link
SYNOPSIS
cc = readlink(path, buf, bufsiz)
int cc;
char *path, *buf;
int bufsiz;
DESCRIPTION
readlink places the contents of the symbolic link named by path into the
buffer buf, which has size bufsiz. The contents of the link are not null
terminated when returned.
ERRORS
readlink will fail and the mode of the file named by path will be
unchanged if any of the following are true:
[ENOTDIR] A component of the path prefix is not a directory.
[ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an
entire path name exceeded 1023 characters.
[ENOENT] The named file does not exist.
[EACCES] Search permission is denied for a component of the path
prefix.
[ELOOP] The call encountered too many symbolic links in
translating the pathname.
[EINVAL] The named file is not a symbolic link.
[EIO] An I/O error occurred while reading from the file
system.
[EFAULT] buf extends outside the process' allocated address
space.
SEE ALSO
stat(2), lstat(2), symlink(2)
DIAGNOSTICS
A successful call returns the number of characters in buf. A failed call
returns -1 and sets errno as indicated under "Errors."
NOTES
The following error, not returned under Domain/OS BSD, may be returned
under other implementations:
[EINVAL] The pathname contains a character with the high-order
bit set.