6
30
2014
1

fsync 和sync

本文参考:

http://jesserei.blog.163.com/blog/static/121411689201032015129673/

http://blog.csdn.net/liangxanhai/article/details/7749170

函数原型

int fsync(int fd);

sync();

函数区别:

sync函数将所有修改过的块缓冲区排入写队列,然后返回,不等待实际写磁盘操作

fsync只对参数中的文件描述符fd指定的单一文件起作用,并且等待写磁盘操作结束,在返回。故fsync可以应用于数据库这样程序,这种应用程序需要确保将修改过的块立即写到磁盘上。

Category: Linux | Tags: | Read Count: 1823
Avatar_small
seo service london 说:
2024年1月13日 22:32

Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your post


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com