Module Unix

module Unix: sig .. end
Extensions to Core.Unix.


Extensions to Core.Unix.
val fork_exec : ?stdin:Core.Unix.File_descr.t ->
?stdout:Core.Unix.File_descr.t ->
?stderr:Core.Unix.File_descr.t ->
?path_lookup:bool ->
?env:[ `Extend of (string * string) list | `Replace of (string * string) list ] ->
?working_dir:string ->
?setuid:int -> ?setgid:int -> string -> string list -> Core.Std.Pid.t
fork_exec prog args ~stdin ~stdout ~stderr ~setuid ~setgid forks a new process that executes the program in file prog, with arguments args. The pid of the new process is returned immediately; the new process executes concurrently with the current process.

The function raises EPERM if when using set{gid,uid} and the user id is not 0.

The standard input and outputs of the new process are connected to the descriptors stdin, stdout and stderr.

The close_on_exec flag is cleared from stderr stdout and stdin so it's safe to pass in fds with close_on_exec set.

path_lookup : if true than we use PATH to find the process to exec.
val seteuid : int -> unit
val setreuid : uid:int -> euid:int -> unit
val gettid : unit -> int
val ntohl : int -> int
Network to host order long, like C. Note that this is just a quick Binary_packing pack/unpack of 32-bit unsigned ints, it raises for n > 4294967295 (0xFFFFFFFF) and n < 0. This may be hilariously slow, bench it if you expect speed.
val htonl : int -> int
Host to network order long, like C. Same caveats for ntohl above
type statvfs = {
   bsize :int; (*file system block size*)
   frsize :int; (*fragment size*)
   blocks :int; (*size of fs in frsize units*)
   bfree :int; (*# free blocks*)
   bavail :int; (*# free blocks for non-root*)
   files :int; (*# inodes*)
   ffree :int; (*# free inodes*)
   favail :int; (*# free inodes for non-root*)
   fsid :int; (*file system ID*)
   flag :int; (*mount flags*)
   namemax :int; (*maximum filename length*)
}
val statvfs : string -> statvfs
get file system statistics
val getloadavg : unit -> float * float * float
get load averages
module Extended_passwd: sig .. end
val strptime : fmt:string -> string -> Core.Unix.tm
module Cidr: sig .. end
A representation of CIDR netmasks and functions to match if a given address is inside the range or not.
module Inet_port: sig .. end
Simple int wrapper to be explicit about ports.
module Mac_address: sig .. end
val bin_statvfs : statvfs Bin_prot.Type_class.t
val bin_read_statvfs : statvfs Bin_prot.Read_ml.reader
val bin_read_statvfs_ : statvfs Bin_prot.Unsafe_read_c.reader
val bin_read_statvfs__ : (int -> statvfs) Bin_prot.Unsafe_read_c.reader
val bin_reader_statvfs : statvfs Bin_prot.Type_class.reader
val bin_size_statvfs : statvfs Bin_prot.Size.sizer
val bin_write_statvfs : statvfs Bin_prot.Write_ml.writer
val bin_write_statvfs_ : statvfs Bin_prot.Unsafe_write_c.writer
val bin_writer_statvfs : statvfs Bin_prot.Type_class.writer
val statvfs_of_sexp : Sexplib.Sexp.t -> statvfs
val sexp_of_statvfs : statvfs -> Sexplib.Sexp.t