summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2011-07-12 18:36:24 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2011-07-12 18:36:24 +0000
commited45692ccce37bd3aa7f456ff82b26d4dad2752d (patch)
treebda96880041a4f6caefb9cd54ae7b137e632ca4c /lib
parentd6e666574d0002339b5b7995bc452d016016d87d (diff)
document O_CLOEXEC and O_DIRECTORY
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/open.217
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index 2190c88295d..b61e84773fb 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: open.2,v 1.36 2011/02/18 13:22:53 millert Exp $
+.\" $OpenBSD: open.2,v 1.37 2011/07/12 18:36:23 matthew Exp $
.\" $NetBSD: open.2,v 1.8 1995/02/27 12:35:14 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)open.2 8.2 (Berkeley) 11/16/93
.\"
-.Dd $Mdocdate: February 18 2011 $
+.Dd $Mdocdate: July 12 2011 $
.Dt OPEN 2
.Os
.Sh NAME
@@ -64,7 +64,7 @@ The flags specified are formed by
.Tn OR Ns 'ing
the following values:
.Pp
-.Bl -tag -width O_NONBLOCK -offset indent -compact
+.Bl -tag -width O_DIRECTORY -offset indent -compact
.It Dv O_RDONLY
Open for reading only.
.It Dv O_WRONLY
@@ -89,6 +89,12 @@ Atomically obtain a shared lock.
Atomically obtain an exclusive lock.
.It Dv O_NOFOLLOW
If last path element is a symlink, don't follow it.
+.It Dv O_CLOEXEC
+Set FD_CLOEXEC on the new file descriptor.
+.It Dv O_DIRECTORY
+Error if
+.Fa path
+does not name a directory.
.El
.Pp
Opening a file with
@@ -185,6 +191,11 @@ The named file is opened unless:
.Bl -tag -width Er
.It Bq Er ENOTDIR
A component of the path prefix is not a directory.
+.It Bq Er ENOTDIR
+.Dv O_DIRECTORY
+is specified and
+.Fa path
+does not name a directory.
.It Bq Er ENAMETOOLONG
A component of a pathname exceeded
.Dv {NAME_MAX}