SYMLINK(2)SYMLINK(2)NAMEsymlink - make a symbolic link to a file
SYNOPSIS
#include <unistd.h>
int symlink(const char *name1, const char *name2)
DESCRIPTION
A symbolic link name2 is created. The link has the name name1.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a
value of -1 is returned and errno is set to indicate the error.
ERRORS
Symlink will fail and no link will be created if one or more of the
following are true:
[ENOTDIR] A component of either path prefix is not a directory.
[ENAMETOOLONG] A path name exceeds PATH_MAX characters.
[ENOENT] A component of either path prefix does not exist.
[EACCES] A component of either path prefix denies search permisā
sion.
[EACCES] The requested link requires writing in a directory with
a mode that denies write permission.
[ELOOP] Too many symbolic links were encountered in translating
one of the pathnames.
[EEXIST] The link named by name2 exists.
[ENOSPC] The directory in which the entry for the new link is
being placed cannot be extended because there is no
space left on the file system containing the directory.
[EIO] An I/O error occurred while reading from or writing to
the file system to make the directory entry.
[EROFS] The requested link requires writing in a directory on a
read-only file system.
[EFAULT] One of the pathnames specified is outside the process's
allocated address space.
SEE ALSOlink(2), unlink(2).
4th Berkeley Distribution March 17, 2006 SYMLINK(2)