Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lstat(2)

stat(2)

symlink(2)



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.

     [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]          An I/O error occurred while reading from the
                    file system.

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), and symlink(2).




Printed 4/6/89                                                  1



%%index%%
na:336,92;
sy:428,771;
de:1199,632;
di:1831,1063;
rv:2894,318;
se:3212,158;
%%index%%000000000109

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