Hrrm, that's weird because (quoting from APUE 1st ed, p373):
2. Locks are never inherited by the child across a fork. This means that if a process obtains a lock and then calls fork, the child is considered "another process" with regard to the lock that was obtained by the parent. The child has to call fcntl to obtain its own locks on any descriptors that were inherited across the fork. . . .
And I just looked and OS X has the same verbiage as FreeBSD does (not to surprising, of course :). This may be a BSD-vs-POSIX-vs-SysV thing; at any rate check your OS's flock(2) docs. (Heh. "flock doc" . . .)
--
We're looking for people in ATL
In reply to Re^2: Fork + Flock = Who Gets the Lock?
by Fletch
in thread Fork + Flock = Who Gets the Lock?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |