Right, only that for a correct flock() emulation you'd also have to
hold the necessary locks to prevent another thread from seeking
away between the two calls... ideally something that is independent
of the namei locking. And the code would gain in readability had
the ifdefs been packed into a macro or subroutine.
In this precise context however, and without wiping cleaner than
clean: why spend yet another system call on something that nobody
cares about.
Hmm. Would it be advisable to switch to using flock or fcntl-style
lock calls on systems which support it for full-file-locks rather
than do the seek()/lock()? At least on Solaris, you should be able
to do an fcntl-style lock specifying the whole file in an atomic step...
-rob
_______________________________________________
OpenAFS-info mailing list
OpenAFS-info@openafs.org
https://lists.openafs.org/mailman/listinfo/openafs-info