val debug : bool
module File_descr : Core.Std.Unix.File_descr
module Kind : sig .. end
type t = 
|Char
|Fifo
|File
|Socket of [ `Active | `Bound | `Passive | `Unconnected ]
val sexp_of_t : t -> Sexplib.Sexp.t
module State : sig .. end
type t = 
|Close_requested of unit -> unit Import.Deferred.t
|Closed
|Open of unit Import.Ivar.t
val sexp_of_t : t -> Sexplib.Sexp.t
val transition_is_allowed : t -> t -> bool
val is_open : t -> bool
type ready_to_result = [ `Bad_fd | `Closed | `Interrupted | `Ready ]
val sexp_of_ready_to_result : ready_to_result -> Sexplib.Sexp.t
module Watching : sig .. end
type t = 
|Not_watching
|Watch_once of ready_to_result Import.Ivar.t
|Watch_repeatedly of Async_kernel.Jobs.Job.t * [ `Bad_fd | `Closed | `Interrupted ] Import.Ivar.t
|Stop_requested
val sexp_of_t : t -> Sexplib.Sexp.t
val invariant : t -> unit
module T : sig .. end
type t = {
file_descr : File_descr.t;
mutable info : Core.Std.Info.t;
mutable kind : Kind.t;
mutable supports_nonblock : bool;
mutable have_set_nonblock : bool;
mutable state : State.t;
watching : Watching.t Read_write.Mutable.t;
mutable watching_has_changed : bool;
mutable num_active_syscalls : int;
close_finished : unit Import.Ivar.t;
}
val sexp_of_t : t -> Sexplib.Sexp.t
val close_finished : t -> unit Import.Ivar.t
val num_active_syscalls : t -> int
val set_num_active_syscalls : t -> int -> unit
val watching_has_changed : t -> bool
val set_watching_has_changed : t -> bool -> unit
val watching : t -> Watching.t Read_write.Mutable.t
val state : t -> State.t
val set_state : t -> State.t -> unit
val have_set_nonblock : t -> bool
val set_have_set_nonblock : t -> bool -> unit
val supports_nonblock : t -> bool
val set_supports_nonblock : t -> bool -> unit
val kind : t -> Kind.t
val set_kind : t -> Kind.t -> unit
val info : t -> Core.Std.Info.t
val set_info : t -> Core.Std.Info.t -> unit
val file_descr : t -> File_descr.t
module Fields : sig .. end
val names : string list
val close_finished : ([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
Fieldslib.Field.t_with_perm
val num_active_syscalls : ([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm
val watching_has_changed : ([< `Read | `Set_and_create ], t, bool) Fieldslib.Field.t_with_perm
val watching : ([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
Fieldslib.Field.t_with_perm
val state : ([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm
val have_set_nonblock : ([< `Read | `Set_and_create ], t, bool) Fieldslib.Field.t_with_perm
val supports_nonblock : ([< `Read | `Set_and_create ], t, bool) Fieldslib.Field.t_with_perm
val kind : ([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm
val info : ([< `Read | `Set_and_create ], t, Core.Std.Info.t)
Fieldslib.Field.t_with_perm
val file_descr : ([< `Read | `Set_and_create ], t, File_descr.t) Fieldslib.Field.t_with_perm
val make_creator : file_descr:(([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> 'a -> ('b -> File_descr.t) * 'c) ->
info:(([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> 'c -> ('b -> Core.Std.Info.t) * 'd) ->
kind:(([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      'd -> ('b -> Kind.t) * 'e) ->
supports_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> 'e -> ('b -> bool) * 'f) ->
have_set_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> 'f -> ('b -> bool) * 'g) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       'g -> ('b -> State.t) * 'h) ->
watching:(([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm ->
          'h -> ('b -> Watching.t Read_write.Mutable.t) * 'i) ->
watching_has_changed:(([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> 'i -> ('b -> bool) * 'j) ->
num_active_syscalls:(([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> 'j -> ('b -> int) * 'k) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm ->
                'k -> ('b -> unit Import.Ivar.t) * 'l) ->
'a -> ('b -> t) * 'l
val create : file_descr:File_descr.t ->
info:Core.Std.Info.t ->
kind:Kind.t ->
supports_nonblock:bool ->
have_set_nonblock:bool ->
state:State.t ->
watching:Watching.t Read_write.Mutable.t ->
watching_has_changed:bool ->
num_active_syscalls:int -> close_finished:unit Import.Ivar.t -> t
val map : file_descr:(([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> File_descr.t) ->
info:(([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> Core.Std.Info.t) ->
kind:(([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      Kind.t) ->
supports_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> bool) ->
have_set_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> bool) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       State.t) ->
watching:(([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm -> Watching.t Read_write.Mutable.t) ->
watching_has_changed:(([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> bool) ->
num_active_syscalls:(([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> int) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> unit Import.Ivar.t) ->
t
val iter : file_descr:(([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> 'a) ->
info:(([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> 'b) ->
kind:(([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      'c) ->
supports_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> 'd) ->
have_set_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> 'e) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       'f) ->
watching:(([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm -> 'g) ->
watching_has_changed:(([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> 'h) ->
num_active_syscalls:(([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> 'i) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> 'j) ->
'j
val fold : init:'a ->
file_descr:('a ->
            ([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> 'b) ->
info:('b ->
      ([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> 'c) ->
kind:('c ->
      ([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      'd) ->
supports_nonblock:('d ->
                   ([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> 'e) ->
have_set_nonblock:('e ->
                   ([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> 'f) ->
state:('f ->
       ([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       'g) ->
watching:('g ->
          ([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm -> 'h) ->
watching_has_changed:('h ->
                      ([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> 'i) ->
num_active_syscalls:('i ->
                     ([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> 'j) ->
close_finished:('j ->
                ([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> 'k) ->
'k
val map_poly : ([< `Read | `Set_and_create ], t, 'a) Fieldslib.Field.user -> 'a list
val for_all : file_descr:(([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> bool) ->
info:(([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> bool) ->
kind:(([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      bool) ->
supports_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> bool) ->
have_set_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> bool) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       bool) ->
watching:(([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm -> bool) ->
watching_has_changed:(([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> bool) ->
num_active_syscalls:(([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> bool) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> bool) ->
bool
val exists : file_descr:(([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> bool) ->
info:(([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> bool) ->
kind:(([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      bool) ->
supports_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> bool) ->
have_set_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> bool) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       bool) ->
watching:(([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm -> bool) ->
watching_has_changed:(([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> bool) ->
num_active_syscalls:(([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> bool) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> bool) ->
bool
val to_list : file_descr:(([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> 'a) ->
info:(([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> 'a) ->
kind:(([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      'a) ->
supports_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> 'a) ->
have_set_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> 'a) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       'a) ->
watching:(([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm -> 'a) ->
watching_has_changed:(([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> 'a) ->
num_active_syscalls:(([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> 'a) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> 'a) ->
'a list
module Direct : sig .. end
val iter : t ->
file_descr:(([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> t -> File_descr.t -> 'a) ->
info:(([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> t -> Core.Std.Info.t -> 'b) ->
kind:(([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      t -> Kind.t -> 'c) ->
supports_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> t -> bool -> 'd) ->
have_set_nonblock:(([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> t -> bool -> 'e) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       t -> State.t -> 'f) ->
watching:(([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm ->
          t -> Watching.t Read_write.Mutable.t -> 'g) ->
watching_has_changed:(([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> t -> bool -> 'h) ->
num_active_syscalls:(([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> t -> int -> 'i) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> t -> unit Import.Ivar.t -> 'j) ->
'j
val fold : t ->
init:'a ->
file_descr:('a ->
            ([< `Read | `Set_and_create ], t, File_descr.t)
            Fieldslib.Field.t_with_perm -> t -> File_descr.t -> 'b) ->
info:('b ->
      ([< `Read | `Set_and_create ], t, Core.Std.Info.t)
      Fieldslib.Field.t_with_perm -> t -> Core.Std.Info.t -> 'c) ->
kind:('c ->
      ([< `Read | `Set_and_create ], t, Kind.t) Fieldslib.Field.t_with_perm ->
      t -> Kind.t -> 'd) ->
supports_nonblock:('d ->
                   ([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> t -> bool -> 'e) ->
have_set_nonblock:('e ->
                   ([< `Read | `Set_and_create ], t, bool)
                   Fieldslib.Field.t_with_perm -> t -> bool -> 'f) ->
state:('f ->
       ([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       t -> State.t -> 'g) ->
watching:('g ->
          ([< `Read | `Set_and_create ], t, Watching.t Read_write.Mutable.t)
          Fieldslib.Field.t_with_perm ->
          t -> Watching.t Read_write.Mutable.t -> 'h) ->
watching_has_changed:('h ->
                      ([< `Read | `Set_and_create ], t, bool)
                      Fieldslib.Field.t_with_perm -> t -> bool -> 'i) ->
num_active_syscalls:('i ->
                     ([< `Read | `Set_and_create ], t, int)
                     Fieldslib.Field.t_with_perm -> t -> int -> 'j) ->
close_finished:('j ->
                ([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> t -> unit Import.Ivar.t -> 'k) ->
'k
include T
val equal : t -> t -> bool
val invariant : t -> unit
val to_int : t -> int
val create : ?avoid_nonblock_if_possible:bool ->
Kind.t -> File_descr.t -> Core.Std.Info.t -> t
val inc_num_active_syscalls : t -> [> `Already_closed | `Ok ]
val set_state : t -> State.t -> unit
val is_open : t -> bool
val is_closed : t -> bool
val set_nonblock_if_necessary : ?nonblocking:bool -> t -> unit
val with_file_descr_exn : ?nonblocking:bool -> t -> (File_descr.t -> 'a) -> 'a
val with_file_descr : ?nonblocking:bool ->
t -> (File_descr.t -> 'a) -> [> `Already_closed | `Error of exn | `Ok of 'a ]
val syscall : ?nonblocking:bool ->
t -> (File_descr.t -> 'a) -> [> `Already_closed | `Error of exn | `Ok of 'a ]
val syscall_exn : ?nonblocking:bool -> t -> (File_descr.t -> 'a) -> 'a