Page
Library
Module
Module type
Parameter
Class
Class type
Source
ExtUnixAllExtUnix
These functions are thin wrappers for underlying system API, consult the corresponding man pages and/or system documentation for details.
type ('a, 'b) carray = ('a, 'b, Bigarray.c_layout) Bigarray.Array1.ttype of bigarray used by BA submodules that read from files into bigarrays or write bigarrays into files. The only constraint here is Bigarray.c_layout. Naming: "bigarray with C layout" -> "carray".
type 'a carray8 =
('a, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.ttype of bigarray used by BA submodules that work with endianness and memory. Constraints are: 1. Bigarray.c_layout, 2. bigarray contains 8-bit integers. Naming: "bigarray with C layout and 8-bit elements" -> "carray8".
type open_flag = Unix.open_flaginclude sig ... endval eventfd : int -> Unix.file_descrval eventfd_read : Unix.file_descr -> int64val eventfd_write : Unix.file_descr -> int64 -> unitinclude sig ... endmodule Syslog : sig ... endinclude sig ... endval fsync : Unix.file_descr -> unitsynchronize a file's in-core state with storage device
include sig ... endval fdatasync : Unix.file_descr -> unitinclude sig ... endval syncfs : Unix.file_descr -> unitlike sync, but synchronizes just the file system containing file referred to by the open file descriptor fd
include sig ... endval dirfd : Unix.dir_handle -> Unix.file_descrinclude sig ... endtype st_flag = | ST_RDONLYMount read-only.
*)| ST_NOSUIDIgnore suid and sgid bits.
*)| ST_NODEVDisallow access to device special files.
*)| ST_NOEXECDisallow program execution.
*)| ST_SYNCHRONOUSWrites are synced at once.
*)| ST_MANDLOCKAllow mandatory locks on an FS.
*)| ST_WRITEWrite on file/directory/symlink.
*)| ST_APPENDAppend-only file.
*)| ST_IMMUTABLEImmutable file.
*)| ST_NOATIMEDo not update access times.
*)| ST_NODIRATIMEDo not update directory access times.
*)| ST_RELATIMEUpdate atime relative to mtime/ctime.
*)file system flags
type statvfs = {f_bsize : int;file system block size
*)f_blocks : int64;size of file system in blocks
*)f_bfree : int64;free blocks
*)f_bavail : int64;free blocks for unprivileged users
*)f_files : int64;inodes
*)f_ffree : int64;free inodes
*)f_favail : int64;free inodes for unprivileged users
*)f_fsid : int64;file system ID
*)f_flag : int;mount flags (raw value)
*)f_flags : st_flag list;mount flags (decoded)
*)f_namemax : int;maximum filename length
*)}val statvfs : string -> statvfsval fstatvfs : Unix.file_descr -> statvfsinclude sig ... endval openat :
Unix.file_descr ->
string ->
open_flag list ->
Unix.file_perm ->
Unix.file_descrSupported flags : AT_SYMLINK_NOFOLLOW AT_NO_AUTOMOUNT
val fstatat : Unix.file_descr -> string -> at_flag list -> Unix.statsSupported flags : AT_SYMLINK_NOFOLLOW AT_NO_AUTOMOUNT
Supported flags : AT_REMOVEDIR
val unlinkat : Unix.file_descr -> string -> at_flag list -> unitSupported flags : AT_REMOVEDIR
val renameat : Unix.file_descr -> string -> Unix.file_descr -> string -> unitval mkdirat : Unix.file_descr -> string -> int -> unitSupported flags : AT_SYMLINK_FOLLOW
val linkat :
Unix.file_descr ->
string ->
Unix.file_descr ->
string ->
at_flag list ->
unitSupported flags : AT_SYMLINK_FOLLOW
val symlinkat : string -> Unix.file_descr -> string -> unitval readlinkat : Unix.file_descr -> string -> stringval fchownat : Unix.file_descr -> string -> int -> int -> at_flag list -> unitval fchmodat : Unix.file_descr -> string -> int -> at_flag list -> unitval int_of_file_descr : Unix.file_descr -> intval file_descr_of_int : int -> Unix.file_descrinclude sig ... endval is_open_descr : Unix.file_descr -> boolinclude sig ... endAuthor: Sylvain Le Gall
type advice = | POSIX_FADV_NORMALIndicates that the application has no advice to give about its access pattern for the specified data.
*)| POSIX_FADV_SEQUENTIALThe application expects to access the specified data sequentially.
*)| POSIX_FADV_RANDOMThe specified data will be accessed in random order.
*)| POSIX_FADV_NOREUSEThe specified data will be accessed only once.
*)| POSIX_FADV_WILLNEEDThe specified data will be accessed in the near future.
*)| POSIX_FADV_DONTNEEDThe specified data will not be accessed in the near future.
*)access pattern
val fadvise : Unix.file_descr -> int -> int -> advice -> unitpredeclare an access pattern for file data
include sig ... endAllocate disk space for file
Author: Sylvain Le Gall
val fallocate : Unix.file_descr -> int -> int -> unitfallocate fd off len allocates disk space to ensure that subsequent writes between off and off + len in fd will not fail because of lack of disk space. The file size is modified if off + len is bigger than the current size.
include sig ... endval unsafe_all_pread : Unix.file_descr -> int -> Bytes.t -> int -> int -> intall_pread fd off buf ofs len reads up to len bytes from file descriptor fd at offset off (from the start of the file) into the string buf at offset ofs. The file offset is not changed.
all_pread repeats the read operation until all characters have been read or an error occurs. Returns less than the number of characters requested on EAGAIN, EWOULDBLOCK or End-of-file but only ever returns 0 on End-of-file. Continues the read operation on EINTR. Raises an Unix.Unix_error exception in all other cases.
val all_pread : Unix.file_descr -> int -> Bytes.t -> int -> int -> intval unsafe_single_pread :
Unix.file_descr ->
int ->
Bytes.t ->
int ->
int ->
intsingle_pread fd off buf ifs len reads up to len bytes from file descriptor fd at offset off (from the start of the file) into the string buf at offset ofs. The file offset is not changed.
single_pread attempts to read only once. Returns the number of characters read or raises an Unix.Unix_error exception.
val single_pread : Unix.file_descr -> int -> Bytes.t -> int -> int -> intval unsafe_pread : Unix.file_descr -> int -> Bytes.t -> int -> int -> intpread fd off buf ofs len reads up to len bytes from file descriptor fd at offset off (from the start of the file) into the string buf at offset ofs. The file offset is not changed.
pread repeats the read operation until all characters have been read or an error occurs. Raises an Unix.Unix_error exception if 0 characters could be read before an error occurs. Continues the read operation on EINTR. Returns the number of characters written in all other cases.
val pread : Unix.file_descr -> int -> Bytes.t -> int -> int -> intval unsafe_intr_pread : Unix.file_descr -> int -> Bytes.t -> int -> int -> intintr_pread fd off buf ofs len reads up to len bytes from file descriptor fd at offset off (from the start of the file) into the string buf at offset ofs. The file offset is not changed.
intr_pread repeats the read operation until all characters have been read or an error occurs. Raises an Unix.Unix_error exception if 0 characters could be read before an error occurs. Does NOT continue on EINTR. Returns the number of characters written in all other cases.
val intr_pread : Unix.file_descr -> int -> Bytes.t -> int -> int -> intinclude sig ... endval unsafe_all_pwrite : Unix.file_descr -> int -> string -> int -> int -> intall_pwrite fd off buf ofs len writes up to len bytes from file descriptor fd at offset off (from the start of the file) into the string buf at offset ofs. The file offset is not changed.
all_pwrite repeats the write operation until all characters have been written or an error occurs. Returns less than the number of characters requested on EAGAIN, EWOULDBLOCK but never 0. Continues the write operation on EINTR. Raises an Unix.Unix_error exception in all other cases.
val all_pwrite : Unix.file_descr -> int -> string -> int -> int -> intval unsafe_single_pwrite :
Unix.file_descr ->
int ->
string ->
int ->
int ->
intsingle_pwrite fd off buf ofs len writes up to len bytes from file descriptor fd at offset off (from the start of the file) into the string buf at offset ofs. The file offset is not changed.
single_pwrite attempts to write only once. Returns the number of characters written or raises an Unix.Unix_error exception.
val single_pwrite : Unix.file_descr -> int -> string -> int -> int -> intval unsafe_pwrite : Unix.file_descr -> int -> string -> int -> int -> intpwrite fd off buf ofs len writes up to len bytes from file descriptor fd at offset off (from the start of the file) into the string buf at offset ofs. The file offset is not changed.
pwrite repeats the write operation until all characters have been written or an error occurs. Raises an Unix.Unix_error exception if 0 characters could be written before an error occurs. Continues the write operation on EINTR. Returns the number of characters written in all other cases.
val pwrite : Unix.file_descr -> int -> string -> int -> int -> intval unsafe_intr_pwrite : Unix.file_descr -> int -> string -> int -> int -> intintr_pwrite fd off buf ofs len writes up to len bytes from file descriptor fd at offset off (from the start of the file) into the string buf at offset ofs. The file offset is not changed.
intr_pwrite repeats the write operation until all characters have been written or an error occurs. Raises an Unix.Unix_error exception if 0 characters could be written before an error occurs. Does NOT continue on EINTR. Returns the number of characters written in all other cases.
val intr_pwrite : Unix.file_descr -> int -> string -> int -> int -> intinclude sig ... endval unsafe_all_read : Unix.file_descr -> Bytes.t -> int -> int -> intall_read fd buf ofs len reads up to len bytes from file descriptor fd into the string buf at offset ofs.
all_read repeats the read operation until all characters have been read or an error occurs. Returns less than the number of characters requested on EAGAIN, EWOULDBLOCK or End-of-file but only ever returns 0 on End-of-file. Continues the read operation on EINTR. Raises an Unix.Unix_error exception in all other cases.
val all_read : Unix.file_descr -> Bytes.t -> int -> int -> intval unsafe_single_read : Unix.file_descr -> Bytes.t -> int -> int -> intsingle_read fd buf ifs len reads up to len bytes from file descriptor fd into the string buf at offset ofs.
single_read attempts to read only once. Returns the number of characters read or raises an Unix.Unix_error exception.
val single_read : Unix.file_descr -> Bytes.t -> int -> int -> intval unsafe_read : Unix.file_descr -> Bytes.t -> int -> int -> intread fd buf ofs len reads up to len bytes from file descriptor fd into the string buf at offset ofs.
read repeats the read operation until all characters have been read or an error occurs. Raises an Unix.Unix_error exception if 0 characters could be read before an error occurs. Continues the read operation on EINTR. Returns the number of characters written in all other cases.
val read : Unix.file_descr -> Bytes.t -> int -> int -> intval unsafe_intr_read : Unix.file_descr -> Bytes.t -> int -> int -> intintr_read fd buf ofs len reads up to len bytes from file descriptor fd into the string buf at offset ofs.
intr_read repeats the read operation until all characters have been read or an error occurs. Raises an Unix.Unix_error exception if 0 characters could be read before an error occurs. Does NOT continue on EINTR. Returns the number of characters written in all other cases.
val intr_read : Unix.file_descr -> Bytes.t -> int -> int -> intinclude sig ... endval unsafe_all_write : Unix.file_descr -> string -> int -> int -> intall_write fd buf ofs len writes up to len bytes from file descriptor fd into the string buf at offset ofs.
all_write repeats the write operation until all characters have been written or an error occurs. Returns less than the number of characters requested on EAGAIN, EWOULDBLOCK but never 0. Continues the write operation on EINTR. Raises an Unix.Unix_error exception in all other cases.
val all_write : Unix.file_descr -> string -> int -> int -> intval unsafe_single_write : Unix.file_descr -> string -> int -> int -> intsingle_write fd buf ofs len writes up to len bytes from file descriptor fd into the string buf at offset ofs.
single_write attempts to write only once. Returns the number of characters written or raises an Unix.Unix_error exception.
val single_write : Unix.file_descr -> string -> int -> int -> intval unsafe_write : Unix.file_descr -> string -> int -> int -> intwrite fd buf ofs len writes up to len bytes from file descriptor fd into the string buf at offset ofs.
write repeats the write operation until all characters have been written or an error occurs. Raises an Unix.Unix_error exception if 0 characters could be written before an error occurs. Continues the write operation on EINTR. Returns the number of characters written in all other cases.
val write : Unix.file_descr -> string -> int -> int -> intval unsafe_intr_write : Unix.file_descr -> string -> int -> int -> intintr_write fd buf ofs len writes up to len bytes from file descriptor fd into the string buf at offset ofs.
intr_write repeats the write operation until all characters have been written or an error occurs. Raises an Unix.Unix_error exception if 0 characters could be written before an error occurs. Does NOT continue on EINTR. Returns the number of characters written in all other cases.
val intr_write : Unix.file_descr -> string -> int -> int -> intmodule LargeFile : sig ... endFile operations on large files. This sub-module provides 64-bit variants of the functions ExtUnix.fadvise (for predeclaring an access pattern for file data), ExtUnix.fallocate (for allocating disk space for a file), ExtUnix.all_pread, ExtUnix.single_pread, ExtUnix.pread, ExtUnix.intr_pread, ExtUnix.all_pwrite, ExtUnix.single_pwrite, ExtUnix.pwrite and ExtUnix.intr_pwrite (for reading from or writing to a file descriptor at a given offset). These alternate functions represent positions and sizes by 64-bit integers (type int64) instead of regular integers (type int), thus allowing operating on files whose sizes are greater than max_int.
include sig ... endval mount :
source:string ->
target:string ->
fstype:string ->
mount_flag list ->
data:string ->
unitval umount2 : string -> umount2_flag list -> unitmodule Ioctl : sig ... endControl the underlying device parameters of special files
include sig ... endval ttyname : Unix.file_descr -> stringinclude sig ... endsetpgid pid pgid sets the process group of the process specified by pid to pgid. If pid is zero, then the process ID of the calling process is used. If pgid is zero, then the PGID of the process specified by pid is made the same as its process ID.
getpgid pid returns the PGID of the process specified by pid. If pid is zero, the process ID of the calling process is used.
include sig ... endsetreuid ruid euid sets real and effective user IDs of the calling process. Supplying a value of -1 for either the real or effective user ID forces the system to leave that ID unchanged.
include sig ... endsetresuid ruid euid suid sets real, effective and saved user IDs of the calling process. Supplying a value of -1 for either the real or effective user ID forces the system to leave that ID unchanged.
include sig ... endval tcgetpgrp : Unix.file_descr -> intval tcsetpgrp : Unix.file_descr -> int -> unitinclude sig ... endtype sysinfo = {uptime : int;Seconds since boot
*)loads : float * float * float;1, 5, and 15 minute load averages
*)totalram : int;Total usable main memory size
*)freeram : int;Available memory size
*)bufferram : int;Memory used by buffers
*)totalswap : int;Total swap space size
*)freeswap : int;swap space still available
*)procs : int;Number of current processes
*)totalhigh : int;Total high memory size
*)freehigh : int;Available high memory size
*)mem_unit : int;Memory unit size in bytes
*)}NB all memory fields in this structure are the multiplies of mem_unit bytes
val sysinfo : unit -> sysinfoinclude sig ... endval string_of_socket_int_option_ : socket_int_option_ -> stringtype socket_int_option = | TCP_KEEPCNTThe maximum number of keepalive probes TCP should send before dropping the connection
*)| TCP_KEEPIDLEThe time (in seconds) the connection needs to remain idle before TCP starts sending keepalive probes, if the socket option SO_KEEPALIVE has been set on this socket
*)| TCP_KEEPINTVLThe time (in seconds) between individual keepalive probes
*)| SO_ATTACH_BPFfile descriptor returned by the bpf(2), with program of type BPF_PROG_TYPE_SOCKET_FILTER
| SO_ATTACH_REUSEPORT_EBPFsame as for SO_ATTACH_BPF
*)Extra socket options with integer value not covered in Unix module. NB Not all options available on all platforms, use have_sockopt to check at runtime (even when function is defined in Specific module)
val make_socket_int_option : socket_int_option -> socket_int_option_val make_socket_bool_option : socket_bool_option -> socket_int_option_val make_socket_unit_option : socket_unit_option -> socket_int_option_val have_sockopt_unit : socket_unit_option -> boolval have_sockopt_bool : socket_bool_option -> boolval have_sockopt_int : socket_int_option -> boolval have_sockopt : socket_int_option -> boolobsolete, compatibility
val setsockopt_unit : Unix.file_descr -> socket_unit_option -> unitSet the option without value on the given socket
val setsockopt : Unix.file_descr -> socket_bool_option -> bool -> unitSet a boolean-valued option in the given socket
val getsockopt : Unix.file_descr -> socket_bool_option -> boolGet the current value for the boolean-valued option in the given socket
val setsockopt_int : Unix.file_descr -> socket_int_option -> int -> unitSet an integer-valued option in the given socket
val getsockopt_int : Unix.file_descr -> socket_int_option -> intGet the current value for the integer-valued option in the given socket
include sig ... endmodule Poll : sig ... endval poll :
(Unix.file_descr * Poll.t) array ->
?n:int ->
float ->
(Unix.file_descr * Poll.t) listinclude sig ... endOCaml bindings for signalfd(2) and related functions
Author: Kaustuv Chaudhuri <kaustuv.chaudhuri@inria.fr>
val signalfd :
?fd:Unix.file_descr ->
sigs:int list ->
flags:int list ->
unit ->
Unix.file_descrsignalfd ?fd sigs flags () If the first optional argument is omitted, then a new file descriptor is allocated. Otherwise, the given file descriptor is modified (in which case it must have been created with signalfd previously). When you are done with the fd, remember to Unix.close it. Do not forget to block sigs with Unix.sigprocmask to prevent signal handling according to default dispositions.
val signalfd_read : Unix.file_descr -> ssiBlocking read(2) on a signalfd. Has undefined behaviour on non-signalfds. Every successful read consumes a pending signal.
val ssi_signo_sys : ssi -> intGet the signal value. This form is compatible with the signal values defined in the standard Sys module.
See signalfd(2) for the details of the remaining functions. Most of these integers are actually unsigned.
val ssi_signo : ssi -> int32val ssi_errno : ssi -> int32val ssi_code : ssi -> int32val ssi_pid : ssi -> int32val ssi_uid : ssi -> int32val ssi_fd : ssi -> Unix.file_descrval ssi_tid : ssi -> int32val ssi_band : ssi -> int32val ssi_overrun : ssi -> int32val ssi_trapno : ssi -> int32val ssi_status : ssi -> int32val ssi_int : ssi -> int32val ssi_ptr : ssi -> int64val ssi_utime : ssi -> int64val ssi_stime : ssi -> int64val ssi_addr : ssi -> int64include sig ... endAuthor: Sylvain Le Gall <sylvain@le-gall.net>
type resource = | RLIMIT_CORELimit on size of core dump file.
*)| RLIMIT_CPULimit on CPU time per process.
*)| RLIMIT_DATALimit on data segment size.
*)| RLIMIT_FSIZELimit on file size.
*)| RLIMIT_NOFILELimit on number of open files.
*)| RLIMIT_STACKLimit on stack size.
*)| RLIMIT_ASLimit on address space size.
*)val string_of_resource : resource -> stringget resource name
module Rlimit : sig ... endLimits
val getpriority : which_prio_t -> priorityGet nice value
val setpriority : which_prio_t -> priority -> unitSet nice value
getrusage is not implemented because the only meaningful information it provides are ru_utime and ru_stime which can be accessed through Unix.times.
include sig ... endval mlockall : mlockall_flag list -> unitLock all pages mapped into the address space of the calling process.
include sig ... endval memalign : int -> int -> Bigarray.int8_unsigned_elt carray8memalign alignment size creates a Bigarray.Array1.t of size bytes, which data is aligned to alignment (must be a power of 2)
Author: Goswin von Brederlow
include sig ... endval strptime : string -> string -> Unix.tmThis function is the converse of the strftime function. strptime fmt data convert a string containing time information data into a tm struct according to the format specified by fmt.
val asctime : Unix.tm -> stringReturn the ascii representation of a given tm argument. The ascii time is returned in the form of a string like 'Wed Jun 30, 21:21:21 2005\n'
include sig ... endval timegm : Unix.tm -> floatInverse of Unix.gmtime
include sig ... endAuthor: Niki Yoshiuchi <aplusbi@gmail.com>
val posix_openpt : open_flag list -> Unix.file_descrThis function opens a pseudo-terminal device.
val grantpt : Unix.file_descr -> unitThis function grants access to the slave pseudo-terminal.
val unlockpt : Unix.file_descr -> unitThis function unlock a pseudo-terminal master/slave pair.
val ptsname : Unix.file_descr -> stringThis function get the name of the slave pseudo-terminal.
include sig ... endNB native function backtrace may fail to unwind the OCaml callstack correctly or even segfault. Do not use lightly.
See bug #1290, PR#5344 and Debian bug #637380 for details.
include sig ... endval ptrace : int -> ptrace_request -> unitinclude sig ... endsetenv name value overwrite adds the variable name to the environment with the value value, if name does not already exist or overwrite is true
include sig ... endval mkstemp : ?suffix:string -> string -> Unix.file_descr * stringmkstemp ?(suffix="") prefix generates a unique temporary filename in the form prefixXXXXXXsuffix, creates and opens the file, and returns an open file descriptor and name for the file.
include sig ... endval mkostemp :
?suffix:string ->
?flags:open_flag list ->
string ->
Unix.file_descr * stringmkostemp ?(suffix="") ?(flags=[]) prefix generates a unique temporary filename in the form prefixXXXXXXsuffix, creates and opens the file with flags, and returns an open file descriptor and name for the file.
module BigEndian : sig ... endmodule LittleEndian : sig ... endmodule HostEndian : sig ... endinclude sig ... endAuthor: Andre Nathan
val read_credentials : Unix.file_descr -> int * int * intReads sender credentials from a file descriptor, returning a 3-element tuple containing the sender process' PID, UID and GID.
include sig ... endAuthor: Andre Nathan
val fexecve : Unix.file_descr -> string array -> string array -> 'afexecve fd args env executes the program in file represented by file descriptor fd with arguments args and environment variables given by env. As with the execv* functions, on success fexecve never returns; the current process is replaced by the new one.
include sig ... endAuthor: Andre Nathan
val sendmsg : Unix.file_descr -> ?sendfd:Unix.file_descr -> string -> unitSend a message and optionally a file descriptor through a socket. Passing file descriptors requires UNIX domain sockets and a non-empty message.
val recvmsg_fd : Unix.file_descr -> Unix.file_descr option * stringRecieve a message and possibly a file descriptor from a socket.
val sendfd : sock:Unix.file_descr -> fd:Unix.file_descr -> unitsendfd sock fd sends a file descriptor fd through a UNIX domain socket sock. This will send a sentinel message at the same time, otherwise sendmsg will not pass the file descriptor.
val recvfd : Unix.file_descr -> Unix.file_descrReceive a file descriptor sent through a UNIX domain socket, ignoring the message.
exception Recvfd of Unix.file_descr * stringval recvmsg : Unix.file_descr -> stringval recvmsg_nofd : Unix.file_descr -> stringReceive a message sent through a UNIX domain socket. Closes and ignores file descriptors.
include sig ... endAuthor: Roman Vorobets
type sysconf_name = | ARG_MAXThe maximum length of the arguments to the exec(3) family of functions.
*)| CHILD_MAXThe max number of simultaneous processes per user ID.
*)| HOST_NAME_MAXMax length of a hostname, not including the terminating null byte, as returned by gethostname(2).
*)| LOGIN_NAME_MAXMaximum length of a login name, including the terminating null byte.
*)| CLK_TCKThe number of clock ticks per second.
*)| OPEN_MAXThe maximum number of files that a process can have open at any time.
*)| PAGESIZESize of a page in bytes.
*)| RE_DUP_MAXThe number of repeated occurrences of a BRE permitted by regexec(3) and regcomp(3).
*)| STREAM_MAXThe maximum number of streams that a process can have open at any time.
*)| SYMLOOP_MAXThe maximum number of symbolic links seen in a pathname before resolution returns ELOOP.
*)| TTY_NAME_MAXThe maximum length of terminal device name, including the terminating null byte.
*)| TZNAME_MAXThe maximum number of bytes in a timezone name.
*)| POSIX_VERSIONIndicates the year and month the POSIX.1 standard was approved in the format YYYYMML; the value 199009L indicates the Sept. 1990 revision.
*)| LINE_MAXThe maximum length of a utility's input line, either from standard input or from a file. This includes space for a trailing newline.
*)| POSIX2_VERSIONIndicates the version of the POSIX.2 standard in the format of YYYYMML.
*)| PHYS_PAGESThe number of pages of physical memory. Note that it is possible for the product of this value and the value of PAGE_SIZE to overflow. Non-standard, may be not available
| AVPHYS_PAGESThe number of currently available pages of physical memory. Non-standard, may be not available
*)| NPROCESSORS_CONFThe number of processors configured. Non-standard, may be not available
*)| NPROCESSORS_ONLNThe number of processors currently online (available). Non-standard, may be not available
*)name of the variable
val sysconf : sysconf_name -> int64get configuration information at runtime, may raise Not_available for non-standard options (see above) even in Specific module
include sig ... endAuthor: Pierre Chambart <pierre.chambart@ocamlpro.com>
type splice_flag = | SPLICE_F_MOVEAttempt to move pages instead of copying. Only a hint to the kernel
*)| SPLICE_F_NONBLOCKDo not block on I/O
*)| SPLICE_F_MOREAnnounce that more data will be coming. Hint used by sockets
*)| SPLICE_F_GIFTThe user pages are a gift to the kernel. The application may not modify this memory ever, or page cache and on-disk data may differ. Gifting pages to the kernel means that a subsequent splice(2) SPLICE_F_MOVE can successfully move the pages; if this flag is not specified, then a subsequent splice(2) SPLICE_F_MOVE must copy the pages. Data must also be properly page aligned, both in memory and length.
Only use for vmsplice.
splice functions flags
include sig ... endval splice :
Unix.file_descr ->
int option ->
Unix.file_descr ->
int option ->
int ->
splice_flag list ->
intsplice fd_in off_in fd_out off_out len flags moves data between two file descriptors without copying between kernel address space and user address space. It transfers up to len bytes of data from the file descriptor fd_in to the file descriptor fd_out, where one of the descriptors must refer to a pipe.
If fd_in refers to a pipe, then off_in must be None. If fd_in does not refer to a pipe and off_in is None, then bytes are read from fd_in starting from the current file offset, and the current file offset is adjusted appropriately. If fd_in does not refer to a pipe and off_in is Some n, then n mspecifies the starting offset from which bytes will be read from fd_in; in this case, the current file offset of fd_in is not changed. Analogous statements apply for fd_out and off_out.
include sig ... endval tee : Unix.file_descr -> Unix.file_descr -> int -> splice_flag list -> inttee fd_in fd_out len flags duplicates up to len bytes of data from the pipe fd_in to the pipe fd_out. It does not consume the data that is duplicated from fd_in; therefore, that data can be copied by a subsequent splice.
module BA : sig ... end