揮発性のメモ2

http://d.hatena.ne.jp/iww/

2018-08-25から1日間の記事一覧

flock

ファイルロックを使ったプロセス間での排他制御 // gcc -Wall -lpthread test_flock.c #include <fcntl.h> // O_CREAT #include <sys/file.h> // flock #include <stdio.h> // printf #include <unistd.h> // sleep int main() { int fd = open("/tmp/hoge", O_CREAT, 0600); printf("ロック\n"); flo</unistd.h></stdio.h></sys/file.h></fcntl.h>…