readlink()

NAME

readlink () - read the contents of a symbolic link

SYNOPSIS

#include <unistd.h>

int readlink(const char *path, char *buf, size_t bufsize)

DESCRIPTION

The readlink(2) function stores the contents of the symbolic link file path in the buffer buf, which is of size bufsize. On INTERIX, the contents of buf are null-terminated, though portable programs should not assume this is so.

If the symlink data are longer than bufsiz, then only the first bufsiz bytes of the symlink data are written into the buffer, and the value bufsiz is returned; errno is not set.

However, if you lstat(2) the symbolic link, then the st_size field is set to the total number of bytes of symlink data.

RETURN VALUE

On success, the readlink(2) call returns the number of bytes stored in bufsize; otherwise it returns -1 and sets errno.

ERRORS

The readlink(2) call can fail for the following reasons:

[EACCES]
Process does not have permission to search some directory in the path.
[EINVAL]
The path is not a symbolic link file, or the file is on a device that does not support the operation.
[EIO]
An I/O error occurred while reading from the filesystem.
[ENOENT]
Either path is an empty string or some component of path does not exist.
[ELOOP]
Too many symbolic links were encountered in resolving path.
[ENAMETOOLONG]
The path is longer than {PATH_MAX} or some component of path is longer than {NAME_MAX}, or the pathname resolution of a symbolic link produced some intermediate result that was longer than {PATH_MAX}.
[ENOTDIR]
Some component of the prefix in path is not a directory.

SEE ALSO

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.