天天看點

flock 檔案鎖

flock -x ./lock dd 結束前 flock -x ./lock ls 會一直等待

也有對應的api flock int flock(int fd, int operation);