    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
        | EUNKNOWNERR of int
      exception Unix_error of UnixLabels.error * string * string
      val error_message : UnixLabels.error -> string
      val handle_unix_error : ('a -> 'b) -> 'a -> 'b
      val environment : unit -> string array
      val getenv : string -> string
      val putenv : string -> string -> unit
      type process_status =
        Unix.process_status =
          WEXITED of int
        | WSIGNALED of int
        | WSTOPPED of int
      and wait_flag = Unix.wait_flag = WNOHANG | WUNTRACED
      val execv : prog:string -> args:string array -> unit
      val execve : prog:string -> args:string array -> env:string array -> unit
      val execvp : prog:string -> args:string array -> unit
      val execvpe : prog:string -> args:string array -> env:string array -> unit
      val fork : unit -> int
      val wait : unit -> int * UnixLabels.process_status
      val waitpid :
        mode:UnixLabels.wait_flag list -> int -> int * UnixLabels.process_status
      val system : string -> UnixLabels.process_status
      val getpid : unit -> int
      val getppid : unit -> int
      val nice : int -> int
      type file_descr = Unix.file_descr
      val stdin : UnixLabels.file_descr
      val stdout : UnixLabels.file_descr
      val stderr : UnixLabels.file_descr
      type open_flag =
        Unix.open_flag =
          O_RDONLY
        | O_WRONLY
        | O_RDWR
        | O_NONBLOCK
        | O_APPEND
        | O_CREAT
        | O_TRUNC
        | O_EXCL
      and file_perm = int
      val openfile :
        string ->
        mode:UnixLabels.open_flag list ->
        perm:UnixLabels.file_perm -> UnixLabels.file_descr
      val close : UnixLabels.file_descr -> unit
      val read : UnixLabels.file_descr -> buf:string -> pos:int -> len:int -> int
      val write :
        UnixLabels.file_descr -> buf:string -> pos:int -> len:int -> int
      val in_channel_of_descr : UnixLabels.file_descr -> Pervasives.in_channel
      val out_channel_of_descr : UnixLabels.file_descr -> Pervasives.out_channel
      val descr_of_in_channel : Pervasives.in_channel -> UnixLabels.file_descr
      val descr_of_out_channel : Pervasives.out_channel -> UnixLabels.file_descr
      type seek_command = Unix.seek_command = SEEK_SET | SEEK_CUR | SEEK_END
      val lseek :
        UnixLabels.file_descr -> int -> mode:UnixLabels.seek_command -> int
      val truncate : string -> len:int -> unit
      val ftruncate : UnixLabels.file_descr -> len:int -> unit
      type file_kind =
        Unix.file_kind =
          S_REG
        | S_DIR
        | S_CHR
        | S_BLK
        | S_LNK
        | S_FIFO
        | S_SOCK
      and stats =
        Unix.stats = {
        st_dev : int;
        st_ino : int;
        st_kind : UnixLabels.file_kind;
        st_perm : UnixLabels.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 -> UnixLabels.stats
      val lstat : string -> UnixLabels.stats
      val fstat : UnixLabels.file_descr -> UnixLabels.stats
      val unlink : string -> unit
      val rename : src:string -> dst:string -> unit
      val link : src:string -> dst:string -> unit
      type access_permission = Unix.access_permission = R_OK | W_OK | X_OK | F_OK
      val chmod : string -> perm:UnixLabels.file_perm -> unit
      val fchmod : UnixLabels.file_descr -> perm:UnixLabels.file_perm -> unit
      val chown : string -> uid:int -> gid:int -> unit
      val fchown : UnixLabels.file_descr -> uid:int -> gid:int -> unit
      val umask : int -> int
      val access : string -> perm:UnixLabels.access_permission list -> unit
      val dup : UnixLabels.file_descr -> UnixLabels.file_descr
      val dup2 : src:UnixLabels.file_descr -> dst:UnixLabels.file_descr -> unit
      val set_nonblock : UnixLabels.file_descr -> unit
      val clear_nonblock : UnixLabels.file_descr -> unit
      val set_close_on_exec : UnixLabels.file_descr -> unit
      val clear_close_on_exec : UnixLabels.file_descr -> unit
      val mkdir : string -> perm:UnixLabels.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 -> UnixLabels.dir_handle
      val readdir : UnixLabels.dir_handle -> string
      val rewinddir : UnixLabels.dir_handle -> unit
      val closedir : UnixLabels.dir_handle -> unit
      val pipe : unit -> UnixLabels.file_descr * UnixLabels.file_descr
      val mkfifo : string -> perm:UnixLabels.file_perm -> unit
      val create_process :
        prog:string ->
        args:string array ->
        stdin:UnixLabels.file_descr ->
        stdout:UnixLabels.file_descr -> stderr:UnixLabels.file_descr -> int
      val create_process_env :
        prog:string ->
        args:string array ->
        env:string array ->
        stdin:UnixLabels.file_descr ->
        stdout:UnixLabels.file_descr -> stderr:UnixLabels.file_descr -> int
      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
      val open_process_full :
        string ->
        env:string array ->
        Pervasives.in_channel * Pervasives.out_channel * Pervasives.in_channel
      val close_process_in : Pervasives.in_channel -> UnixLabels.process_status
      val close_process_out : Pervasives.out_channel -> UnixLabels.process_status
      val close_process :
        Pervasives.in_channel * Pervasives.out_channel ->
        UnixLabels.process_status
      val close_process_full :
        Pervasives.in_channel * Pervasives.out_channel * Pervasives.in_channel ->
        UnixLabels.process_status
      val symlink : src:string -> dst:string -> unit
      val readlink : string -> string
      val select :
        read:UnixLabels.file_descr list ->
        write:UnixLabels.file_descr list ->
        except:UnixLabels.file_descr list ->
        timeout:float ->
        UnixLabels.file_descr list * UnixLabels.file_descr list *
        UnixLabels.file_descr list
      type lock_command =
        Unix.lock_command =
          F_ULOCK
        | F_LOCK
        | F_TLOCK
        | F_TEST
        | F_RLOCK
        | F_TRLOCK
      val lockf :
        UnixLabels.file_descr -> mode:UnixLabels.lock_command -> len:int -> unit
      val kill : pid:int -> signal:int -> unit
      type sigprocmask_command =
        Unix.sigprocmask_command =
          SIG_SETMASK
        | SIG_BLOCK
        | SIG_UNBLOCK
      val sigprocmask :
        mode:UnixLabels.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;
      }
      and 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 -> UnixLabels.tm
      val localtime : float -> UnixLabels.tm
      val mktime : UnixLabels.tm -> float * UnixLabels.tm
      val alarm : int -> int
      val sleep : int -> unit
      val times : unit -> UnixLabels.process_times
      val utimes : string -> access:float -> modif:float -> unit
      type interval_timer =
        Unix.interval_timer =
          ITIMER_REAL
        | ITIMER_VIRTUAL
        | ITIMER_PROF
      and interval_timer_status =
        Unix.interval_timer_status = {
        it_interval : float;
        it_value : float;
      }
      val getitimer :
        UnixLabels.interval_timer -> UnixLabels.interval_timer_status
      val setitimer :
        UnixLabels.interval_timer ->
        UnixLabels.interval_timer_status -> UnixLabels.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;
      }
      and 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 -> UnixLabels.passwd_entry
      val getgrnam : string -> UnixLabels.group_entry
      val getpwuid : int -> UnixLabels.passwd_entry
      val getgrgid : int -> UnixLabels.group_entry
      type inet_addr = Unix.inet_addr
      val inet_addr_of_string : string -> UnixLabels.inet_addr
      val string_of_inet_addr : UnixLabels.inet_addr -> string
      val inet_addr_any : UnixLabels.inet_addr
      type socket_domain = Unix.socket_domain = PF_UNIX | PF_INET
      and socket_type =
        Unix.socket_type =
          SOCK_STREAM
        | SOCK_DGRAM
        | SOCK_RAW
        | SOCK_SEQPACKET
      and sockaddr =
        Unix.sockaddr =
          ADDR_UNIX of string
        | ADDR_INET of UnixLabels.inet_addr * int
      val socket :
        domain:UnixLabels.socket_domain ->
        kind:UnixLabels.socket_type -> protocol:int -> UnixLabels.file_descr
      val socketpair :
        domain:UnixLabels.socket_domain ->
        kind:UnixLabels.socket_type ->
        protocol:int -> UnixLabels.file_descr * UnixLabels.file_descr
      val accept :
        UnixLabels.file_descr -> UnixLabels.file_descr * UnixLabels.sockaddr
      val bind : UnixLabels.file_descr -> addr:UnixLabels.sockaddr -> unit
      val connect : UnixLabels.file_descr -> addr:UnixLabels.sockaddr -> unit
      val listen : UnixLabels.file_descr -> max:int -> unit
      type shutdown_command =
        Unix.shutdown_command =
          SHUTDOWN_RECEIVE
        | SHUTDOWN_SEND
        | SHUTDOWN_ALL
      val shutdown :
        UnixLabels.file_descr -> mode:UnixLabels.shutdown_command -> unit
      val getsockname : UnixLabels.file_descr -> UnixLabels.sockaddr
      val getpeername : UnixLabels.file_descr -> UnixLabels.sockaddr
      type msg_flag = Unix.msg_flag = MSG_OOB | MSG_DONTROUTE | MSG_PEEK
      val recv :
        UnixLabels.file_descr ->
        buf:string -> pos:int -> len:int -> mode:UnixLabels.msg_flag list -> int
      val recvfrom :
        UnixLabels.file_descr ->
        buf:string ->
        pos:int ->
        len:int -> mode:UnixLabels.msg_flag list -> int * UnixLabels.sockaddr
      val send :
        UnixLabels.file_descr ->
        buf:string -> pos:int -> len:int -> mode:UnixLabels.msg_flag list -> int
      val sendto :
        UnixLabels.file_descr ->
        buf:string ->
        pos:int ->
        len:int ->
        mode:UnixLabels.msg_flag list -> addr:UnixLabels.sockaddr -> int
      type socket_bool_option =
          SO_DEBUG
        | SO_BROADCAST
        | SO_REUSEADDR
        | SO_KEEPALIVE
        | SO_DONTROUTE
        | SO_OOBINLINE
        | SO_ACCEPTCONN
      and socket_int_option =
          SO_SNDBUF
        | SO_RCVBUF
        | SO_ERROR
        | SO_TYPE
        | SO_RCVLOWAT
        | SO_SNDLOWAT
      and socket_optint_option = SO_LINGER
      and socket_float_option = SO_RCVTIMEO | SO_SNDTIMEO
      val getsockopt :
        UnixLabels.file_descr -> UnixLabels.socket_bool_option -> bool
      val setsockopt :
        UnixLabels.file_descr -> UnixLabels.socket_bool_option -> bool -> unit
      external getsockopt_int :
        UnixLabels.file_descr -> UnixLabels.socket_int_option -> int
        = "unix_getsockopt_int"
      external setsockopt_int :
        UnixLabels.file_descr -> UnixLabels.socket_int_option -> int -> unit
        = "unix_setsockopt_int"
      external getsockopt_optint :
        UnixLabels.file_descr -> UnixLabels.socket_optint_option -> int option
        = "unix_getsockopt_optint"
      external setsockopt_optint :
        UnixLabels.file_descr ->
        UnixLabels.socket_optint_option -> int option -> unit
        = "unix_setsockopt_optint"
      external getsockopt_float :
        UnixLabels.file_descr -> UnixLabels.socket_float_option -> float
        = "unix_getsockopt_float"
      external setsockopt_float :
        UnixLabels.file_descr -> UnixLabels.socket_float_option -> float -> unit
        = "unix_setsockopt_float"
      val open_connection :
        UnixLabels.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:UnixLabels.sockaddr -> unit
      type host_entry =
        Unix.host_entry = {
        h_name : string;
        h_aliases : string array;
        h_addrtype : UnixLabels.socket_domain;
        h_addr_list : UnixLabels.inet_addr array;
      }
      and protocol_entry =
        Unix.protocol_entry = {
        p_name : string;
        p_aliases : string array;
        p_proto : int;
      }
      and 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 -> UnixLabels.host_entry
      val gethostbyaddr : UnixLabels.inet_addr -> UnixLabels.host_entry
      val getprotobyname : string -> UnixLabels.protocol_entry
      val getprotobynumber : int -> UnixLabels.protocol_entry
      val getservbyname : string -> protocol:string -> UnixLabels.service_entry
      val getservbyport : int -> protocol:string -> UnixLabels.service_entry
      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 : UnixLabels.file_descr -> UnixLabels.terminal_io
      type setattr_when = Unix.setattr_when = TCSANOW | TCSADRAIN | TCSAFLUSH
      val tcsetattr :
        UnixLabels.file_descr ->
        mode:UnixLabels.setattr_when -> UnixLabels.terminal_io -> unit
      val tcsendbreak : UnixLabels.file_descr -> duration:int -> unit
      val tcdrain : UnixLabels.file_descr -> unit
      type flush_queue = Unix.flush_queue = TCIFLUSH | TCOFLUSH | TCIOFLUSH
      val tcflush : UnixLabels.file_descr -> mode:UnixLabels.flush_queue -> unit
      type flow_action = Unix.flow_action = TCOOFF | TCOON | TCIOFF | TCION
      val tcflow : UnixLabels.file_descr -> mode:UnixLabels.flow_action -> unit
      val setsid : unit -> int
    end