SYMLINK(2) — SYSTEM CALLS
NAME
symlink − make symbolic link to a file
SYNOPSIS
symlink(name1, name2)
char ∗name1, ∗name2;
DESCRIPTION
A symbolic link name2 is created to name1 (name2 is the name of the file created, name1 is the string used in creating the symbolic link). Either name may be an arbitrary path name; the files need not be on the same file system.
RETURN VALUE
Upon successful completion, a zero value is returned. If an error occurs, the error code is stored in errno and a −1 value is returned.
ERRORS
The symbolic link is made unless one or more of the following are true:
ENOTDIR A component of the path prefix of name2 is not a directory.
EINVAL name2 contains a character with the high-order bit set.
ENAMETOOLONG
The length of a component of either name1 or name2 exceeds 255 characters, or the length of either name1 or name2 exceeds 1023 characters.
ENOENT A component of the path prefix of name2 does not exist.
EACCES Search permission is denied for a component of the path prefix of name2.
ELOOP Too many symbolic links were encountered in translating name2.
EEXIST The file referred to by name2 already exists.
EIO An I/O error occurred while reading from or writing to the file system.
EROFS The file name2 would reside on a read-only file system.
ENOSPC The directory in which the entry for the new symbolic link is being placed cannot be extended because there is no space left on the file system containing the directory.
ENOSPC The new symbolic link cannot be created because there is no space left on the file system which will contain the link.
ENOSPC There are no free inodes on the file system on which the file is being created.
EDQUOT The directory in which the entry for the new symbolic link is being placed cannot be extended because the user’s quota of disk blocks on the file system containing the directory has been exhausted.
EDQUOT The new symbolic link cannot be created becaue the user’s quota of disk blocks on the file system which will contain the link has been exhausted.
EDQUOT The user’s quota of inodes on the file system on which the file is being created has been exhausted.
EFAULT name1 or name2 points outside the process’s allocated address space.
SEE ALSO
link(2), ln(1), readlink(2), unlink(2)
Sun Release 3.2 — Last change: 16 July 1986