HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulelukko-0.1.2Haskell2010

Lukko.OFD

Linux open file descriptor locking.

https://www.gnu.org/software/libc/manual/html_node/Open-File-Description-Locks.html

We prefer this over BSD locking (e.g. flock) since the latter appears to break in some NFS configurations. Note that we intentionally do not try to use ordinary POSIX file locking due to its peculiar semantics under multi-threaded environments.

  • 5 types
  • 10 values
  • Packagelukko-0.1.2
  • Exports15
  • LanguageHaskell2010
  • LicenceGPL-2.0-or-later AND BSD-3-Clause
  • SourceOFD.hsc

Types

6 declarations
datadata FileLockingMethod
#

Potentially availble lock methods.

Constructors

Instances5Bounded, Enum, Eq, Ord, Show

File descriptors

6 declarations
newtypenewtype FD
#

Opaque file descriptor

This is a wrapper over CInt

valuefdOpen :: FilePath -> IO FD
#

Open file to be used for locking.

open(path, O_RDWR | O_CREAT);
valuefdClose :: FD -> IO ()
#

Close lock file.

close(fd);

Handles

3 declarations