readlink(2) - Linux man page
Name
readlink - read value of a symbolic linkSynopsis
#include <unistd.h>ssize_t readlink(const char *path, char *buf, size_t bufsiz);
Description
Return Value
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 errno.Errors
- EACCES
- Search permission is denied for a component of the path prefix. (See also path_resolution(2).)
- EFAULT
- buf extends outside the process's allocated address space.
- EINVAL
- bufsiz is not positive.
- EINVAL
- The named file is not a symbolic link.
- EIO
- An I/O error occurred while reading from the file system.
- ELOOP
- Too many symbolic links were encountered in translating the pathname.
- ENAMETOOLONG
- A pathname, or a component of a pathname, was too long.
- ENOENT
- The named file does not exist.
- ENOMEM
- Insufficient kernel memory was available.
- ENOTDIR
- A component of the path prefix is not a directory.
