📄 fsync.2
字号:
.\" SCCSID: @(#)fsync.2 8.2 9/12/90.TH fsync 2.SH Namefsync \- synchronize a file's in-core state with that on disk.SH Syntaxfsync(\fIfd\fP).brint \fIfd\fP;.SH Description.NXR "fsync system call".NXR "file" "synchronizing buffers with disk"The.PN fsyncsystem call causes all modified data and attributes of .I fdto be moved to a permanent storage device.This results in all in-core modified copiesof buffers for the associated file to be written to a disk..PPThe.PN fsynccall should be used by programs that require a file to bein a known state, for example, in building a simple transactionfacility..SH Return ValuesA 0 value is returned on success. A \-1 value indicatesan error..SH DiagnosticsThe .PN fsynccall fails under the following conditions:.TP 15[EBADF]The .I fdargument is not a valid descriptor..TP[EINVAL]The.I fdargument refers to a socket..TP[EIO]An I/O error occurred while reading from or writing to the filesystem. .TP[EINTR]The.PN fsync()function was interrupted by a signal..PPIf an error occurs on anasynchronous write over NFS, the error cannot always be returned from a.PN writesystem call. The error code is returned on.PN closeor.PN fsync .The following are NFS-only error messages:.TP 15[EACCESS]The requested address is protected, and the current userhas inadequate permission to access it. .TP 15[ENOSPC]There is no free space remaining on the file system containingthe file..TP 15[EDQUOT]The user's quota of disk blocks on the file system containingthe file has been exhausted..TP 15[EROFS]The file is on a read-only file system..TP 15[ESTALE]The.I fdargument is invalid because the file referredto by that file handle no longer exists or has been revoked. .TP[ETIMEDOUT]A write operation failedbecause the serverdid not properly respond after a periodof time that is dependent on the.MS mount 8nfsoptions..SH See Alsosync(1), close(2), sync(2), write(2), update(8)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -