sig
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 BatUnix.error * string * string
val error_message : BatUnix.error -> string
val handle_unix_error : ('a -> 'b) -> 'a -> 'b
val environment : unit -> string array
val unsafe_environment : unit -> string array
val getenv : string -> string
val unsafe_getenv : string -> string
val putenv : string -> string -> unit
type process_status =
Unix.process_status =
WEXITED of int
| WSIGNALED of int
| WSTOPPED of int
type wait_flag = Unix.wait_flag = WNOHANG | WUNTRACED
val execv : string -> string array -> 'a
val execve : string -> string array -> string array -> 'a
val execvp : string -> string array -> 'a
val execvpe : string -> string array -> string array -> 'a
val fork : unit -> int
val wait : unit -> int * BatUnix.process_status
val waitpid : BatUnix.wait_flag list -> int -> int * BatUnix.process_status
val system : string -> BatUnix.process_status
val run_and_read : string -> BatUnix.process_status * string
val getpid : unit -> int
val getppid : unit -> int
val nice : int -> int
type file_descr = Unix.file_descr
val stdin : BatUnix.file_descr
val stdout : BatUnix.file_descr
val stderr : BatUnix.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
| O_SHARE_DELETE
| O_CLOEXEC
| O_KEEPEXEC
type file_perm = int
val openfile :
string ->
BatUnix.open_flag list -> BatUnix.file_perm -> BatUnix.file_descr
val close : BatUnix.file_descr -> unit
val fsync : BatUnix.file_descr -> unit
val read : BatUnix.file_descr -> Stdlib.Bytes.t -> int -> int -> int
val write : BatUnix.file_descr -> Stdlib.Bytes.t -> int -> int -> int
val single_write :
BatUnix.file_descr -> Stdlib.Bytes.t -> int -> int -> int
val write_substring : BatUnix.file_descr -> string -> int -> int -> int
val single_write_substring :
BatUnix.file_descr -> string -> int -> int -> int
val input_of_descr :
?autoclose:bool ->
?cleanup:bool -> BatUnix.file_descr -> BatInnerIO.input
val output_of_descr :
?cleanup:bool -> BatUnix.file_descr -> unit BatInnerIO.output
val descr_of_input : BatInnerIO.input -> BatUnix.file_descr
val descr_of_output : unit BatInnerIO.output -> BatUnix.file_descr
type seek_command = Unix.seek_command = SEEK_SET | SEEK_CUR | SEEK_END
val lseek : BatUnix.file_descr -> int -> BatUnix.seek_command -> int
val truncate : string -> int -> unit
val ftruncate : BatUnix.file_descr -> int -> unit
type file_kind =
Unix.file_kind =
S_REG
| S_DIR
| S_CHR
| S_BLK
| S_LNK
| S_FIFO
| S_SOCK
type stats =
Unix.stats = {
st_dev : int;
st_ino : int;
st_kind : BatUnix.file_kind;
st_perm : BatUnix.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 -> BatUnix.stats
val lstat : string -> BatUnix.stats
val fstat : BatUnix.file_descr -> BatUnix.stats
val isatty : BatUnix.file_descr -> bool
module LargeFile :
sig
val lseek :
BatUnix.file_descr -> int64 -> BatUnix.seek_command -> int64
val truncate : string -> int64 -> unit
val ftruncate : BatUnix.file_descr -> int64 -> unit
type stats =
Unix.LargeFile.stats = {
st_dev : int;
st_ino : int;
st_kind : BatUnix.file_kind;
st_perm : BatUnix.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 -> BatUnix.LargeFile.stats
val lstat : string -> BatUnix.LargeFile.stats
val fstat : BatUnix.file_descr -> BatUnix.LargeFile.stats
end
val map_file :
BatUnix.file_descr ->
?pos:int64 ->
('a, 'b) Bigarray.kind ->
'c Bigarray.layout ->
bool -> int array -> ('a, 'b, 'c) Bigarray.Genarray.t
val unlink : string -> unit
val rename : string -> string -> unit
val link : ?follow:bool -> string -> string -> unit
type access_permission = Unix.access_permission = R_OK | W_OK | X_OK | F_OK
val chmod : string -> BatUnix.file_perm -> unit
val fchmod : BatUnix.file_descr -> BatUnix.file_perm -> unit
val chown : string -> int -> int -> unit
val fchown : BatUnix.file_descr -> int -> int -> unit
val umask : int -> int
val access : string -> BatUnix.access_permission list -> unit
val dup : ?cloexec:bool -> BatUnix.file_descr -> BatUnix.file_descr
val dup2 :
?cloexec:bool -> BatUnix.file_descr -> BatUnix.file_descr -> unit
val set_nonblock : BatUnix.file_descr -> unit
val clear_nonblock : BatUnix.file_descr -> unit
val set_close_on_exec : BatUnix.file_descr -> unit
val clear_close_on_exec : BatUnix.file_descr -> unit
val mkdir : string -> BatUnix.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 -> BatUnix.dir_handle
val readdir : BatUnix.dir_handle -> string
val rewinddir : BatUnix.dir_handle -> unit
val closedir : BatUnix.dir_handle -> unit
val pipe : ?cloexec:bool -> unit -> BatUnix.file_descr * BatUnix.file_descr
val mkfifo : string -> BatUnix.file_perm -> unit
val open_process_in :
?autoclose:bool -> ?cleanup:bool -> string -> BatInnerIO.input
val open_process_out : ?cleanup:bool -> string -> unit BatInnerIO.output
val open_process :
?autoclose:bool ->
?cleanup:bool -> string -> BatInnerIO.input * unit BatInnerIO.output
val open_process_full :
?autoclose:bool ->
?cleanup:bool ->
string ->
string array ->
BatInnerIO.input * unit BatInnerIO.output * BatInnerIO.input
val open_process_args_in : string -> string array -> Stdlib.in_channel
val open_process_args_out : string -> string array -> Stdlib.out_channel
val open_process_args :
string -> string array -> Stdlib.in_channel * Stdlib.out_channel
val open_process_args_full :
string ->
string array ->
string array ->
Stdlib.in_channel * Stdlib.out_channel * Stdlib.in_channel
val process_in_pid : Stdlib.in_channel -> int
val process_out_pid : Stdlib.out_channel -> int
val process_pid : Stdlib.in_channel * Stdlib.out_channel -> int
val process_full_pid :
Stdlib.in_channel * Stdlib.out_channel * Stdlib.in_channel -> int
val close_process_in : BatInnerIO.input -> BatUnix.process_status
val close_process_out : unit BatInnerIO.output -> BatUnix.process_status
val close_process :
BatInnerIO.input * unit BatInnerIO.output -> BatUnix.process_status
val close_process_full :
BatInnerIO.input * unit BatInnerIO.output * BatInnerIO.input ->
BatUnix.process_status
val create_process :
string ->
string array ->
BatUnix.file_descr -> BatUnix.file_descr -> BatUnix.file_descr -> int
val create_process_env :
string ->
string array ->
string array ->
BatUnix.file_descr -> BatUnix.file_descr -> BatUnix.file_descr -> int
val symlink : ?to_dir:bool -> string -> string -> unit
val has_symlink : unit -> bool
val readlink : string -> string
val select :
BatUnix.file_descr list ->
BatUnix.file_descr list ->
BatUnix.file_descr list ->
float ->
BatUnix.file_descr list * BatUnix.file_descr list *
BatUnix.file_descr list
type lock_command =
Unix.lock_command =
F_ULOCK
| F_LOCK
| F_TLOCK
| F_TEST
| F_RLOCK
| F_TRLOCK
val lockf : BatUnix.file_descr -> BatUnix.lock_command -> int -> unit
val with_locked_file :
kind:[ `Read | `Write ] -> string -> (BatUnix.file_descr -> 'a) -> 'a
val kill : int -> int -> unit
type sigprocmask_command =
Unix.sigprocmask_command =
SIG_SETMASK
| SIG_BLOCK
| SIG_UNBLOCK
val sigprocmask : BatUnix.sigprocmask_command -> int list -> int list
val sigpending : unit -> int list
val sigsuspend : int list -> unit
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 -> BatUnix.tm
val localtime : float -> BatUnix.tm
val mktime : BatUnix.tm -> float * BatUnix.tm
val alarm : int -> int
val sleep : int -> unit
val sleepf : float -> unit
val times : unit -> BatUnix.process_times
val utimes : string -> float -> 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 : BatUnix.interval_timer -> BatUnix.interval_timer_status
val setitimer :
BatUnix.interval_timer ->
BatUnix.interval_timer_status -> BatUnix.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
val setgroups : int array -> unit
val initgroups : string -> int -> unit
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 -> BatUnix.passwd_entry
val getgrnam : string -> BatUnix.group_entry
val getpwuid : int -> BatUnix.passwd_entry
val getgrgid : int -> BatUnix.group_entry
type inet_addr = Unix.inet_addr
val inet_addr_of_string : string -> BatUnix.inet_addr
val string_of_inet_addr : BatUnix.inet_addr -> string
val inet_addr_any : BatUnix.inet_addr
val inet_addr_loopback : BatUnix.inet_addr
val inet6_addr_any : BatUnix.inet_addr
val inet6_addr_loopback : BatUnix.inet_addr
type socket_domain = Unix.socket_domain = PF_UNIX | PF_INET | PF_INET6
type socket_type =
Unix.socket_type =
SOCK_STREAM
| SOCK_DGRAM
| SOCK_RAW
| SOCK_SEQPACKET
type sockaddr =
Unix.sockaddr =
ADDR_UNIX of string
| ADDR_INET of BatUnix.inet_addr * int
val socket :
?cloexec:bool ->
BatUnix.socket_domain -> BatUnix.socket_type -> int -> BatUnix.file_descr
val domain_of_sockaddr : BatUnix.sockaddr -> BatUnix.socket_domain
val socketpair :
?cloexec:bool ->
BatUnix.socket_domain ->
BatUnix.socket_type -> int -> BatUnix.file_descr * BatUnix.file_descr
val accept :
?cloexec:bool ->
BatUnix.file_descr -> BatUnix.file_descr * BatUnix.sockaddr
val bind : BatUnix.file_descr -> BatUnix.sockaddr -> unit
val connect : BatUnix.file_descr -> BatUnix.sockaddr -> unit
val listen : BatUnix.file_descr -> int -> unit
type shutdown_command =
Unix.shutdown_command =
SHUTDOWN_RECEIVE
| SHUTDOWN_SEND
| SHUTDOWN_ALL
val shutdown : BatUnix.file_descr -> BatUnix.shutdown_command -> unit
val getsockname : BatUnix.file_descr -> BatUnix.sockaddr
val getpeername : BatUnix.file_descr -> BatUnix.sockaddr
type msg_flag = Unix.msg_flag = MSG_OOB | MSG_DONTROUTE | MSG_PEEK
val recv :
BatUnix.file_descr ->
Stdlib.Bytes.t -> int -> int -> BatUnix.msg_flag list -> int
val recvfrom :
BatUnix.file_descr ->
Stdlib.Bytes.t ->
int -> int -> BatUnix.msg_flag list -> int * BatUnix.sockaddr
val send :
BatUnix.file_descr ->
Stdlib.Bytes.t -> int -> int -> BatUnix.msg_flag list -> int
val send_substring :
BatUnix.file_descr ->
string -> int -> int -> BatUnix.msg_flag list -> int
val sendto :
BatUnix.file_descr ->
Stdlib.Bytes.t ->
int -> int -> BatUnix.msg_flag list -> BatUnix.sockaddr -> int
val sendto_substring :
BatUnix.file_descr ->
string -> int -> int -> BatUnix.msg_flag list -> BatUnix.sockaddr -> int
type socket_bool_option =
Unix.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 =
Unix.socket_int_option =
SO_SNDBUF
| SO_RCVBUF
| SO_ERROR
| SO_TYPE
| SO_RCVLOWAT
| SO_SNDLOWAT
type socket_optint_option = Unix.socket_optint_option = SO_LINGER
type socket_float_option =
Unix.socket_float_option =
SO_RCVTIMEO
| SO_SNDTIMEO
val getsockopt : BatUnix.file_descr -> BatUnix.socket_bool_option -> bool
val setsockopt :
BatUnix.file_descr -> BatUnix.socket_bool_option -> bool -> unit
val getsockopt_int : BatUnix.file_descr -> BatUnix.socket_int_option -> int
val setsockopt_int :
BatUnix.file_descr -> BatUnix.socket_int_option -> int -> unit
val getsockopt_optint :
BatUnix.file_descr -> BatUnix.socket_optint_option -> int option
val setsockopt_optint :
BatUnix.file_descr -> BatUnix.socket_optint_option -> int option -> unit
val getsockopt_float :
BatUnix.file_descr -> BatUnix.socket_float_option -> float
val setsockopt_float :
BatUnix.file_descr -> BatUnix.socket_float_option -> float -> unit
val getsockopt_error : BatUnix.file_descr -> BatUnix.error option
val open_connection :
?autoclose:bool ->
BatUnix.sockaddr -> BatInnerIO.input * unit BatInnerIO.output
val shutdown_connection : BatInnerIO.input -> unit
val establish_server :
?autoclose:bool ->
?cleanup:bool ->
(BatInnerIO.input -> unit BatInnerIO.output -> unit) ->
BatUnix.sockaddr -> unit
type host_entry =
Unix.host_entry = {
h_name : string;
h_aliases : string array;
h_addrtype : BatUnix.socket_domain;
h_addr_list : BatUnix.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 -> BatUnix.host_entry
val gethostbyaddr : BatUnix.inet_addr -> BatUnix.host_entry
val getprotobyname : string -> BatUnix.protocol_entry
val getprotobynumber : int -> BatUnix.protocol_entry
val getservbyname : string -> string -> BatUnix.service_entry
val getservbyport : int -> string -> BatUnix.service_entry
type addr_info =
Unix.addr_info = {
ai_family : BatUnix.socket_domain;
ai_socktype : BatUnix.socket_type;
ai_protocol : int;
ai_addr : BatUnix.sockaddr;
ai_canonname : string;
}
type getaddrinfo_option =
Unix.getaddrinfo_option =
AI_FAMILY of BatUnix.socket_domain
| AI_SOCKTYPE of BatUnix.socket_type
| AI_PROTOCOL of int
| AI_NUMERICHOST
| AI_CANONNAME
| AI_PASSIVE
val getaddrinfo :
string ->
string -> BatUnix.getaddrinfo_option list -> BatUnix.addr_info list
type name_info =
Unix.name_info = {
ni_hostname : string;
ni_service : string;
}
type getnameinfo_option =
Unix.getnameinfo_option =
NI_NOFQDN
| NI_NUMERICHOST
| NI_NAMEREQD
| NI_NUMERICSERV
| NI_DGRAM
val getnameinfo :
BatUnix.sockaddr -> BatUnix.getnameinfo_option list -> BatUnix.name_info
type terminal_io =
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 tcgetattr : BatUnix.file_descr -> BatUnix.terminal_io
type setattr_when = Unix.setattr_when = TCSANOW | TCSADRAIN | TCSAFLUSH
val tcsetattr :
BatUnix.file_descr -> BatUnix.setattr_when -> BatUnix.terminal_io -> unit
val tcsendbreak : BatUnix.file_descr -> int -> unit
val tcdrain : BatUnix.file_descr -> unit
type flush_queue = Unix.flush_queue = TCIFLUSH | TCOFLUSH | TCIOFLUSH
val tcflush : BatUnix.file_descr -> BatUnix.flush_queue -> unit
type flow_action = Unix.flow_action = TCOOFF | TCOON | TCIOFF | TCION
val tcflow : BatUnix.file_descr -> BatUnix.flow_action -> unit
val setsid : unit -> int
val is_directory : string -> bool
val restart_on_EINTR : ('a -> 'b) -> 'a -> 'b
val lock : BatConcurrent.lock Stdlib.ref
val in_channel_of_descr : BatUnix.file_descr -> BatInnerIO.input
val out_channel_of_descr : BatUnix.file_descr -> unit BatInnerIO.output
val descr_of_in_channel : BatInnerIO.input -> BatUnix.file_descr
val descr_of_out_channel : unit BatInnerIO.output -> BatUnix.file_descr
end