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 unlinkat(2) specific errors.



details:   https://anonhg.NetBSD.org/src/rev/9b25d88e23c6
branches:  trunk
changeset: 788914:9b25d88e23c6
user:      njoly <njoly%NetBSD.org@localhost>
date:      Sun Jul 28 13:53:04 2013 +0000

description:
Add unlinkat(2) specific errors.

diffstat:

 lib/libc/sys/unlink.2 |  42 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 36 insertions(+), 6 deletions(-)

diffs (73 lines):

diff -r d6b5990f8fa5 -r 9b25d88e23c6 lib/libc/sys/unlink.2
--- a/lib/libc/sys/unlink.2     Sun Jul 28 13:37:57 2013 +0000
+++ b/lib/libc/sys/unlink.2     Sun Jul 28 13:53:04 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: unlink.2,v 1.27 2013/01/13 08:15:02 dholland Exp $
+.\"    $NetBSD: unlink.2,v 1.28 2013/07/28 13:53:04 njoly Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)unlink.2   8.1 (Berkeley) 6/4/93
 .\"
-.Dd November 18, 2012
+.Dd July 28, 2013
 .Dt UNLINK 2
 .Os
 .Sh NAME
@@ -95,13 +95,12 @@
 is set in
 .Fa flag .
 .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 unlink unlinkat
 .Sh ERRORS
 The
 .Fn unlink
+and
+.Fn unlinkat
 succeeds unless:
 .Bl -tag -width Er
 .It Bq Er EACCES
@@ -141,6 +140,37 @@
 .It Bq Er EROFS
 The named file resides on a read-only file system.
 .El
+.Pp
+In addition,
+.Fn unlinkat
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa path
+does not specify an absolute path and
+.Fa fd
+is neither
+.Dv AT_FDCWD
+nor a valid file descriptor open for reading or searching.
+.It Bq Er ENOTDIR
+.Fa path
+is not an absolute path and
+.Fa fd
+is a file descriptor associated with a non-directory file; or
+.Fa flag
+has
+.Dv AT_REMOVEDIR
+set and
+.Fa path
+does not name a directory.
+.It Bq Er ENOTEMPTY
+.Fa flag
+has
+.Dv AT_REMOVEDIR
+set and
+.Fa path
+is a directory that is not empty.
+.El
 .Sh SEE ALSO
 .Xr close 2 ,
 .Xr link 2 ,



Home | Main Index | Thread Index | Old Index