Penguin

Differences between version 3 and revision by previous author of fsync(2).

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 3 Last edited on Thursday, November 7, 2002 12:19:21 am by PerryLorier Revert
Older page: version 1 Last edited on Tuesday, June 4, 2002 12:23:40 am by perry Revert
@@ -1,93 +1,32 @@
-FSYNC  
-!!!FSYNC  
-NAME  
-SYNOPSIS  
-DESCRIPTION  
-RETURN VALUE  
-ERRORS  
-NOTES  
-CONFORMING TO  
-SEE ALSO  
-----  
 !!NAME 
  
  
 fsync, fdatasync - synchronize a file's complete in-core state with that on disk 
 !!SYNOPSIS 
  
  
-__#include __ 
+ __#include <unistd>__  
+ __int fsync(int__ ''fd''__); __ 
  
-  
-__int fsync(int__ ''fd''__);__  
-  
-  
-__int fdatasync(int__ ''fd''__);__  
 !!DESCRIPTION 
+fsync(2) copies all in-core parts of a file to disk, and waits until the device reports that all parts are on stable storage. It also updates metadata stat information. It does not necessarily ensure that the entry in the directory containing the file has also reached disk. For that an explicit fsync(2) on the file descriptor of the directory is also needed.  
  
-  
-__fsync__ copies all in-core parts of a file to disk, and  
-waits until the device reports that all parts are on stable  
-storage. It also updates metadata stat information. It does  
-not necessarily ensure that the entry in the directory  
-containing the file has also reached disk. For that an  
-explicit __fsync__ on the file descriptor of the  
-directory is also needed.  
-  
-  
-__fdatasync__ does the same as __fsync__ but only  
-flushes user data, not the meta data like the mtime or  
-atime.  
 !!RETURN VALUE 
-  
-  
- On success, zero is returned. On error, -1 is returned, and  
- ''errno'' is set appropriately. 
+On success, zero is returned. On error, -1 is returned, and ''errno'' is set appropriately. 
 !!ERRORS 
  
+;[EBADF]: ''fd'' is not a valid file descriptor open for writing.  
+;[EROFS], [EINVAL]: ''fd'' is bound to a special file which does not support synchronization.  
+;[EIO]: An error occurred during synchronization.  
  
-__EBADF__  
-  
-  
-''fd'' is not a valid file descriptor open for  
-writing.  
-  
-  
-__EROFS__, __EINVAL__  
-  
-  
-''fd'' is bound to a special file which does not support  
-synchronization.  
-  
-  
-__EIO__  
-  
-  
-An error occurred during synchronization.  
 !!NOTES 
+In case the hard disk has write cache enabled, the data may not really be on permanent storage when fsync(2) returns.  
  
+When an ext2 file system is mounted with the ''sync'' option, directory entries are also implicitely synced by fsync(2).  
  
-In case the hard disk has write cache enabled, the data may  
-not really be on permanent storage when  
-__fsync__/__fdatasync__ return.  
-  
-  
-When an ext2 file system is mounted with the ''sync''  
-option, directory entries are also implicitely synced by  
-__fsync__.  
-  
-  
- On kernels before 2.4, __ fsync__ on big files can be  
- inefficient. An alternative might be to use the  
- ''O_SYNC'' flag to open(2). 
+On kernels before 2.4, fsync(2) on big files can be inefficient. An alternative might be to use the ''O_SYNC'' flag to open(2). 
 !!CONFORMING TO 
+POSIX.1b (formerly POSIX.4)  
  
-  
-POSIX.1b (formerly POSIX.4)  
 !!SEE ALSO 
-  
-  
- bdflush(2), open(2), sync(2),  
- mount(8), update(8),  
- sync(8)  
-----  
+bdflush(2), open(2), sync(2), mount(8), update(8), sync(8), fdatasync(2)  
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.