Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/sys Add linkat(2) specific errors.



details:   https://anonhg.NetBSD.org/src/rev/c6da00016fb0
branches:  trunk
changeset: 788919:c6da00016fb0
user:      njoly <njoly%NetBSD.org@localhost>
date:      Sun Jul 28 18:40:40 2013 +0000

description:
Add linkat(2) specific errors.

diffstat:

 lib/libc/sys/link.2 |  39 ++++++++++++++++++++++++++++++++-------
 1 files changed, 32 insertions(+), 7 deletions(-)

diffs (76 lines):

diff -r 5c9ee8fb16e5 -r c6da00016fb0 lib/libc/sys/link.2
--- a/lib/libc/sys/link.2       Sun Jul 28 15:46:34 2013 +0000
+++ b/lib/libc/sys/link.2       Sun Jul 28 18:40:40 2013 +0000
@@ -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 @@
 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 @@
 .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 @@
 .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



Home | Main Index | Thread Index | Old Index