Lines Matching refs:fl
38 struct flock fl;
39 fl.l_type = F_WRLCK; // Exclusive write lock
40 fl.l_whence = SEEK_SET; // Starting from beginning of file
41 fl.l_start = 0; // Starting from offset 0
42 fl.l_len = 0; // Lock whole file
43 fl.l_pid = getpid(); // PID of process holding the lock
45 if (fcntl(fd, F_SETLK, &fl) == -1) {
64 struct flock fl;
65 fl.l_type = F_UNLCK; // Unlock the file
66 fl.l_whence = SEEK_SET; // Starting from beginning of file
67 fl.l_start = 0; // Starting from offset 0
68 fl.l_len = 0; // Unlock whole file
70 if (fcntl(fd, F_SETLK, &fl) == -1) {