summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/fsync.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/fsync.2')
-rw-r--r--lib/libc/sys/fsync.228
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/libc/sys/fsync.2 b/lib/libc/sys/fsync.2
index 234ea6e..74105ec 100644
--- a/lib/libc/sys/fsync.2
+++ b/lib/libc/sys/fsync.2
@@ -53,6 +53,28 @@ of buffers for the associated file to be written to a disk.
should be used by programs that require a file to be
in a known state, for example, in building a simple transaction
facility.
+.Sh IMPLEMENTATION NOTES
+.Pp
+In the non-threaded library
+.Fn fsync
+is implemented as the
+.Va fsync
+syscall.
+.Pp
+In the threaded library, the
+.Va fsync
+syscall is assembled to
+.Fn _thread_sys_fsync
+and
+.Fn fsync
+is implemented as a function which locks
+.Va fd
+for read and write, then calls
+.Fn _thread_sys_fsync .
+Before returning,
+.Fn fsync
+unlocks
+.Va fd .
.Sh RETURN VALUES
A 0 value is returned on success. A -1 value indicates
an error.
@@ -72,10 +94,10 @@ An I/O error occurred while reading from or writing to the file system.
.El
.Sh SEE ALSO
.Xr sync 2 ,
-.Xr sync 8 ,
-.Xr update 8
+.Xr update 4 ,
+.Xr sync 8
.Sh HISTORY
The
-.Nm
+.Fn fsync
function call appeared in
.Bx 4.2 .
OpenPOWER on IntegriCloud