From f79173603be9966730be02f2323c98f9d7e77300 Mon Sep 17 00:00:00 2001 From: matthew Date: Tue, 12 Jul 2011 18:41:38 +0000 Subject: Clarify that exactly one of O_RDONLY, O_WRONLY, and O_RDWR must be specified when calling open(2). --- lib/libc/sys/open.2 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index b61e84773fb..7e9ea5dfb50 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: open.2,v 1.37 2011/07/12 18:36:23 matthew Exp $ +.\" $OpenBSD: open.2,v 1.38 2011/07/12 18:41:38 matthew Exp $ .\" $NetBSD: open.2,v 1.8 1995/02/27 12:35:14 cgd Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -60,9 +60,10 @@ as described in and modified by the process' umask value (see .Xr umask 2 ) . .Pp -The flags specified are formed by +The flags specified are formed by bitwise-inclusive .Tn OR Ns 'ing -the following values: +the following values. +Exactly one of the first three values (file access modes) must be specified: .Pp .Bl -tag -width O_DIRECTORY -offset indent -compact .It Dv O_RDONLY @@ -71,6 +72,11 @@ Open for reading only. Open for writing only. .It Dv O_RDWR Open for reading and writing. +.El +.Pp +Any combination of the following flags may additionally be used: +.Pp +.Bl -tag -width O_DIRECTORY -offset indent -compact .It Dv O_NONBLOCK Do not block on open or for data to become available. .It Dv O_APPEND -- cgit v1.2.3-59-g8ed1b