flock 文件锁 flock -x ./lock dd 结束前 flock -x ./lock ls 会一直等待也有对应的api flock int flock(int fd, int operation);