
UNIX环境高级编程
only火车头
linux, linux nand driver, linux ltp
展开
-
解决 warning: implicit declaration of function ‘mempcpy’
#include <stdio.h>#include <stdlib.h>#include <string.h>void *combine(void *o1, size_t s1, void *o2, size_t s2){ void *result = malloc(s1 + s2); if (result != NULL) mempcp...原创 2019-12-27 15:50:25 · 2900 阅读 · 0 评论 -
sync、fsync 和 fdatasync 函数
转自: 《UNIX 环境高级编程(第二版中文)》 第三章 文件I/O 3.13 sync, fsync 和 fdatasync 函数传统的 unix 实现在内核中设有缓冲区高速缓存或页面高速缓存,大多数磁盘 I/O 都通过缓冲进行。当将数据写入文件时,内核通常先将该数据复制到其中一个缓冲区中,如果该缓冲区尚未写满,则并不将其排入输出队列,而是等待其写满或者当内核需要重用该缓冲区以便存放其他磁盘...原创 2019-01-05 11:27:20 · 525 阅读 · 0 评论