Index of Section 2 Manual Pages
| Interix / SUA | wcs_symlink.2 | Interix / SUA |
wcs_symlink(2) wcs_symlink(2)
symlink()
NAME
symlink(), wcs_symlink - create symbolic link to a file
SYNOPSIS
#include
int symlink(const char *path1, const char *path2)
int wcs_symlink(const wchar_t *path1, const wchar_t *path2)
DESCRIPTION
The symlink(2) and wcs_symlink(2) functions are identical, except that
wcs_symlink(2) accepts wide characters in the path1 and path2 arguments.
The symlink(2) or wcs_symlink(2) function creates a symbolic link, with
the pathname path2, with the contents path1. There must be no existing
file or symbolic link with the name path2.
RETURN VALUE
Upon sucess, symlink(2) or wcs_symlink(2) returns 0; otherwise it returns
-1 and sets the value of errno.
ERRORS
The symlink(2) or wcs_symlink(2) function can fail for the following
reasons:
[EACCES]
Process does not have write permission in the directory where the
symbolic link is being created or does not have search permission for
some component of path2.
[EEXIST]
The path2 argument names a file or link that exists.
[EIO]
An I/O error occurred.
[EINVAL]
The underlying device doesn't support the operation.
[ELOOP]
While resolving path2, the system encountered too many symbolic links.
[ENAMETOOLONG]
Either a pathname component is longer than {NAME_MAX}, or the length
of path2 is longer than {PATH_MAX}.
[ENOENT]
Either path2 is an empty string or some component does not name an
existing file.
[ENOSPC]
There is no space on the file system, so the directory containing the
link cannot be extended or the link cannot be created, or the system
is out of file allocation resources.
[ENOTDIR]
Some component of the path prefix of path2 is not a directory.
[EROFS]
The new symbolic link would be on a read-only filesystem.
NOTES
Remember that unlike a hard link the presence of a symbolic link does not
guarantee the existence of path1, not even when the link is created. Also
unlike hard links, a symbolic link can point to a directory and it can
cross file system boundaries.
SEE ALSO
lchown(2)
link(2)
lstat(2)
open(2)
readlink(2)
USAGE NOTES
All of these functions are thread safe.
All of these functions are async-signal safe.