readlink(S)
readlink --
reads a symbolic link
Syntax
cc . . . -lc
int readlink (path, buf, bufsiz)
char *path, *buf;
int bufsiz;
Description
The readlink function reads a symbolic link previously
created by a call to
symlink(S).
readlink places the contents of the symbolic link
referred to by path in the buf buffer, which
has the size bufsiz. The contents of the link are not
null terminated when returned.
This routine fails and the buffer is unchanged if one or more of
the following is true:
[EACCES]-
Search permission is denied for a component of the oath
prefix.
[EFAULT]-
path or buf extends outside the process's
allocated address space.
[EINVAL]-
The named file is not a symbolic link.
[EIO]-
An I/O error occurred while reading from or writing to
the filesystem.
[ELOOP]-
Too many symbolic links were encountered in translating
path.
[ENAMETOOLONG]-
The length of a component of path exceeds 255
characters or the length of path exceeds 1023
characters.
[ENOENT]-
The named file does not exist.
Return value
The count of characters placed in the buffer is returned if the
call succeeds, or -1 is returned if an error occurs, and the
error value is placed in errno.
See also
stat(S),
symlink(S)
Standards conformance
readlink is not part of any currently supported standard;
it is an extension of AT&T System V provided by the Santa Cruz Operation.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003