READLINK(2)
NAME
readlink − read value of a symbolic link
SYNOPSIS
readlink(path, buf, bufsiz)
char *path, *buf;
int bufsiz;
DESCRIPTION
Readlink obtains the path name pointed to by the symbolic link, path. This path name is placed in the buffer buf, which has size bufsiz. The path name is not null terminated when returned.
RETURN VALUE
If the call succeeds, it returns the count of characters placed in the buffer. If an error occurs, it returns a −1 and places the error code in the global variable errno.
ERRORS
Readlink will fail and the file mode will be unchanged if:
[ENOTDIR] A component of the path prefix is not a directory.
[ENAMETOOLONG]
A component of path exceeds NAME_MAX bytes while _POSIX_NO_TRUNC is in effect, or path exceeds PATH_MAX bytes.
[ENOENT] The named file does not exist.
[EACCES] Search permission is denied for a component of the path prefix.
[ELOOP] Too many symbolic links were encountered in translating the path name.
[EINVAL] The named file is not a symbolic link.
[EFAULT] Buf points outside the process’ allocated address space. Reliable detection of this error is implemenation dependent.
AUTHOR
Readlink was developed by the University of California, Berkeley.
SEE ALSO
stat(2), lstat(2), symlink(2), symlink(4).
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989