diff options
| author | christos <christos@NetBSD.org> | 2017-11-09 20:30:01 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2017-11-09 20:30:01 +0000 |
| commit | aaf64feec02754b6722a68fed65e472b450ba000 (patch) | |
| tree | f9eb3ff87e62ab81859ba0d5eb8d8e5a8787714f /lib/libc/sys | |
| parent | f29b807ebe28ac7e7c33909b91d9d011ee1a938b (diff) | |
Add O_REGULAR to enforce opening of only regular files
(like we have O_DIRECTORY for directories).
This is better than open(, O_NONBLOCK), fstat()+S_ISREG() because opening
devices can have side effects.
Diffstat (limited to 'lib/libc/sys')
| -rw-r--r-- | lib/libc/sys/open.2 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index eb4a652f545..62ce416e56a 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -1,4 +1,4 @@ -.\" $NetBSD: open.2,v 1.57 2017/05/14 12:30:37 wiz Exp $ +.\" $NetBSD: open.2,v 1.58 2017/11/09 20:30:02 christos Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" -.Dd July 29, 2013 +.Dd November 9, 2017 .Dt OPEN 2 .Os .Sh NAME @@ -188,6 +188,8 @@ using an interface that supports scatter/gather via struct iovec, each element of the request must meet the above alignment constraints. .It Dv O_DIRECTORY Fail if the file is not a directory. +.It Dv O_REGULAR +Fail if the path does not refer to a regular file. .It Dv O_ASYNC Enable the .Dv SIGIO |
