summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/open.2
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-12-01 17:54:33 +0000
committerimp <imp@FreeBSD.org>2005-12-01 17:54:33 +0000
commit2fb46d5815c18208e0a5f418b05f7fa43c370e66 (patch)
treeef28a7732696f6a90a74494d2f1ddf032abf95f7 /lib/libc/sys/open.2
parent1bc293e3807e6c0f274a1f0a847573138e001dca (diff)
downloadFreeBSD-src-2fb46d5815c18208e0a5f418b05f7fa43c370e66.zip
FreeBSD-src-2fb46d5815c18208e0a5f418b05f7fa43c370e66.tar.gz
Document O_NOCTTY and O_SYNC. O_NOCTTY is a nop on freebsd, while on
other systems it prevents a tty from becoming a controlling tty on the open. O_SYNC is the POSIX name for O_FSYNC. The Markup Police may need to tweak my references to standards.
Diffstat (limited to 'lib/libc/sys/open.2')
-rw-r--r--lib/libc/sys/open.217
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index 14d8722..a2de150 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -86,7 +86,9 @@ O_SHLOCK atomically obtain a shared lock
O_EXLOCK atomically obtain an exclusive lock
O_DIRECT eliminate or reduce cache effects
O_FSYNC synchronous writes
+O_SYNC synchronous writes
O_NOFOLLOW do not follow symlinks
+O_NOCTTY don't assign controlling terminal
.Ed
.Pp
Opening a file with
@@ -133,6 +135,11 @@ the kernel will not cache written data
and all writes on the descriptor will not return until
the data to be written completes.
.Pp
+.Dv O_SYNC
+is a synonym for
+.Dv O_FSYNC
+required by POSIX.
+.Pp
If
.Dv O_NOFOLLOW
is used in the mask and the target file passed to
@@ -160,6 +167,16 @@ If it cannot avoid caching the data,
it will minimize the impact the data has on the cache.
Use of this flag can drastically reduce performance if not used with care.
.Pp
+.Dv O_NOCTTY
+may be used to ensure the OS does not assign this file as the
+controlling terminal when it opens a tty device.
+This is the default on
+.Fx ,
+but is present for POSIX 1003.1 compatibility.
+.Fn open
+will not assign controlling terminals on
+.Fx .
+.Pp
If successful,
.Fn open
returns a non-negative integer, termed a file descriptor.
OpenPOWER on IntegriCloud