in reply to Re^2: Testing if your code successfully flocked
in thread Testing if your code successfully flocked

For a work-around, I guess unlocking the file in the child process, and then re-issuing the flock() /should/ work, but to be 100% certain, close() and re-open the file in the child process.

Update: Interestingly, on linux the above code outputs

1 0

So there the lock seems to be associated with the handle, not the file.