ILD

pipe is stream but POSIX define PIPE_BUF
2025-12-5
根据man 7 pipeThe communication channel provided by a pipe is a byte stream: there is no concept of message boundaries.但是POSIX定义了:POSIX.1 says that w

file mtime update granularity
2025-12-10
众所周知,mtime是文件的最后修改时间,Time of last modification在我们的一个项目中,使用mtime判断一个文件是否修改。缓存上一次的mtime,结果出现了文件修改了,但是mtime没变的情况。出现了bug。经过研究发现,两次极短的写入,mtime不会变化。写一个demo验

Linux zero copy API: copy_file_range()
2025-12-24
1 历史copy_file_range()的函数原型如下: ssize_t copy_file_range(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out,

Linux zero copy API: sendfile() & splice()
2025-12-25
上一篇,学习了copy_file_range()的历史,以及内部原理,同时还提到了和sendfile()的差异。本篇学习另外2个实现零拷贝的系统调用sendfile()和splice()。简介sendfile()的函数原型【1】ssize_t sendfile(int out_fd, int in_

database fragmentation and vacuum
2026-1-30
最近的项目中,出现数据库搜索很慢,本地确没有问题,上去分析发现,数据库文件碎片化了。由于数据库是放在磁盘上的,碎片化之后,遍历数据库就相当于随机访问磁盘,速度就很慢。使用filefrag命令查看碎片化:$ filefrag u3049499598-7cb394645c881238-v0.dbu304

Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.