summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/open.2
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2000-11-29 04:08:49 +0000
committeralfred <alfred@FreeBSD.org>2000-11-29 04:08:49 +0000
commit04e161e4991f9030150820adb770c63ee48e0214 (patch)
treedb31181a4dc3786cdb7ac92daa1fcc106c457731 /lib/libc/sys/open.2
parent39cf580768d63fdbabaac3863cff2bd86f13618d (diff)
downloadFreeBSD-src-04e161e4991f9030150820adb770c63ee48e0214.zip
FreeBSD-src-04e161e4991f9030150820adb770c63ee48e0214.tar.gz
document O_NOFOLLOW and O_FSYNC flags to open
Diffstat (limited to 'lib/libc/sys/open.2')
-rw-r--r--lib/libc/sys/open.221
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index 439b4b48e..769ac27 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -83,6 +83,8 @@ O_TRUNC truncate size to 0
O_EXCL error if create and file exists
O_SHLOCK atomically obtain a shared lock
O_EXLOCK atomically obtain an exclusive lock
+O_FSYNC synchronous writes
+O_NOFOLLOW do not follow symlinks
.Ed
.Pp
Opening a file with
@@ -120,6 +122,22 @@ returns immediately.
The first time the process attempts to perform I/O on the open
file it will block (not currently implemented).
.Pp
+If
+.Dv O_FSYNC
+is used in the mask, all writes will
+immediately be written to disk,
+the kernel will not cache written data
+and all writes on the descriptor will not return until
+the data to be written completes.
+.Pp
+If
+.Dv O_NOFOLLOW
+is used in the mask and the target file passed to
+.Fn open
+is a symbolic link then the
+.Fn open
+will fail.
+.Pp
When opening a file, a lock with
.Xr flock 2
semantics can be obtained by setting
@@ -216,6 +234,9 @@ and the file is to be modified.
The process has already reached its limit for open file descriptors.
.It Bq Er ENFILE
The system file table is full.
+.It Bq Er EMLINK
+.Dv O_NOFOLLOW
+was specified and the target is a symbolic link.
.It Bq Er ENXIO
The named file is a character special or block
special file, and the device associated with this special file
OpenPOWER on IntegriCloud