Module Name: src
Committed By: njoly
Date: Sun Jul 28 13:53:04 UTC 2013
Modified Files:
src/lib/libc/sys: unlink.2
Log Message:
Add unlinkat(2) specific errors.
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/sys/unlink.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/unlink.2
diff -u src/lib/libc/sys/unlink.2:1.27 src/lib/libc/sys/unlink.2:1.28
--- src/lib/libc/sys/unlink.2:1.27 Sun Jan 13 08:15:02 2013
+++ src/lib/libc/sys/unlink.2 Sun Jul 28 13:53:04 2013
@@ -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 @@ provided
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 @@ are owned by the effective user ID.
.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 ,