[llvm] [CAS] Add MappedFileRegionArena (PR #114099)

Rainer Orth via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 10:55:47 PDT 2025


rorth wrote:

> There's something very wrong here: Solaris has neither `flock` nor `LOCK_SH` anywhere in the system headers. No idea yet where this is from, though. Recompiling `llvm/lib/CAS/OnDiskCommon.cpp` with `-g3 -dD -save-temps` confirms this: `HAVE_FLOCK` is 0, as expected.

... which explains what's going on: I searched for `ENOLCK`, but `lockFileThreadSafe` returns `std::errc::no_lock_available` if `!HAVE_FLOCK`.  This is blatently wrong: `flock` is a non-portable BSD extension.  POSIX.1 only specifies `fcntl(..., F_SETLK)` and friends.  Have a look at `gnulib` `lib/flock.c`.

https://github.com/llvm/llvm-project/pull/114099


More information about the llvm-commits mailing list