Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ readlink(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

stat(S)

symlink(S)


 readlink(S)                    6 January 1993                    readlink(S)


 Name

    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 fol-
    lowing is true:

    [EACCES]    Search permission is denied for a component of the oath pre-
                fix.

    [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 exten-
    sion of AT&T System V provided by the Santa Cruz Operation.


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