package posix-time2

  1. Overview
  2. Docs
Bindings for posix time functions

Install

Dune Dependency

Authors

Maintainers

Sources

v2.0.0.tar.gz
md5=2c186aa5161b72208a870d5710fb6208
sha512=d583c3d386865eab7575fc4f1976c17294bad2ee5037327cb5c3075965788170e652b7b9b9f660ef25f71558553fbcc47734b971e3c9f41627cc573d75d2fb54

doc/src/posix-time2.stubs/posix_time2_stubs.ml.html

Source file posix_time2_stubs.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
open Ctypes

module Def (F : Cstubs.FOREIGN) = struct
  open F
  module Types = Posix_time2_types.Def (Posix_time2_generated_types)
  open Types

  let asctime = foreign "asctime" (ptr Tm.t @-> returning string)

  let clock_getres =
    foreign "clock_getres"
      (Posix_types.clockid_t @-> ptr Timespec.t @-> returning int)

  let clock_gettime =
    foreign "clock_gettime"
      (Posix_types.clockid_t @-> ptr Timespec.t @-> returning int)

  let clock_settime =
    foreign "clock_settime"
      (Posix_types.clockid_t @-> ptr Timespec.t @-> returning int)

  let ctime = foreign "ctime" (Posix_types.time_t @-> returning string)
  let gmtime = foreign "gmtime" (Posix_types.time_t @-> returning (ptr Tm.t))

  let localtime =
    foreign "localtime" (Posix_types.time_t @-> returning (ptr Tm.t))

  let mktime = foreign "mktime" (ptr Tm.t @-> returning Posix_types.time_t)

  let nanosleep =
    foreign "nanosleep" (ptr Timespec.t @-> ptr void @-> returning int)

  let getitimer = foreign "getitimer" (int @-> ptr Itimerval.t @-> returning int)

  let setitimer =
    foreign "setitimer"
      (int @-> ptr Itimerval.t @-> ptr Itimerval.t @-> returning int)

  let gettimeofday =
    foreign "gettimeofday" (ptr Timeval.t @-> ptr void @-> returning int)

  let fd_zero =
    foreign "ocaml_posix_time2_fd_zero"
      (ptr Posix_time2_types.fd_set @-> returning void)

  let fd_set =
    foreign "ocaml_posix_time2_fd_set"
      (int @-> ptr Posix_time2_types.fd_set @-> returning void)

  let fd_isset =
    foreign "ocaml_posix_time2_fd_isset"
      (int @-> ptr Posix_time2_types.fd_set @-> returning int)

  let fd_clr =
    foreign "ocaml_posix_time2_fd_clr"
      (int @-> ptr Posix_time2_types.fd_set @-> returning void)

  let select =
    foreign "select"
      ( int
      @-> ptr Posix_time2_types.fd_set
      @-> ptr Posix_time2_types.fd_set
      @-> ptr Posix_time2_types.fd_set
      @-> ptr Timeval.t @-> returning int )

  let utimes = foreign "utimes" (string @-> ptr Timeval.t @-> returning int)
end
OCaml

Innovation. Community. Security.