46 area.l_whence = SEEK_SET;
47 area.l_len = area.l_start = 0L;
49 return fcntl(
fd, cmd, &area);
63 pthread_t child_thread;
65 fd = open(
"my.LCK", (O_CREAT|O_RDWR), 0666);
70 yaz_log(YLOG_FATAL|YLOG_ERRNO,
"open");
78 yaz_log(YLOG_FATAL|YLOG_ERRNO,
"fcnt");
83 pthread_create(&child_thread, 0 ,
run_func, 0);
84 pthread_join(child_thread, 0);
86 yaz_log(YLOG_LOG,
"fcntl lock scope: %s",
scope);
89 int main(
int argc,
char **argv)
91 YAZ_CHECK_INIT(argc, argv);
int main(int argc, char **argv)
static int file_lock(int fd, int type, int cmd)
void * run_func(void *arg)