as if 2 forks could print to the fh, regardless of the lock on itThis is exactly how it works. Manpage:
Locks created by flock() are associated with an open file table entry. This means that duplicate file descriptors (created by, for example, fork(2) or dup(2)) refer to the same lock, and this lock may be modified or released using any of these descriptors... Subsequent flock() calls on an already locked file will convert an existing lock to the new lock mode.If you don't understand this stuff - descriptors, file table entries - don't worry... the short answer is: yes, forks do that.
In reply to Re^2: Question about flock and printing to file
by Anonymous Monk
in thread Question about flock and printing to file
by deruytja
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |