Just a curious question: Why did you chose mkdir for locking and not touch, i.e. why do you lock with a directory and not an empty file? Is there any reason behind it or was it just by chance?
open(2) with O_CREAT|O_EXCL and mkdir(2) are very similar for this purpose. open(2) without O_EXCL does of course not work.
I believe mkdir became the preferred way due to some bugs in networked FSs (directories and files are handled very differently due to different caching strategies, I think apart from that Linux had some bugs as well).
Note: there is a mailing list as well.
attic had posix locking, but that is problematic even on UNIX platforms (and does not exist on windows filesystems). there were numerous issues on the attic issue tracker due to it. and "issue" basically meant "game over".
I looked around for locking libraries and checked how they do it.
I found a handful, but nothing looked like we could just use it.
So, reinvented the wheel again (rounder version) and just took the mkdir locking as seen in some others for its cross-platform compatibility and simplicity.
Thanks for you reply. I don't like mailing lists, but GitHub issues tagged with "question" are also okay, IMHO.