Go to the previous, next section.
int link(const char *src, const char
*new);
src: [in] points the the file we want to add a link to.
new: [in] points to the path for the new link.
Creates a new (hard) link to a file. There is no way to distinguish the links.
On success zero is returned. On error, -1 is returned and errno
is set to one of the following values:
EPERM: the file system does not support hard links or
oldpath is the . or .. entry of a
directory.
EXDEV, EFAULT, EACCESS,
ENAMETOOLONG, ENOENT, ENOTDIR,
ENOMEM, EROFS, EEXIST,
EMLINK, ELOOP and. ESPC.