Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ readlink(2) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

stat.h

symlink



READLINK(2,L)               AIX Technical Reference               READLINK(2,L)



-------------------------------------------------------------------------------
readlink



PURPOSE

Reads the value of a symbolic link.

SYNTAX

int readlink(path, buf, bufsiz)
char *path, *buf;
int bufsiz;

DESCRIPTION

The readlink system call places the first bufsiz characters of the contents of
the symbolic link path into the user's buffer buf.  Unless the link fills the
buffer, it will be null-terminated.

RETURN VALUE

Upon successful completion, the count of characters place in the buffer, not
including the terminating NULL, is returned to the calling process.  Otherwise,
a value of -1 is returned, and errno is set to indicate the error.

ERROR CONDITIONS

The readlink system fails if one or more of the following are true:

EACCES    path is not a symbolic link.

EFAULT    buf points to an invalid address space.

EACCES    A component of the path prefix denies search permission.

EIO       A physical I/O error occurred.

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

ENOENT    The named file does not exist.

ENOENT    A null path name was provided.

ENOENT    A hidden directory was named, but no component inside it matched the
          process's current site path list.

ENOENT    A symbolic link was named, in the path prefix, but the file to which
          it refers does not exist.





Processed November 7, 1990       READLINK(2,L)                                1





READLINK(2,L)               AIX Technical Reference               READLINK(2,L)



EINVAL    The file named by a path is not a symbolic link.

EFAULT    path points outside the process's allocated address space.

ELOOP     A loop of symbolic links was detected.  Since readlink does not
          follow symbolic links in the last component of the path, this error
          cannot occur on the last component.

ENFILE    The system inode table is full.

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

If the Transparent Computing Facility is installed on your system, readlink can
also fail if one or more of the following are true:

ESITEDN1  path cannot be accessed because a site went down.

ESITEDN2  The operation was terminated because a site failed.

ENOSTORE  path is a name relative to the working directory, but no site which
          stores this directory is currently up.

ENOSTORE  A component of path is replicated but not stored on any site which is
          currently up.

EINTR     A signal was caught during the system call.

RELATED INFORMATION

In this book:  "stat.h" and "symlink."























Processed November 7, 1990       READLINK(2,L)                                2



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