Module Caml_unix
include Unix
type error= Unix.error=
exceptionUnix_error of error * string * string
val error_message : error -> stringval handle_unix_error : ('a -> 'b) -> 'a -> 'bval environment : unit -> string arrayval unsafe_environment : unit -> string arrayval getenv : string -> stringval unsafe_getenv : string -> stringval putenv : string -> string -> unit
type process_status= Unix.process_status=|WEXITED of int|WSIGNALED of int|WSTOPPED of inttype wait_flag= Unix.wait_flag=|WNOHANG|WUNTRACED
val execv : string -> string array -> 'aval execve : string -> string array -> string array -> 'aval execvp : string -> string array -> 'aval execvpe : string -> string array -> string array -> 'aval fork : unit -> intval wait : unit -> int * process_statusval waitpid : wait_flag list -> int -> int * process_statusval system : string -> process_statusval getpid : unit -> intval getppid : unit -> intval nice : int -> int
val stdin : file_descrval stdout : file_descrval stderr : 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_KEEPEXECtype file_perm= int
val openfile : string -> open_flag list -> file_perm -> file_descrval close : file_descr -> unitval fsync : file_descr -> unitval read : file_descr -> bytes -> int -> int -> intval write : file_descr -> bytes -> int -> int -> intval single_write : file_descr -> bytes -> int -> int -> intval write_substring : file_descr -> string -> int -> int -> intval single_write_substring : file_descr -> string -> int -> int -> intval in_channel_of_descr : file_descr -> Stdlib.in_channelval out_channel_of_descr : file_descr -> Stdlib.out_channelval descr_of_in_channel : Stdlib.in_channel -> file_descrval descr_of_out_channel : Stdlib.out_channel -> file_descr
val lseek : file_descr -> int -> seek_command -> intval truncate : string -> int -> unitval ftruncate : file_descr -> int -> unit
type file_kind= Unix.file_kind=|S_REG|S_DIR|S_CHR|S_BLK|S_LNK|S_FIFO|S_SOCKtype stats= Unix.stats={st_dev : int;st_ino : int;st_kind : file_kind;st_perm : 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 -> statsval lstat : string -> statsval fstat : file_descr -> statsval isatty : file_descr -> bool
val map_file : file_descr -> ?pos:int64 -> ('a, 'b) Stdlib.Bigarray.kind -> 'c Stdlib.Bigarray.layout -> bool -> int array -> ('a, 'b, 'c) Stdlib.Bigarray.Genarray.tval unlink : string -> unitval rename : string -> string -> unitval link : ?follow:bool -> string -> string -> unit
val chmod : string -> file_perm -> unitval fchmod : file_descr -> file_perm -> unitval chown : string -> int -> int -> unitval fchown : file_descr -> int -> int -> unitval umask : int -> intval access : string -> access_permission list -> unitval dup : ?cloexec:bool -> file_descr -> file_descrval dup2 : ?cloexec:bool -> file_descr -> file_descr -> unitval set_nonblock : file_descr -> unitval clear_nonblock : file_descr -> unitval set_close_on_exec : file_descr -> unitval clear_close_on_exec : file_descr -> unitval mkdir : string -> file_perm -> unitval rmdir : string -> unitval chdir : string -> unitval getcwd : unit -> stringval chroot : string -> unit
val opendir : string -> dir_handleval readdir : dir_handle -> stringval rewinddir : dir_handle -> unitval closedir : dir_handle -> unitval pipe : ?cloexec:bool -> unit -> file_descr * file_descrval mkfifo : string -> file_perm -> unitval create_process : string -> string array -> file_descr -> file_descr -> file_descr -> intval create_process_env : string -> string array -> string array -> file_descr -> file_descr -> file_descr -> intval open_process_in : string -> Stdlib.in_channelval open_process_out : string -> Stdlib.out_channelval open_process : string -> Stdlib.in_channel * Stdlib.out_channelval open_process_full : string -> string array -> Stdlib.in_channel * Stdlib.out_channel * Stdlib.in_channelval open_process_args_in : string -> string array -> Stdlib.in_channelval open_process_args_out : string -> string array -> Stdlib.out_channelval open_process_args : string -> string array -> Stdlib.in_channel * Stdlib.out_channelval open_process_args_full : string -> string array -> string array -> Stdlib.in_channel * Stdlib.out_channel * Stdlib.in_channelval process_in_pid : Stdlib.in_channel -> intval process_out_pid : Stdlib.out_channel -> intval process_pid : (Stdlib.in_channel * Stdlib.out_channel) -> intval process_full_pid : (Stdlib.in_channel * Stdlib.out_channel * Stdlib.in_channel) -> intval close_process_in : Stdlib.in_channel -> process_statusval close_process_out : Stdlib.out_channel -> process_statusval close_process : (Stdlib.in_channel * Stdlib.out_channel) -> process_statusval close_process_full : (Stdlib.in_channel * Stdlib.out_channel * Stdlib.in_channel) -> process_statusval symlink : ?to_dir:bool -> string -> string -> unitval has_symlink : unit -> boolval readlink : string -> stringval select : file_descr list -> file_descr list -> file_descr list -> float -> file_descr list * file_descr list * file_descr list
val lockf : file_descr -> lock_command -> int -> unitval kill : int -> int -> unit
val sigprocmask : sigprocmask_command -> int list -> int listval sigpending : unit -> int listval sigsuspend : int list -> unitval 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 -> floatval gettimeofday : unit -> floatval gmtime : float -> tmval localtime : float -> tmval mktime : tm -> float * tmval alarm : int -> intval sleep : int -> unitval sleepf : float -> unitval times : unit -> process_timesval utimes : string -> float -> float -> unit
type interval_timer= Unix.interval_timer=|ITIMER_REAL|ITIMER_VIRTUAL|ITIMER_PROFtype interval_timer_status= Unix.interval_timer_status={it_interval : float;it_value : float;}
val getitimer : interval_timer -> interval_timer_statusval setitimer : interval_timer -> interval_timer_status -> interval_timer_statusval getuid : unit -> intval geteuid : unit -> intval setuid : int -> unitval getgid : unit -> intval getegid : unit -> intval setgid : int -> unitval getgroups : unit -> int arrayval setgroups : int array -> unitval 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 -> stringval getpwnam : string -> passwd_entryval getgrnam : string -> group_entryval getpwuid : int -> passwd_entryval getgrgid : int -> group_entry
val inet_addr_of_string : string -> inet_addrval string_of_inet_addr : inet_addr -> stringval inet_addr_any : inet_addrval inet_addr_loopback : inet_addrval inet6_addr_any : inet_addrval inet6_addr_loopback : inet_addr
type socket_domain= Unix.socket_domain=|PF_UNIX|PF_INET|PF_INET6type socket_type= Unix.socket_type=|SOCK_STREAM|SOCK_DGRAM|SOCK_RAW|SOCK_SEQPACKETtype sockaddr= Unix.sockaddr=|ADDR_UNIX of string|ADDR_INET of inet_addr * int
val socket : ?cloexec:bool -> socket_domain -> socket_type -> int -> file_descrval domain_of_sockaddr : sockaddr -> socket_domainval socketpair : ?cloexec:bool -> socket_domain -> socket_type -> int -> file_descr * file_descrval accept : ?cloexec:bool -> file_descr -> file_descr * sockaddrval bind : file_descr -> sockaddr -> unitval connect : file_descr -> sockaddr -> unitval listen : file_descr -> int -> unit
val shutdown : file_descr -> shutdown_command -> unitval getsockname : file_descr -> sockaddrval getpeername : file_descr -> sockaddr
val recv : file_descr -> bytes -> int -> int -> msg_flag list -> intval recvfrom : file_descr -> bytes -> int -> int -> msg_flag list -> int * sockaddrval send : file_descr -> bytes -> int -> int -> msg_flag list -> intval send_substring : file_descr -> string -> int -> int -> msg_flag list -> intval sendto : file_descr -> bytes -> int -> int -> msg_flag list -> sockaddr -> intval sendto_substring : file_descr -> string -> int -> int -> msg_flag list -> 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_ONLYtype socket_int_option= Unix.socket_int_option=|SO_SNDBUF|SO_RCVBUF|SO_ERROR|SO_TYPE|SO_RCVLOWAT|SO_SNDLOWATtype socket_optint_option= Unix.socket_optint_option=|SO_LINGERtype socket_float_option= Unix.socket_float_option=|SO_RCVTIMEO|SO_SNDTIMEO
val getsockopt : file_descr -> socket_bool_option -> boolval setsockopt : file_descr -> socket_bool_option -> bool -> unitval getsockopt_int : file_descr -> socket_int_option -> intval setsockopt_int : file_descr -> socket_int_option -> int -> unitval getsockopt_optint : file_descr -> socket_optint_option -> int optionval setsockopt_optint : file_descr -> socket_optint_option -> int option -> unitval getsockopt_float : file_descr -> socket_float_option -> floatval setsockopt_float : file_descr -> socket_float_option -> float -> unitval getsockopt_error : file_descr -> error optionval open_connection : sockaddr -> Stdlib.in_channel * Stdlib.out_channelval shutdown_connection : Stdlib.in_channel -> unitval establish_server : (Stdlib.in_channel -> Stdlib.out_channel -> unit) -> sockaddr -> unit
type host_entry= Unix.host_entry={h_name : string;h_aliases : string array;h_addrtype : socket_domain;h_addr_list : 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 -> stringval gethostbyname : string -> host_entryval gethostbyaddr : inet_addr -> host_entryval getprotobyname : string -> protocol_entryval getprotobynumber : int -> protocol_entryval getservbyname : string -> string -> service_entryval getservbyport : int -> string -> service_entry
type addr_info= Unix.addr_info={ai_family : socket_domain;ai_socktype : socket_type;ai_protocol : int;ai_addr : sockaddr;ai_canonname : string;}type getaddrinfo_option= Unix.getaddrinfo_option=|AI_FAMILY of socket_domain|AI_SOCKTYPE of socket_type|AI_PROTOCOL of int|AI_NUMERICHOST|AI_CANONNAME|AI_PASSIVE
val getaddrinfo : string -> string -> getaddrinfo_option list -> 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 : sockaddr -> getnameinfo_option list -> name_info
type terminal_io= Unix.terminal_io={}
val tcgetattr : file_descr -> terminal_io
val tcsetattr : file_descr -> setattr_when -> terminal_io -> unitval tcsendbreak : file_descr -> int -> unitval tcdrain : file_descr -> unit
val tcflush : file_descr -> flush_queue -> unit
val tcflow : file_descr -> flow_action -> unitval setsid : unit -> int