From 2fb46d5815c18208e0a5f418b05f7fa43c370e66 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 1 Dec 2005 17:54:33 +0000 Subject: 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. --- lib/libc/sys/open.2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/libc/sys/open.2') 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. -- cgit v1.1