LINK(2) DOMAIN/IX Reference Manual (SYS5) LINK(2)
NAME
link - link to a file
USAGE
int link (path1, path2)
char *path1, *path2;
DESCRIPTION
Link creates a new link (directory entry) for the existing
file. Path1 names an existing file. Path2 names the new
directory entry that will be linked to path1.
RETURN VALUE
Upon successful completion, link returns zero. Otherwise,
it returns -1 and sets errno to indicate the error.
ERRORS
Link will fail, and no link will be created, if one or more
of the following is true:
[ENOTDIR] A component of either path prefix is not a
directory.
[ENOENT] A component of either path prefix does not
exist.
[EACCES] A component of either path prefix denies
search permission.
[ENOENT] The file named by path1 does not exist.
[EEXIST] The link named by path2 exists.
[EPERM] The file named by path1 is a directory and
the effective user ID is not super-user.
[EXDEV] The link named by path2 and the file named by
path1 are on different logical devices (file
systems).
[ENOENT] Path2 points to a null pathname.
[EACCES] The requested link requires writing in a
directory with a mode that denies write per-
mission.
[EROFS] The requested link requires writing in a
directory on a read-only file system.
[EFAULT] Path points outside the allocated address
space of the process.
Printed 5/10/85 LINK-1
LINK(2) DOMAIN/IX Reference Manual (SYS5) LINK(2)
[EMLINK] The maximum number of links to a file would
be exceeded.
RELATED INFORMATION
unlink(2)
LINK-2 Printed 5/10/85