12
12
(***********************************************************************)
14
(* $Id: unix.mli,v 1.85.4.1 2007/11/10 12:43:13 xleroy Exp $ *)
14
(* $Id: unix.mli,v 1.89 2008/09/04 13:53:43 doligez Exp $ *)
16
16
(** Interface to the Unix system *)
144
144
| WSTOPPED of int
145
145
(** The process was stopped by a signal; the argument is the
146
146
signal number. *)
147
(** The termination status of a process. *)
147
(** The termination status of a process. See module {!Sys} for the
148
definitions of the standard signal numbers. Note that they are
149
not the numbers used by the OS. *)
996
998
| SO_DONTROUTE (** Bypass the standard routing algorithms *)
997
999
| SO_OOBINLINE (** Leave out-of-band data in line *)
998
1000
| SO_ACCEPTCONN (** Report whether socket listening is enabled *)
1001
| TCP_NODELAY (** Control the Nagle algorithm for TCP sockets *)
1002
| IPV6_ONLY (** Forbid binding an IPv6 socket to an IPv4 address *)
999
1003
(** The socket options that can be consulted with {!Unix.getsockopt}
1000
1004
and modified with {!Unix.setsockopt}. These options have a boolean
1001
1005
([true]/[false]) value. *)
1003
1007
type socket_int_option =
1004
1008
SO_SNDBUF (** Size of send buffer *)
1005
1009
| SO_RCVBUF (** Size of received buffer *)
1006
| SO_ERROR (** Report the error status and clear it *)
1010
| SO_ERROR (** Deprecated. Use {!Unix.getsockopt_error} instead. *)
1007
1011
| SO_TYPE (** Report the socket type *)
1008
1012
| SO_RCVLOWAT (** Minimum number of bytes to process for input operations *)
1009
1013
| SO_SNDLOWAT (** Minimum number of bytes to process for output operations *)
1034
1038
val setsockopt : file_descr -> socket_bool_option -> bool -> unit
1035
1039
(** Set or clear a boolean-valued option in the given socket. *)
1037
external getsockopt_int :
1038
file_descr -> socket_int_option -> int = "unix_getsockopt_int"
1041
val getsockopt_int : file_descr -> socket_int_option -> int
1039
1042
(** Same as {!Unix.getsockopt} for an integer-valued socket option. *)
1041
external setsockopt_int :
1042
file_descr -> socket_int_option -> int -> unit = "unix_setsockopt_int"
1044
val setsockopt_int : file_descr -> socket_int_option -> int -> unit
1043
1045
(** Same as {!Unix.setsockopt} for an integer-valued socket option. *)
1045
external getsockopt_optint :
1046
file_descr -> socket_optint_option -> int option = "unix_getsockopt_optint"
1047
val getsockopt_optint : file_descr -> socket_optint_option -> int option
1047
1048
(** Same as {!Unix.getsockopt} for a socket option whose value is an [int option]. *)
1049
external setsockopt_optint :
1050
file_descr -> socket_optint_option -> int option ->
1051
unit = "unix_setsockopt_optint"
1050
val setsockopt_optint :
1051
file_descr -> socket_optint_option -> int option -> unit
1052
1052
(** Same as {!Unix.setsockopt} for a socket option whose value is an [int option]. *)
1054
external getsockopt_float :
1055
file_descr -> socket_float_option -> float = "unix_getsockopt_float"
1054
val getsockopt_float : file_descr -> socket_float_option -> float
1056
1055
(** Same as {!Unix.getsockopt} for a socket option whose value is a floating-point number. *)
1058
external setsockopt_float :
1059
file_descr -> socket_float_option -> float -> unit = "unix_setsockopt_float"
1057
val setsockopt_float : file_descr -> socket_float_option -> float -> unit
1060
1058
(** Same as {!Unix.setsockopt} for a socket option whose value is a floating-point number. *)
1060
val getsockopt_error : file_descr -> error option
1061
(** Return the error condition associated with the given socket,
1062
1064
(** {6 High-level network connection functions} *)