Skip to content

Commit

Permalink
Always use 64-bit file offsets
Browse files Browse the repository at this point in the history
Previously, OFD locking was broken on 32-bit, because it would somehow
end up using the 64-bit fcntl() function, but pass it 32-bit off_t
values in struct flock.  To fix this, tell libc to use always use
64-bit file offsets.

This is the same fix that was applied for a similar issue in GHC[1].

[1]: https://gitlab.haskell.org/ghc/ghc/-/commit/9853fc5e3556e733b56976b0a2fce9e82130a9ef

Fixes: haskellari#15
  • Loading branch information
alyssais committed Dec 29, 2022
1 parent 38e20c8 commit 4e69ffa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src-ofd/Lukko/OFD.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module Lukko.OFD (
hUnlock,
) where

#define _FILE_OFFSET_BITS 64
#define _GNU_SOURCE
#include <unistd.h>

Expand Down

0 comments on commit 4e69ffa

Please sign in to comment.