Module ExtUnixAll.BA

module BA: sig .. end


pread

Author: Goswin von Brederlow

val unsafe_all_pread : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
all_pread fd off buf reads up to size of buf bytes from file descriptor fd at offset off (from the start of the file) into the buffer buf. 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 -> ('a, 'b) ExtUnixAll.carray -> int
val unsafe_single_pread : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
single_pread fd off buf reads up to size of buf bytes from file descriptor fd at offset off (from the start of the file) into the buffer buf. 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. Unlike the string variant of the same name there is no limit on the number of characters read.

val single_pread : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
val unsafe_pread : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
pread fd off buf reads up to size of buf bytes from file descriptor fd at offset off (from the start of the file) into the buffer buf. 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 -> ('a, 'b) ExtUnixAll.carray -> int
val unsafe_intr_pread : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
intr_pread fd off buf reads up to size of buf bytes from file descriptor fd at offset off (from the start of the file) into the buffer buf. 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 -> ('a, 'b) ExtUnixAll.carray -> int

pwrite

Author: Goswin von Brederlow

val unsafe_all_pwrite : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
all_pwrite fd off buf writes up to size of buf bytes from file descriptor fd at offset off (from the start of the file) into the buffer buf. 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 -> ('a, 'b) ExtUnixAll.carray -> int
val unsafe_single_pwrite : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
single_pwrite fd off buf writes up to size of buf bytes from file descriptor fd at offset off (from the start of the file) into the buffer buf. 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. Unlike the string variant of the same name there is no limit on the number of characters written.

val single_pwrite : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
val unsafe_pwrite : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
pwrite fd off buf writes up to size of buf bytes from file descriptor fd at offset off (from the start of the file) into the buffer buf. 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 -> ('a, 'b) ExtUnixAll.carray -> int
val unsafe_intr_pwrite : Unix.file_descr -> int -> ('a, 'b) ExtUnixAll.carray -> int
intr_pwrite fd off buf writes up to size of buf bytes from file descriptor fd at offset off (from the start of the file) into the buffer buf. 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 -> ('a, 'b) ExtUnixAll.carray -> int

read

Author: Goswin von Brederlow

val all_read : Unix.file_descr -> ('a, 'b) ExtUnixAll.carray -> int
all_read fd buf reads up to size of buf bytes from file descriptor fd into the buffer buf.

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 single_read : Unix.file_descr -> ('a, 'b) ExtUnixAll.carray -> int
single_read fd buf reads up to size of buf bytes from file descriptor fd into the buffer buf.

single_read attempts to read only once. Returns the number of characters read or raises an Unix.Unix_error exception. Unlike the string variant of the same name there is no limit on the number of characters read.

val read : Unix.file_descr -> ('a, 'b) ExtUnixAll.carray -> int
read fd buf reads up to size of buf bytes from file descriptor fd into the buffer buf.

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 intr_read : Unix.file_descr -> ('a, 'b) ExtUnixAll.carray -> int
intr_read fd buf reads up to size of buf bytes from file descriptor fd into the buffer buf.

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.


write

Author: Goswin von Brederlow

val all_write : Unix.file_descr -> ('a, 'b) ExtUnixAll.carray -> int
all_write fd buf writes up to size of buf bytes from file descriptor fd into the buffer buf.

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 single_write : Unix.file_descr -> ('a, 'b) ExtUnixAll.carray -> int
single_write fd buf writes up to size of buf bytes from file descriptor fd into the buffer buf.

single_write attempts to write only once. Returns the number of characters written or raises an Unix.Unix_error exception. Unlike the string variant of the same name there is no limit on the number of characters written.

val write : Unix.file_descr -> ('a, 'b) ExtUnixAll.carray -> int
write fd buf writes up to size of buf bytes from file descriptor fd into the buffer buf.

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 intr_write : Unix.file_descr -> ('a, 'b) ExtUnixAll.carray -> int
intr_write fd buf writes up to size of buf bytes from file descriptor fd into the buffer buf.

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.


Byte order conversion


module BigEndian: sig .. end
big endian functions
module LittleEndian: sig .. end
little endian functions
module HostEndian: sig .. end
host endian functions
val unsafe_get_substr : 'a ExtUnixAll.carray8 -> int -> int -> string
unsafe_get_substr buf off len extracts the substring from buffer buf starting at offset off and length len. Bounds checking is not performed. Use with caution and only when the program logic guarantees that the access is within bounds.
val get_substr : 'a ExtUnixAll.carray8 -> int -> int -> string
get_substr buf off len same as unsafe_get_substr but with bounds checking.
val unsafe_set_substr : 'a ExtUnixAll.carray8 -> int -> string -> unit
unsafe_set_substr buf off str stores the string in buffer buf starting at offset off. Bounds checking is not performed. Use with caution and only when the program logic guarantees that the access is within bounds.
val set_substr : 'a ExtUnixAll.carray8 -> int -> string -> unit
set_substr buf off str same as unsafe_set_substr but with bounds checking.

splice

Author: Pierre Chambart <pierre.chambart@ocamlpro.com>

type 'a iov = {
   iov_buf : 'a ExtUnixAll.carray8;
   iov_off : int;
   iov_len : int;
}
I/O vector. Used to send multiple data using a single system call
val vmsplice : Unix.file_descr ->
'a iov array -> ExtUnixAll.splice_flag list -> int
vmsplice fd iovs flags sends the data described by iovs to the pipe fd
Returns the number of bytes transferred to the pipe.