Каталог требований LSB Core 3.1

Требования для функции 'link'
StandardIDDescription
SUSv3link.01 The link() function shall create a new link (directory entry) for the existing file, path1.
SUSv3link.02 The link() function shall atomically create a new link for the existing file and the link count of the file shall be incremented by one
SUSv3link.03 If path1 names a directory, link() shall fail unless the process has appropriate privileges and the implementation supports using link() on directories
SUSv3link.04 Upon successful completion, link() shall mark for update the st_ctime field of the file
SUSv3link.05 Also, the st_ctime and st_mtime fields of the directory that contains the new entry shall be marked for update.
SUSv3link.06 If link() fails, no link shall be created and the link count of the file shall remain unchanged
SUSv3link.07 The implementation may require that the calling process has permission to access the existing file.
SUSv3link.08 Upon successful completion, 0 shall be returned.
SUSv3link.09 Otherwise, -1 shall be returned and errno set to indicate the error
SUSv3link.90 The link() function shall fail if:
SUSv3link.90.01 [EACCES] A component of either path prefix denies search permission, or the requested link requires writing in a directory that denies write permission, or the calling process does not have permission to access the existing file and this is required by the implementation.
SUSv3link.90.02 [EEXIST] The path2 argument resolves to an existing file or refers to a symbolic link.
SUSv3link.90.03 [ELOOP] A loop exists in symbolic links encountered during resolution of the path1 or path2 argument.
SUSv3link.90.04 [EMLINK] The number of links to the file named by path1 would exceed {LINK_MAX}.
SUSv3link.90.05 [ENAMETOOLONG] The length of the path1 or path2 argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
SUSv3link.90.06 [ENOENT] A component of either path prefix does not exist; the file named by path1 does not exist; or path1 or path2 points to an empty string.
SUSv3link.90.07 [ENOSPC] The directory to contain the link cannot be extended.
SUSv3link.90.08 [ENOTDIR] A component of either path prefix is not a directory.
SUSv3link.90.09 [EPERM] The file named by path1 is a directory and either the calling process does not have appropriate privileges or the implementation prohibits using link() on directories.
SUSv3link.90.10 [EROFS] The requested link requires writing in a directory on a read-only file system.
SUSv3link.90.11 [EXDEV] The link named by path2 and the file named by path1 are on different file systems and the implementation does not support links between file systems.
SUSv3link.90.12 [EXDEV] [XSR] path1 refers to a named STREAM.
SUSv3link.92 The link() function may fail if:
SUSv3link.92.01 [ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path1 or path2 argument.
SUSv3link.92.02 [ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path1 or path2 argument, the length of the substituted pathname string exceeded {PATH_MAX}.
LSBlink.30 ISO POSIX (2003) specifies that pathname resolution shall follow symbolic links during pathname resolution unless the function is required to act on the symbolic link itself, or certain arguments direct that the function act on the symbolic link itself. The link() function in ISO POSIX (2003) contains no such requirement to operate on a symbolic link. However, a conforming LSB implementation need not follow a symbolic link for the path1 argument.
The text in the Description column of SUSv3 requirements is reproduced from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html