sig
module File_descr :
sig
type t = Caml.Unix.file_descr
type hashable = t
val equal : hashable -> hashable -> bool
val hash : hashable -> int
module Table :
sig
type key = hashable
type 'a t
module T : sig type 'a key = key type ('a, 'b) t = 'b t end
val create : int -> 'a t
val clear : 'a t -> unit
val copy : 'a t -> 'a t
val shadow_add : 'a t -> key:key -> data:'a -> unit
val remove : 'a t -> key -> unit
val shadow_find : 'a t -> key -> 'a list
val replace : 'a t -> key:key -> data:'a -> unit
val mem : 'a t -> key -> bool
val iter : 'a t -> f:(key:key -> data:'a -> unit) -> unit
val fold :
'a t -> init:'b -> f:(key:key -> data:'a -> 'b -> 'b) -> 'b
val length : 'a t -> int
val map : 'a t -> f:('a -> 'b) -> 'b t
val mapi : 'a t -> f:(key:key -> data:'a -> 'b) -> 'b t
val filter_map : 'a t -> f:('a -> 'b option) -> 'b t
val filter_mapi :
'a t -> f:(key:key -> data:'a -> 'b option) -> 'b t
val remove_all : 'a t -> key -> unit
val find_default : 'a t -> key -> default:(unit -> 'a) -> 'a
val find : 'a t -> key -> 'a option
val find_exn : 'a t -> key -> 'a
val iter_vals : 'a t -> f:('a -> unit) -> unit
val of_alist :
(key * 'a) list -> [ `Duplicate_key of key | `Ok of 'a t ]
val of_alist_exn : (key * 'a) list -> 'a t
val of_alist_shadow : (key * 'a) list -> 'a list t
val to_alist : 'a t -> (key * 'a) list
val to_alist_shadow : 'a t -> (key * 'a list) list
val merge :
f:(key:key -> 'a option -> 'b option -> 'c option) ->
'a t -> 'b t -> 'c t
val keys : 'a t -> key list
val data : 'a t -> 'a list
val filter_inplace : 'a t -> f:('a -> bool) -> unit
val filteri_inplace : 'a t -> f:(key -> 'a -> bool) -> unit
val equal : 'a t -> 'a t -> ('a -> 'a -> bool) -> bool
val add_to_groups :
'a t ->
get_key:('b -> key) ->
get_data:('b -> 'a) ->
combine:('a -> 'a -> 'a) -> rows:'b list -> unit
val group :
?size:int ->
get_key:('a -> key) ->
get_data:('a -> 'b) ->
combine:('b -> 'b -> 'b) -> 'a list -> 'b t
val create_with_key : get_key:('a -> key) -> 'a list -> 'a t
val create_mapped :
get_key:('a -> key) -> get_data:('a -> 'b) -> 'a list -> 'b t
type 'a sexpable = 'a t
val sexp_of_t :
('a -> Sexplib.Sexp.t) -> 'a sexpable -> Sexplib.Sexp.t
val t_of_sexp :
(Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a sexpable
end
module Hash_set :
sig
type elt = hashable
type t
module T : sig type 'a elt = elt type 'a t = t end
val create : int -> t
val add : t -> elt -> unit
val strict_add : t -> elt -> unit
val remove : t -> elt -> unit
val strict_remove : t -> elt -> unit
val clear : t -> unit
val fold : f:('a -> elt -> 'a) -> init:'a -> t -> 'a
val iter : f:(elt -> unit) -> t -> unit
val length : t -> int
val mem : t -> elt -> bool
val is_empty : t -> bool
val of_list : elt list -> t
val to_list : t -> elt list
val equal : t -> t -> bool
val sexp_of_t : t -> Sexplib.Sexp.t
val t_of_sexp : Sexplib.Sexp.t -> t
end
module Hash_queue :
sig
module Key :
sig
type t = hashable
val equal : t -> t -> bool
val hash : t -> int
type sexpable = t
val sexp_of_t : sexpable -> Sexplib.Sexp.t
val t_of_sexp : Sexplib.Sexp.t -> sexpable
end
type 'a t
type 'a container = 'a t
val length : 'a container -> int
val is_empty : 'a container -> bool
val iter : 'a container -> f:('a -> unit) -> unit
val fold : 'a container -> init:'b -> f:('b -> 'a -> 'b) -> 'b
val exists : 'a container -> f:('a -> bool) -> bool
val for_all : 'a container -> f:('a -> bool) -> bool
val find : 'a container -> f:('a -> bool) -> 'a option
val to_list : 'a container -> 'a list
val to_array : 'a container -> 'a array
val container : ('a, 'a container) Container.type_class
val invariant : 'a t -> unit
val create : unit -> 'a t
val clear : 'a t -> unit
val mem : 'a t -> Key.t -> bool
val lookup : 'a t -> Key.t -> 'a option
val lookup_exn : 'a t -> Key.t -> 'a
val enqueue : 'a t -> Key.t -> 'a -> [ `Key_already_present | `Ok ]
val enqueue_exn : 'a t -> Key.t -> 'a -> unit
val dequeue : 'a t -> 'a option
val dequeue_exn : 'a t -> 'a
val dequeue_with_key : 'a t -> (Key.t * 'a) option
val dequeue_with_key_exn : 'a t -> Key.t * 'a
val dequeue_all : 'a t -> f:('a -> unit) -> unit
val remove : 'a t -> Key.t -> [ `No_such_key | `Ok ]
val remove_exn : 'a t -> Key.t -> unit
val replace : 'a t -> Key.t -> 'a -> [ `No_such_key | `Ok ]
val replace_exn : 'a t -> Key.t -> 'a -> unit
val iteri : 'a t -> f:(key:Key.t -> data:'a -> unit) -> unit
val foldi :
'a t -> init:'b -> f:('b -> key:Key.t -> data:'a -> 'b) -> 'b
end
module Hash_heap :
sig
module Key :
sig
type t = hashable
val equal : t -> t -> bool
val hash : t -> int
type sexpable = t
val sexp_of_t : sexpable -> Sexplib.Sexp.t
val t_of_sexp : Sexplib.Sexp.t -> sexpable
end
type 'a t
val create : ?min_size:int -> ('a -> 'a -> int) -> 'a t
val copy : 'a t -> 'a t
val push :
'a t -> key:Key.t -> data:'a -> [ `Key_already_present | `Ok ]
val push_exn : 'a t -> key:Key.t -> data:'a -> unit
val replace : 'a t -> key:Key.t -> data:'a -> unit
val remove : 'a t -> Key.t -> unit
val mem : 'a t -> Key.t -> bool
val top : 'a t -> 'a option
val top_exn : 'a t -> 'a
val top_with_key : 'a t -> (Key.t * 'a) option
val top_with_key_exn : 'a t -> Key.t * 'a
val pop_with_key : 'a t -> (Key.t * 'a) option
val pop_with_key_exn : 'a t -> Key.t * 'a
val pop : 'a t -> 'a option
val pop_exn : 'a t -> 'a
val cond_pop_with_key :
'a t -> (key:Key.t -> data:'a -> bool) -> (Key.t * 'a) option
val cond_pop : 'a t -> ('a -> bool) -> 'a option
val find : 'a t -> Key.t -> 'a option
val find_pop : 'a t -> Key.t -> 'a option
val find_exn : 'a t -> Key.t -> 'a
val find_pop_exn : 'a t -> Key.t -> 'a
val iter : 'a t -> f:(key:Key.t -> data:'a -> unit) -> unit
val iter_vals : 'a t -> f:('a -> unit) -> unit
end
type sexpable = t
val sexp_of_t : sexpable -> Sexplib.Sexp.t
val t_of_sexp : Sexplib.Sexp.t -> sexpable
val to_int : Unix.File_descr.t -> int
val to_string : Unix.File_descr.t -> string
val sexp_of_t : Unix.File_descr.t -> Sexplib.Sexp.t
end
type error =
Unix.error =
E2BIG
| EACCES
| EAGAIN
| EBADF
| EBUSY
| ECHILD
| EDEADLK
| EDOM
| EEXIST
| EFAULT
| EFBIG
| EINTR
| EINVAL
| EIO
| EISDIR
| EMFILE
| EMLINK
| ENAMETOOLONG
| ENFILE
| ENODEV
| ENOENT
| ENOEXEC
| ENOLCK
| ENOMEM
| ENOSPC
| ENOSYS
| ENOTDIR
| ENOTEMPTY
| ENOTTY
| ENXIO
| EPERM
| EPIPE
| ERANGE
| EROFS
| ESPIPE
| ESRCH
| EXDEV
| EWOULDBLOCK
| EINPROGRESS
| EALREADY
| ENOTSOCK
| EDESTADDRREQ
| EMSGSIZE
| EPROTOTYPE
| ENOPROTOOPT
| EPROTONOSUPPORT
| ESOCKTNOSUPPORT
| EOPNOTSUPP
| EPFNOSUPPORT
| EAFNOSUPPORT
| EADDRINUSE
| EADDRNOTAVAIL
| ENETDOWN
| ENETUNREACH
| ENETRESET
| ECONNABORTED
| ECONNRESET
| ENOBUFS
| EISCONN
| ENOTCONN
| ESHUTDOWN
| ETOOMANYREFS
| ETIMEDOUT
| ECONNREFUSED
| EHOSTDOWN
| EHOSTUNREACH
| ELOOP
| EOVERFLOW
| EUNKNOWNERR of int
exception Unix_error of Unix.error * string * string
val error_message : Unix.error -> string
val handle_unix_error : ('a -> 'b) -> 'a -> 'b
val environment : unit -> string array
val getenv : string -> string option
val getenv_exn : string -> string
val putenv : key:string -> data:string -> unit
module Process_status :
sig
type t =
[ `Exited of int | `Signaled of Signal.t | `Stopped of Signal.t ]
val sexp_of_t : Unix.Process_status.t -> Sexplib.Sexp.t
val t_of_sexp : Sexplib.Sexp.t -> Unix.Process_status.t
val t_of_sexp__ : Sexplib.Sexp.t -> Unix.Process_status.t
val is_ok : Unix.Process_status.t -> bool
val of_unix : Caml.Unix.process_status -> Unix.Process_status.t
val to_string_hum : Unix.Process_status.t -> string
end
type wait_flag = Unix.wait_flag = WNOHANG | WUNTRACED
val execv : prog:string -> args:string array -> 'a
val execve : prog:string -> args:string array -> env:string array -> 'a
val execvp : prog:string -> args:string array -> 'a
val execvpe : prog:string -> args:string array -> env:string array -> 'a
val fork : unit -> int
val wait : unit -> int * Unix.Process_status.t
val waitpid :
?restart:bool ->
mode:Unix.wait_flag list -> int -> int * Unix.Process_status.t
val system : string -> Unix.Process_status.t
val getpid : unit -> int
val getppid : unit -> int
val nice : int -> int
type file_descr = Unix.file_descr
val stdin : Unix.file_descr
val stdout : Unix.file_descr
val stderr : Unix.file_descr
type open_flag =
Unix.open_flag =
O_RDONLY
| O_WRONLY
| O_RDWR
| O_NONBLOCK
| O_APPEND
| O_CREAT
| O_TRUNC
| O_EXCL
| O_NOCTTY
| O_DSYNC
| O_SYNC
| O_RSYNC
type file_perm = int
val openfile :
string ->
mode:Unix.open_flag list ->
perm:Unix.file_perm -> Unix.file_descr
val close : Unix.file_descr -> unit
val read : Unix.file_descr -> buf:string -> pos:int -> len:int -> int
val write : Unix.file_descr -> buf:string -> pos:int -> len:int -> int
val single_write :
Unix.file_descr -> buf:string -> pos:int -> len:int -> int
val in_channel_of_descr : Unix.file_descr -> Pervasives.in_channel
val out_channel_of_descr : Unix.file_descr -> Pervasives.out_channel
val descr_of_in_channel : Pervasives.in_channel -> Unix.file_descr
val descr_of_out_channel : Pervasives.out_channel -> Unix.file_descr
type seek_command = Unix.seek_command = SEEK_SET | SEEK_CUR | SEEK_END
val lseek :
Unix.file_descr -> int64 -> mode:Unix.seek_command -> int64
val truncate : string -> len:int64 -> unit
val ftruncate : Unix.file_descr -> len:int64 -> unit
type file_kind =
Unix.file_kind =
S_REG
| S_DIR
| S_CHR
| S_BLK
| S_LNK
| S_FIFO
| S_SOCK
val sexp_of_file_kind : Unix.file_kind -> Sexplib.Sexp.t
type stats =
Unix.LargeFile.stats = {
st_dev : int;
st_ino : int;
st_kind : Unix.file_kind;
st_perm : Unix.file_perm;
st_nlink : int;
st_uid : int;
st_gid : int;
st_rdev : int;
st_size : int64;
st_atime : float;
st_mtime : float;
st_ctime : float;
}
val stat : string -> Unix.stats
val lstat : string -> Unix.stats
val fstat : Unix.file_descr -> Unix.stats
module Native_file :
sig
type stats =
Unix.stats = {
st_dev : int;
st_ino : int;
st_kind : Unix.file_kind;
st_perm : Unix.file_perm;
st_nlink : int;
st_uid : int;
st_gid : int;
st_rdev : int;
st_size : int;
st_atime : float;
st_mtime : float;
st_ctime : float;
}
val stat : string -> Unix.Native_file.stats
val lstat : string -> Unix.Native_file.stats
val fstat : Unix.file_descr -> Unix.Native_file.stats
val lseek :
Unix.file_descr -> int -> mode:Unix.seek_command -> int
val truncate : string -> len:int -> unit
val ftruncate : Unix.file_descr -> len:int -> unit
end
type lock_command =
Unix.lock_command =
F_ULOCK
| F_LOCK
| F_TLOCK
| F_TEST
| F_RLOCK
| F_TRLOCK
val lockf :
Unix.file_descr ->
mode:Unix.lock_command -> len:Int64.t -> unit
val isatty : Unix.file_descr -> bool
val unlink : string -> unit
val rename : src:string -> dst:string -> unit
val link : src:string -> dst:string -> unit
val chmod : string -> perm:Unix.file_perm -> unit
val fchmod : Unix.file_descr -> perm:Unix.file_perm -> unit
val chown : string -> uid:int -> gid:int -> unit
val fchown : Unix.file_descr -> uid:int -> gid:int -> unit
val umask : int -> int
type access_permission = Unix.access_permission = R_OK | W_OK | X_OK | F_OK
val access : string -> perm:Unix.access_permission list -> unit
val dup : Unix.file_descr -> Unix.file_descr
val dup2 : src:Unix.file_descr -> dst:Unix.file_descr -> unit
val set_nonblock : Unix.file_descr -> unit
val clear_nonblock : Unix.file_descr -> unit
val set_close_on_exec : Unix.file_descr -> unit
val clear_close_on_exec : Unix.file_descr -> unit
val mkdir : string -> perm:Unix.file_perm -> unit
val rmdir : string -> unit
val chdir : string -> unit
val getcwd : unit -> string
val chroot : string -> unit
type dir_handle = Unix.dir_handle
val opendir : string -> Unix.dir_handle
val readdir : Unix.dir_handle -> string
val rewinddir : Unix.dir_handle -> unit
val closedir : Unix.dir_handle -> unit
val pipe : unit -> Unix.file_descr * Unix.file_descr
val mkfifo : string -> perm:Unix.file_perm -> unit
module Process_info :
sig
type t = {
pid : int;
stdin : Unix.file_descr;
stdout : Unix.file_descr;
stderr : Unix.file_descr;
}
end
val create_process :
prog:string -> args:string list -> Unix.Process_info.t
val create_process_env :
prog:string ->
args:string list ->
env:[ `Extend of (string * string) list
| `Replace of (string * string) list ] ->
Unix.Process_info.t
val open_process_in : string -> Pervasives.in_channel
val open_process_out : string -> Pervasives.out_channel
val open_process : string -> Pervasives.in_channel * Pervasives.out_channel
module Process_channels :
sig
type t = {
stdin : Pervasives.out_channel;
stdout : Pervasives.in_channel;
stderr : Pervasives.in_channel;
}
end
val open_process_full :
string -> env:string array -> Unix.Process_channels.t
val close_process_in : Pervasives.in_channel -> Unix.Process_status.t
val close_process_out :
Pervasives.out_channel -> Unix.Process_status.t
val close_process :
Pervasives.in_channel * Pervasives.out_channel ->
Unix.Process_status.t
val close_process_full :
Unix.Process_channels.t -> Unix.Process_status.t
val symlink : src:string -> dst:string -> unit
val readlink : string -> string
module Select_fds :
sig
type t = {
read : Unix.file_descr list;
write : Unix.file_descr list;
except : Unix.file_descr list;
}
val empty : Unix.Select_fds.t
end
val select :
read:Unix.file_descr list ->
write:Unix.file_descr list ->
except:Unix.file_descr list ->
timeout:float -> Unix.Select_fds.t
val pause : unit -> unit
type process_times =
Unix.process_times = {
tms_utime : float;
tms_stime : float;
tms_cutime : float;
tms_cstime : float;
}
type tm =
Unix.tm = {
tm_sec : int;
tm_min : int;
tm_hour : int;
tm_mday : int;
tm_mon : int;
tm_year : int;
tm_wday : int;
tm_yday : int;
tm_isdst : bool;
}
val time : unit -> float
val gettimeofday : unit -> float
val gmtime : float -> Unix.tm
val timegm : Unix.tm -> float
val localtime : float -> Unix.tm
val mktime : Unix.tm -> float * Unix.tm
val alarm : int -> int
val sleep : int -> unit
val times : unit -> Unix.process_times
val utimes : string -> access:float -> modif:float -> unit
type interval_timer =
Unix.interval_timer =
ITIMER_REAL
| ITIMER_VIRTUAL
| ITIMER_PROF
type interval_timer_status =
Unix.interval_timer_status = {
it_interval : float;
it_value : float;
}
val getitimer : Unix.interval_timer -> Unix.interval_timer_status
val setitimer :
Unix.interval_timer ->
Unix.interval_timer_status -> Unix.interval_timer_status
val getuid : unit -> int
val geteuid : unit -> int
val setuid : int -> unit
val getgid : unit -> int
val getegid : unit -> int
val setgid : int -> unit
val getgroups : unit -> int array
type passwd_entry =
Unix.passwd_entry = {
pw_name : string;
pw_passwd : string;
pw_uid : int;
pw_gid : int;
pw_gecos : string;
pw_dir : string;
pw_shell : string;
}
type group_entry =
Unix.group_entry = {
gr_name : string;
gr_passwd : string;
gr_gid : int;
gr_mem : string array;
}
val getlogin : unit -> string
val getpwnam : string -> Unix.passwd_entry
val getgrnam : string -> Unix.group_entry
val getpwuid : int -> Unix.passwd_entry
val getgrgid : int -> Unix.group_entry
type inet_addr = Unix.inet_addr
val bin_size_inet_addr : Unix.inet_addr Bin_prot.Size.sizer
val bin_write_inet_addr : Unix.inet_addr Bin_prot.Write_ml.writer
val bin_write_inet_addr_ :
Unix.inet_addr Bin_prot.Unsafe_write_c.writer
val bin_writer_inet_addr : Unix.inet_addr Bin_prot.Type_class.writer
val bin_read_inet_addr : Unix.inet_addr Bin_prot.Read_ml.reader
val bin_read_inet_addr_ : Unix.inet_addr Bin_prot.Unsafe_read_c.reader
val bin_read_inet_addr__ :
(int -> Unix.inet_addr) Bin_prot.Unsafe_read_c.reader
val bin_reader_inet_addr : Unix.inet_addr Bin_prot.Type_class.reader
val bin_inet_addr : Unix.inet_addr Bin_prot.Type_class.t
val sexp_of_inet_addr : Unix.inet_addr -> Sexplib.Sexp.t
val inet_addr_of_sexp : Sexplib.Sexp.t -> Unix.inet_addr
val inet_addr_of_string : string -> Unix.inet_addr
val string_of_inet_addr : Unix.inet_addr -> string
val inet_addr_any : Unix.inet_addr
val inet_addr_loopback : Unix.inet_addr
val inet6_addr_any : Unix.inet_addr
val inet6_addr_loopback : Unix.inet_addr
type socket_domain = Unix.socket_domain = PF_UNIX | PF_INET | PF_INET6
val bin_size_socket_domain : Unix.socket_domain Bin_prot.Size.sizer
val bin_write_socket_domain :
Unix.socket_domain Bin_prot.Write_ml.writer
val bin_write_socket_domain_ :
Unix.socket_domain Bin_prot.Unsafe_write_c.writer
val bin_writer_socket_domain :
Unix.socket_domain Bin_prot.Type_class.writer
val bin_read_socket_domain :
Unix.socket_domain Bin_prot.Read_ml.reader
val bin_read_socket_domain_ :
Unix.socket_domain Bin_prot.Unsafe_read_c.reader
val bin_read_socket_domain__ :
(int -> Unix.socket_domain) Bin_prot.Unsafe_read_c.reader
val bin_reader_socket_domain :
Unix.socket_domain Bin_prot.Type_class.reader
val bin_socket_domain : Unix.socket_domain Bin_prot.Type_class.t
val sexp_of_socket_domain : Unix.socket_domain -> Sexplib.Sexp.t
val socket_domain_of_sexp : Sexplib.Sexp.t -> Unix.socket_domain
type socket_type =
Unix.socket_type =
SOCK_STREAM
| SOCK_DGRAM
| SOCK_RAW
| SOCK_SEQPACKET
val bin_size_socket_type : Unix.socket_type Bin_prot.Size.sizer
val bin_write_socket_type : Unix.socket_type Bin_prot.Write_ml.writer
val bin_write_socket_type_ :
Unix.socket_type Bin_prot.Unsafe_write_c.writer
val bin_writer_socket_type :
Unix.socket_type Bin_prot.Type_class.writer
val bin_read_socket_type : Unix.socket_type Bin_prot.Read_ml.reader
val bin_read_socket_type_ :
Unix.socket_type Bin_prot.Unsafe_read_c.reader
val bin_read_socket_type__ :
(int -> Unix.socket_type) Bin_prot.Unsafe_read_c.reader
val bin_reader_socket_type :
Unix.socket_type Bin_prot.Type_class.reader
val bin_socket_type : Unix.socket_type Bin_prot.Type_class.t
val sexp_of_socket_type : Unix.socket_type -> Sexplib.Sexp.t
val socket_type_of_sexp : Sexplib.Sexp.t -> Unix.socket_type
type sockaddr =
Unix.sockaddr =
ADDR_UNIX of string
| ADDR_INET of Unix.inet_addr * int
val bin_size_sockaddr : Unix.sockaddr Bin_prot.Size.sizer
val bin_write_sockaddr : Unix.sockaddr Bin_prot.Write_ml.writer
val bin_write_sockaddr_ : Unix.sockaddr Bin_prot.Unsafe_write_c.writer
val bin_writer_sockaddr : Unix.sockaddr Bin_prot.Type_class.writer
val bin_read_sockaddr : Unix.sockaddr Bin_prot.Read_ml.reader
val bin_read_sockaddr_ : Unix.sockaddr Bin_prot.Unsafe_read_c.reader
val bin_read_sockaddr__ :
(int -> Unix.sockaddr) Bin_prot.Unsafe_read_c.reader
val bin_reader_sockaddr : Unix.sockaddr Bin_prot.Type_class.reader
val bin_sockaddr : Unix.sockaddr Bin_prot.Type_class.t
val sexp_of_sockaddr : Unix.sockaddr -> Sexplib.Sexp.t
val sockaddr_of_sexp : Sexplib.Sexp.t -> Unix.sockaddr
val domain_of_sockaddr : Unix.sockaddr -> Unix.socket_domain
val socket :
domain:Unix.socket_domain ->
kind:Unix.socket_type -> protocol:int -> Unix.file_descr
val socketpair :
domain:Unix.socket_domain ->
kind:Unix.socket_type ->
protocol:int -> Unix.file_descr * Unix.file_descr
val accept :
Unix.file_descr -> Unix.file_descr * Unix.sockaddr
val bind : Unix.file_descr -> addr:Unix.sockaddr -> unit
val connect : Unix.file_descr -> addr:Unix.sockaddr -> unit
val listen : Unix.file_descr -> max:int -> unit
type shutdown_command =
Unix.shutdown_command =
SHUTDOWN_RECEIVE
| SHUTDOWN_SEND
| SHUTDOWN_ALL
val shutdown :
Unix.file_descr -> mode:Unix.shutdown_command -> unit
val getsockname : Unix.file_descr -> Unix.sockaddr
val getpeername : Unix.file_descr -> Unix.sockaddr
type msg_flag = Unix.msg_flag = MSG_OOB | MSG_DONTROUTE | MSG_PEEK
val recv :
Unix.file_descr ->
buf:string -> pos:int -> len:int -> mode:Unix.msg_flag list -> int
val recvfrom :
Unix.file_descr ->
buf:string ->
pos:int ->
len:int -> mode:Unix.msg_flag list -> int * Unix.sockaddr
val send :
Unix.file_descr ->
buf:string -> pos:int -> len:int -> mode:Unix.msg_flag list -> int
val sendto :
Unix.file_descr ->
buf:string ->
pos:int ->
len:int -> mode:Unix.msg_flag list -> addr:Unix.sockaddr -> int
type socket_bool_option =
SO_DEBUG
| SO_BROADCAST
| SO_REUSEADDR
| SO_KEEPALIVE
| SO_DONTROUTE
| SO_OOBINLINE
| SO_ACCEPTCONN
| TCP_NODELAY
| IPV6_ONLY
type socket_int_option =
SO_SNDBUF
| SO_RCVBUF
| SO_ERROR
| SO_TYPE
| SO_RCVLOWAT
| SO_SNDLOWAT
type socket_optint_option = SO_LINGER
type socket_float_option = SO_RCVTIMEO | SO_SNDTIMEO
val getsockopt :
Unix.file_descr -> Unix.socket_bool_option -> bool
val setsockopt :
Unix.file_descr -> Unix.socket_bool_option -> bool -> unit
val getsockopt_int :
Unix.file_descr -> Unix.socket_int_option -> int
val setsockopt_int :
Unix.file_descr -> Unix.socket_int_option -> int -> unit
val getsockopt_optint :
Unix.file_descr -> Unix.socket_optint_option -> int option
val setsockopt_optint :
Unix.file_descr ->
Unix.socket_optint_option -> int option -> unit
val getsockopt_float :
Unix.file_descr -> Unix.socket_float_option -> float
val setsockopt_float :
Unix.file_descr -> Unix.socket_float_option -> float -> unit
val open_connection :
Unix.sockaddr -> Pervasives.in_channel * Pervasives.out_channel
val shutdown_connection : Pervasives.in_channel -> unit
val establish_server :
(Pervasives.in_channel -> Pervasives.out_channel -> unit) ->
addr:Unix.sockaddr -> unit
type host_entry =
Unix.host_entry = {
h_name : string;
h_aliases : string array;
h_addrtype : Unix.socket_domain;
h_addr_list : Unix.inet_addr array;
}
type protocol_entry =
Unix.protocol_entry = {
p_name : string;
p_aliases : string array;
p_proto : int;
}
type service_entry =
Unix.service_entry = {
s_name : string;
s_aliases : string array;
s_port : int;
s_proto : string;
}
val gethostname : unit -> string
val gethostbyname : string -> Unix.host_entry
val gethostbyaddr : Unix.inet_addr -> Unix.host_entry
val getprotobyname : string -> Unix.protocol_entry
val getprotobynumber : int -> Unix.protocol_entry
val getservbyname : string -> protocol:string -> Unix.service_entry
val getservbyport : int -> protocol:string -> Unix.service_entry
type addr_info = {
ai_family : Unix.socket_domain;
ai_socktype : Unix.socket_type;
ai_protocol : int;
ai_addr : Unix.sockaddr;
ai_canonname : string;
}
type getaddrinfo_option =
AI_FAMILY of Unix.socket_domain
| AI_SOCKTYPE of Unix.socket_type
| AI_PROTOCOL of int
| AI_NUMERICHOST
| AI_CANONNAME
| AI_PASSIVE
val getaddrinfo :
string ->
string -> Unix.getaddrinfo_option list -> Unix.addr_info list
type name_info = { ni_hostname : string; ni_service : string; }
type getnameinfo_option =
NI_NOFQDN
| NI_NUMERICHOST
| NI_NAMEREQD
| NI_NUMERICSERV
| NI_DGRAM
val getnameinfo :
Unix.sockaddr ->
Unix.getnameinfo_option list -> Unix.name_info
module Terminal_io :
sig
type t =
Unix.terminal_io = {
mutable c_ignbrk : bool;
mutable c_brkint : bool;
mutable c_ignpar : bool;
mutable c_parmrk : bool;
mutable c_inpck : bool;
mutable c_istrip : bool;
mutable c_inlcr : bool;
mutable c_igncr : bool;
mutable c_icrnl : bool;
mutable c_ixon : bool;
mutable c_ixoff : bool;
mutable c_opost : bool;
mutable c_obaud : int;
mutable c_ibaud : int;
mutable c_csize : int;
mutable c_cstopb : int;
mutable c_cread : bool;
mutable c_parenb : bool;
mutable c_parodd : bool;
mutable c_hupcl : bool;
mutable c_clocal : bool;
mutable c_isig : bool;
mutable c_icanon : bool;
mutable c_noflsh : bool;
mutable c_echo : bool;
mutable c_echoe : bool;
mutable c_echok : bool;
mutable c_echonl : bool;
mutable c_vintr : char;
mutable c_vquit : char;
mutable c_verase : char;
mutable c_vkill : char;
mutable c_veof : char;
mutable c_veol : char;
mutable c_vmin : int;
mutable c_vtime : int;
mutable c_vstart : char;
mutable c_vstop : char;
}
val sexp_of_t : t -> Sexplib.Sexp.t
type setattr_when = Unix.setattr_when = TCSANOW | TCSADRAIN | TCSAFLUSH
val sexp_of_setattr_when : setattr_when -> Sexplib.Sexp.t
val tcgetattr : Unix.file_descr -> t
val tcsetattr : Unix.file_descr -> mode:setattr_when -> t -> unit
val tcsendbreak : Unix.file_descr -> duration:int -> unit
val tcdrain : Unix.file_descr -> unit
type flush_queue = Unix.flush_queue = TCIFLUSH | TCOFLUSH | TCIOFLUSH
val tcflush :
Unix.file_descr ->
mode:Unix.Terminal_io.flush_queue -> unit
type flow_action = Unix.flow_action = TCOOFF | TCOON | TCIOFF | TCION
val tcflow :
Unix.file_descr ->
mode:Unix.Terminal_io.flow_action -> unit
val setsid : unit -> int
end
val get_inet_addr : string -> Unix.inet_addr
val get_sockaddr : string -> int -> Unix.sockaddr
val set_in_channel_timeout : Pervasives.in_channel -> float -> unit
val set_out_channel_timeout : Pervasives.out_channel -> float -> unit
end