Unix-system-calls-fsync
[top]#
|http://www.google.com/[Google] | a|
Web | This Site |
選択した読書 Copyright©2014 by finddevguides |
[cols=",,,,,,,",] |
| | Home | | References | | Discussion Forums | | About TP
[width="100%",cols="100%",] |
a| == fsync()-Unix、Linuxシステムコール
[[File:]] image :http://www.finddevguides.com/images/next.gif [next] image:http://www.finddevguides.com/add- this.gif [AddThisソーシャルブックマークボタン]
広告
NAME
fsync、fdatasync-ファイルのインコア状態をストレージデバイスと同期します
概要
#include <unistd.h> int fsync(int fd); int fdatasync(int fd); |
説明
返り値
成功すると、ゼロが返されます。 エラーの場合、-1が返され、_errno_が適切に設定されます。
エラー
Tag | Description |
---|---|
EBADF | fd is not a valid file descriptor open for writing. |
EIO | An error occurred during synchronization. |
EROFS, EINVAL | fd is bound to a special file which does not support synchronization. |
ノート
基になるハードディスクの書き込みキャッシュが有効になっている場合、 fsync ()/fdatasync ()が返されるときに、データが実際に永続的なストレージにない場合があります。
ext2ファイルシステムが_sync_オプションでマウントされると、ディレクトリエントリも fsync ()によって暗黙的に同期されます。
2.4より前のカーネルでは、大きなファイルの fsync ()は非効率的です。 別の方法としては、_O_SYNC_フラグを使用して open (2)することもできます。
準拠
POSIX.1-2001
関連項目
[[File:]] image :http://www.finddevguides.com/images/next.gif [next] [[File:]]
広告
|
[cols="^",] |
|Advertisements