Module Name: src Committed By: wiz Date: Mon Aug 8 19:50:17 UTC 2011
Modified Files: src/lib/libc/sys: link.2 Log Message: Sort sections. Remove trailing whitespace. Sort errors. New sentence, new line. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/lib/libc/sys/link.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/sys/link.2 diff -u src/lib/libc/sys/link.2:1.25 src/lib/libc/sys/link.2:1.26 --- src/lib/libc/sys/link.2:1.25 Mon Aug 8 12:08:53 2011 +++ src/lib/libc/sys/link.2 Mon Aug 8 19:50:17 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: link.2,v 1.25 2011/08/08 12:08:53 manu Exp $ +.\" $NetBSD: link.2,v 1.26 2011/08/08 19:50:17 wiz Exp $ .\" .\" Copyright (c) 1980, 1991, 1993, 2011 .\" The Regents of the University of California. All rights reserved. @@ -79,24 +79,26 @@ .Fa name1 may not be a directory unless the caller is the super-user and the file system containing it supports linking to directories. -.Pp +.Pp When operating on a symlink, .Fn link -resolves the symlink and creates a hard link on the target. +resolves the symlink and creates a hard link on the target. .Fn linkat -will do the same if +will do the same if .Dv AT_SYMLINK_FOLLOW -is set in +is set in .Fa flags , but it will link on the symlink itself if the flag is clear. .Pp -At the moment, +At the moment, .Fn linkat -is partially implemented. It will return -.Er ENOSYS for +is partially implemented. +It will return +.Er ENOSYS +for .Fa fd1 -and -.Fa fd2 +and +.Fa fd2 values different than .Dv AT_FDCWD . .Sh RETURN VALUES @@ -108,39 +110,53 @@ .Fn link will fail and no link will be created if: .Bl -tag -width Er -.It Bq Er ENOTDIR -A component of either path prefix is not a directory. -.It Bq Er ENAMETOOLONG -A component of a pathname exceeded -.Brq Dv NAME_MAX -characters, or an entire path name exceeded -.Brq Dv PATH_MAX -characters. -.It Bq Er ENOENT -A component of either path prefix does not exist. .It Bq Er EACCES A component of either path prefix denies search permission, or the requested link requires writing in a directory with a mode that denies write permission. +.It Bq Er EDQUOT +The directory in which the entry for the new link +is being placed cannot be extended because the +user's quota of disk blocks on the file system +containing the directory has been exhausted. +.It Bq Er EEXIST +The link named by +.Fa name2 +does exist. +.It Bq Er EFAULT +One of the pathnames specified +is outside the process's allocated address space. +.It Bq Er EIO +An I/O error occurred while reading from or writing to +the file system to make the directory entry. .It Bq Er ELOOP Too many symbolic links were encountered in translating one of the pathnames. +.It Bq Er EMLINK +The link count of the file named by +.Fa name1 +would exceed +.Dv {LINK_MAX} . +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded +.Brq Dv NAME_MAX +characters, or an entire path name exceeded +.Brq Dv PATH_MAX +characters. .It Bq Er ENOENT -The file named by +A component of either path prefix does not exist, or the file named +by .Fa name1 does not exist. +.It Bq Er ENOSPC +The directory in which the entry for the new link is being placed +cannot be extended because there is no space left on the file +system containing the directory. +.It Bq Er ENOTDIR +A component of either path prefix is not a directory. .It Bq Er EOPNOTSUPP The file system containing the file named by .Fa name1 does not support links. -.It Bq Er EMLINK -The link count of the file named by -.Fa name1 -would exceed -.Dv {LINK_MAX} . -.It Bq Er EEXIST -The link named by -.Fa name2 -does exist. .It Bq Er EPERM The file named by .Fa name1 @@ -149,39 +165,24 @@ or the file system containing the file does not permit the use of .Fn link on a directory. +.It Bq Er EROFS +The requested link requires writing in a directory on a read-only file +system. .It Bq Er EXDEV The link named by .Fa name2 and the file named by .Fa name1 are on different file systems. -.It Bq Er ENOSPC -The directory in which the entry for the new link is being placed -cannot be extended because there is no space left on the file -system containing the directory. -.It Bq Er EDQUOT -The directory in which the entry for the new link -is being placed cannot be extended because the -user's quota of disk blocks on the file system -containing the directory has been exhausted. -.It Bq Er EIO -An I/O error occurred while reading from or writing to -the file system to make the directory entry. -.It Bq Er EROFS -The requested link requires writing in a directory on a read-only file -system. -.It Bq Er EFAULT -One of the pathnames specified -is outside the process's allocated address space. .El .Sh SEE ALSO .Xr symlink 2 , .Xr unlink 2 -.Sh BUGS -.Fn linkat -is partially implemented. .Sh STANDARDS The .Fn link function conforms to .St -p1003.1-90 . +.Sh BUGS +.Fn linkat +is partially implemented.