Module Name: src
Committed By: njoly
Date: Sun Jul 28 18:40:40 UTC 2013
Modified Files:
src/lib/libc/sys: link.2
Log Message:
Add linkat(2) specific errors.
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 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.31 src/lib/libc/sys/link.2:1.32
--- src/lib/libc/sys/link.2:1.31 Sun Jul 14 14:29:09 2013
+++ src/lib/libc/sys/link.2 Sun Jul 28 18:40:40 2013
@@ -1,4 +1,4 @@
-.\" $NetBSD: link.2,v 1.31 2013/07/14 14:29:09 njoly Exp $
+.\" $NetBSD: link.2,v 1.32 2013/07/28 18:40:40 njoly Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 2011
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)link.2 8.3 (Berkeley) 1/12/94
.\"
-.Dd November 18, 2012
+.Dd July 28, 2013
.Dt LINK 2
.Os
.Sh NAME
@@ -97,7 +97,7 @@ descriptor was passed as
Search permission is required on the directories named by
.Fa fd1
and
-.Fa fd2.
+.Fa fd2 .
.\" (These alternatives await a decision about the semantics of O_SEARCH)
.\" Search permission is required on the directories named by
.\" .Fa fd1
@@ -131,12 +131,11 @@ is set in
.Fa flags ,
but it will link on the symlink itself if the flag is clear.
.Sh RETURN VALUES
-Upon successful completion, a value of 0 is returned.
-Otherwise, a value of \-1 is returned and
-.Va errno
-is set to indicate the error.
+.Rv -std link linkat
.Sh ERRORS
.Fn link
+and
+.Fn linkat
will fail and no link will be created if:
.Bl -tag -width Er
.It Bq Er EACCES
@@ -204,6 +203,32 @@ and the file named by
.Fa name1
are on different file systems.
.El
+.Pp
+In addition,
+.Fn linkat
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa name1
+or
+.Fa name2
+does not specify an absolute path and
+.Fa fd1
+or
+.Fa fd2 ,
+respectively, is neither
+.Dv AT_FDCWD
+nor a valid file descriptor open for reading or searching.
+.It Bq Er ENOTDIR
+.Fa name1
+or
+.Fa name2
+is not an absolute path and
+.Fa fd1
+or
+.Fa fd2 ,
+respectively, is a file descriptor associated with a non-directory file.
+.El
.Sh SEE ALSO
.Xr symlink 2 ,
.Xr unlink 2