POSIX lock semantics (continued).
- Killer issue : POSIX locks are per process, not per file descriptor.
- Eg:
int fd1 = open("/tmp/bibble", O_RDWR); fcntl(fd1, F_SETLK, &lock_struct); fd2 = dup(fd1); close(fd2);
SURPRISE ! The lock you thought you had on fd1 is now gone ! In anyones wildest dreams this is not desirable behavior.
Notes:
No notes for slide 16