READLINK(2) COMMAND REFERENCE 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 path in
the buffer buf which has size bufsiz. Cc, the number of
characters copied into buf, is returned. Only bufsiz bytes
are copied; if the contents of the link named by path are
longer than bufsiz, buf will contain a truncated copy of the
contents of the symbolic link.
DIAGNOSTICS
Readlink will fail and the file mode will be unchanged if:
[ENOASCII]
The path argument contains a byte with the high-order
bit set.
[ENAMETOOLONG]
The pathname is too long.
[ENOTDIR]
A component of the path prefix is not a directory.
[ENOENT]
The named file does not exist.
[EACCES]
Search permission is denied on a component of the path
prefix. If the file is located on a remote host, this
error code will be returned if the local host name and
local user name does not appear in /usr/lib/dfs/access
on the remote machine. See access(dfs)(5n).
[EINVAL]
The named file path is not a symbolic link.
[EFAULT]
Buf extends outside the process's allocated address
space.
[ELOOP]
Too many symbolic links were encountered in translating
the pathname.
[EIO]
Printed 10/17/86 1
READLINK(2) COMMAND REFERENCE READLINK(2)
An I/O error occurred while reading from the file
system.
[EDFSNOSUCHHOST]
The pathname referenced a remote host, but when we
broadcast a request for its address, no host responded.
RETURN VALUE
The call returns in cc 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.
SEE ALSO
lstat(2), stat(2), symlink(2).
Printed 10/17/86 2
%%index%%
na:72,76;
sy:148,503;
de:651,556;
di:1207,1138;2489,225;
rv:2714,274;
se:2988,163;
%%index%%000000000116