It does not appear that there is a fcntl64() function in glibc, so I think the workaround would have to use syscall(). There is a struct flock64 in the header files (for use with F_SETLK64 and friends, I think). Passing this to unmodified fcntl() currently works on 32-bit Linux, but that seems like a bad workaround because it depends on the buggy behavior. If the glibc bug is fixed in the future, glibc would be committing an aliasing violation reading values from a struct flock64 as a struct flock. In practice it would probably just read the same zero offsets as we want to set in the first place, though. As an alternative, we could disable OFD locking on 32-bit Linux, and later re-enable it with a __GLIBC_PREREQ() check when there a fixed version. But there's a chance that the upstream bug will never be fixed because of compatibility concerns, and it would be a shame to never get OFD locking on 32-bit Linux.