Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

stat(2)

lstat(2)

symlink(2)

READLINK(2)                          BSD                           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 named by path into the
     buffer buf, which has size bufsiz.

     The readlink call null-terminates the return link text if there is space
     in the output buffer for the null char (that is, strlen(link-text) is
     less than the buffer-size).

ERRORS
     readlink fails and the mode of the file named by path will be unchanged
     if any of the following are true:

     [ENOTDIR]        A component of the path prefix is not a directory.

     [ENAMETOOLONG]   A component of a pathname exceeded 255 characters, or an
                      entire path name exceeded 1023 characters.

     [ENOENT]         The named file does not exist or path points to an empty
                      string.

     [EACCES]         Search permission is denied for a component of the path
                      prefix.

     [ELOOP]          The call encountered too many symbolic links in
                      translating the pathname.

     [EINVAL]         The named file is not a symbolic link.

     [EIO]            An I/O error occurred while reading from the file
                      system.

     [ERANGE]         The pathname in the symbolic link is longer than
                      buf_size.

SEE ALSO
     stat(2), lstat(2), symlink(2)

DIAGNOSTICS
     A successful call returns the number of characters in buf.  A failed call
     returns -1 and sets errno as indicated under "Errors."

NOTES
     The following error, not returned under Domain/OS BSD, may be returned
     under other implementations:

     [EINVAL]         The pathname contains a character with the high-order
                      bit set.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026