SYNOPSIS
#include <unistd.h>
int link(const char *pathname1, const char *pathname2);
DESCRIPTION
The
If the existing file specifies a directory,
Upon successful completion,
PARAMETERS
- pathname1
-
Points to a path name that names an existing file.
- pathname2
-
Points to a path name that names the new directory entry to be created.
RETURN VALUES
If successful,
- EACCES
-
A component of either path name prefix denies search permission.
The calling process does not have permission to access the existing file.
The requested link requires writing in a directory with a mode that denies write permission.
- EEXIST
-
The link named by pathname2 exists.
- EFAULT
-
The pathname1 or pathname2 parameter is an invalid pointer.
- EINTR
-
A signal interrupted the call.
- EMLINK
-
The number of links to the file exceeds LINK_MAX.
- ENAMETOOLONG
-
The length of pathname1 or pathname2 string exceeds PATH_MAX or a path name component is longer than NAME_MAX.
- ENOENT
-
A component of either path name prefix does not exist.
Either pathname1 or pathname2 points to an empty string.
The file named by pathname1 does not exist.
- ENOSPC
-
The directory that would contain the link cannot be extended.
- ENOTDIR
-
A component of either path name prefix is not a directory.
- EPERM
-
The file that pathname1 named is a directory,.
- EROFS
-
The requested link requires writing in a directory on a read-only file system.
- EXDEV
-
The link named by pathname2 and the file named by pathname1 are on different file systems (logical drives), and the implementation does not support links between file systems.
CONFORMANCE
POSIX.1 (1996), with exceptions.
MULTITHREAD SAFETY LEVEL
Async-signal-safe.
PORTING ISSUES
Windows only supports hard links between files on local NTFS partitions.
Calls to
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.5 Documentation Build 40.