Skip to content

Instantly share code, notes, and snippets.

@deeev-sb
Created May 6, 2020 18:46
Show Gist options
  • Save deeev-sb/3b6be61de9b4a2fba02b7c0c9be61df2 to your computer and use it in GitHub Desktop.
Save deeev-sb/3b6be61de9b4a2fba02b7c0c9be61df2 to your computer and use it in GitHub Desktop.
struct flock {
......
short l_type; // type of lock : F_RDLCK, F_WRLCK, F_UNLCK
// F_RDLCK : reader's lock
// F_WRLCK : writer's lock
// F_UNLCK : unlock
short l_whence; // SEEK_SET, SEEK_CUR, SEEK_END
off_t l_start; // lock start position
off_t l_len; // lock region length ( 0 for entire file)
pid_t l_pid; // pid of a process that has a lock (used only in F_GETLK)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment