NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO
#include <unistd.h>int symlink(const char *name1, const char *name2);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
NFS_CLIENT, UFS
A symbolic link name2 is created to name1 (name2 is the name of the file created, name1 is the string used to create the symbolic link). Either name may be an arbitrary pathname, and the files need not be on the same file system.
Upon successful completion, a value of 0 is returned. Otherwise a value of -1 is returned, and errno is set to indicate one of the following error conditions.
A component of the name2 prefix is not a directory.
A component of either pathname exceeded NAME_MAX characters, or the entire length of either pathname exceeded PATH_MAX characters.
The file named does not exist.
Symbolic links are not supported on MSDOS file systems.
A component of the name2 path prefix denies search permission.
Too many symbolic links were encountered in translating the pathname.
name2 already exists.
An I/O error occurred while making the directory entry for name2, allocating the inode for name2 or writing out the link contents of name2.
The file name2 would reside on a read-only file system.
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.
The new symbolic link cannot be created because there is no space left on the file system which will contain the symbolic link.
There are no free inodes on the file system on which the symbolic link is being created.
The directory in which the entry for the new symbolic link is being placed cannot be extended; the user's quota of disk blocks on the file system containing the directory has been exhausted.
The new symbolic link cannot be created because the user's quota of disk blocks on the file system that will contain the symbolic link has been exhausted.
The user's quota of inodes on the file system on which the symbolic link is being created has been exhausted.
An I/O error occurred while making the directory entry or allocating the inode.
In user mode, name1 or name2 points outside the process's allocated address space. In supervisor mode, this is not detected, and the state of the target is unknown.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO