https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66005
--- Comment #15 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- > --- Comment #14 from Thomas Schwinge <tschwinge at gcc dot gnu.org> --- > (In reply to Eric Gallager from comment #12) >> Note that there's a gnulib module for flock: >> https://www.gnu.org/software/gnulib/manual/html_node/flock.html > > I'd see that one -- but it also says: "the replacement function does not > really > work", so I don't think that's useful? Besides, this only provides a replacement for the system call; we'd still have to implement flock(1) ourselves and I'd rather not see us go there. > (In reply to Jakub Jelinek from comment #13) >> And fcntl in tclx. > > Seen that, too -- but is TclX something that people actually have > available/installed? (Rainer?) It's not available in packaged form on any of the targets I mentioned (Solaris, macOS, AIX). Besides, adding something like this feels quite heavy-handed to me. >> Anyway, I think choosing between flock(1) and some >> python file locking would be better than using perl which is only needed in >> maintainer mode and not otherwise. > > Rainer, would a 'python3' variant work for you? Not really: python3 isn't available on older macOS systems, and again: adding a python requirement (even for python2 in such a limited case) seems to go overboard to me. While I personally don't have a problem with requiring perl (it's needed to support shared library versioning on Solaris), the same argument applies. My strong preference would be to use Tcl core means only, thus adding no additional requirement. I found a couple of suggestions on how to do this: https://wiki.tcl-lang.org/page/How+do+I+manage+lock+files+in+a+cross+platform+manner+in+Tcl https://wiki.tcl-lang.org/page/Serializing+things+via+file+locks effectively matching Jakub's suggestion.