Source file ffi_bindings.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
open Ctypes
module Types (F: Cstubs.Types.TYPE) = struct
open F
module Lock_operation = struct
let lock_shared = constant "LOCK_SH" int
let lock_exclusive = constant "LOCK_EX" int
let lock_unlock = constant "LOCK_UN" int
let lock_nonblocking = constant "LOCK_NB" int
end
end
module Bindings (F : Cstubs.FOREIGN) = struct
open F
let flock = foreign "flock" (int @-> int @-> returning int)
end
module Foreign_bindings = struct
open Foreign
let flock = foreign "flock" ~check_errno:true (int @-> int @-> returning int)
end