1libnbd-ocaml(3)                     LIBNBD                     libnbd-ocaml(3)
2
3
4

NAME

6       libnbd-ocaml - how to use libnbd from OCaml
7

SYNOPSIS

9        let nbd = NBD.create () in
10        NBD.connect_uri nbd "nbd://localhost";
11        let size = NBD.get_size nbd in
12        printf "%Ld\n" size
13

DESCRIPTION

15       This manual page documents how to use libnbd to access Network Block
16       Device (NBD) servers from the OCaml programming language.  The OCaml
17       bindings work very similarly to the C bindings so you should start by
18       reading libnbd(3).
19

HANDLES

21       Create a libnbd handle of type "NBD.t" by calling "NBD.create ()".
22
23       You can either close the handle explicitly by calling "NBD.close" or it
24       will be closed automatically when it is garbage collected.  If you call
25       any other method on a handle which you have explicitly closed then the
26       API will throw an "NBD.Closed" exception.
27

ERRORS

29       Libnbd errors are turned automatically into "NBD.Error (str, errno)"
30       exceptions.  This exception has two parameters.  The first is a string
31       which is the printable error message.  The second is the raw "errno",
32       if available (see nbd_get_errno(3)).  The raw "errno" is not compatible
33       with errors in the OCaml "Unix" module unfortunately.
34

EXAMPLES

36       This directory contains examples written in OCaml:
37
38       https://github.com/libguestfs/libnbd/tree/master/ocaml/examples
39

SEE ALSO

41       libnbd(3).
42

AUTHORS

44       Richard W.M. Jones
45
47       Copyright (C) 2019 Red Hat Inc.
48

LICENSE

50       This library is free software; you can redistribute it and/or modify it
51       under the terms of the GNU Lesser General Public License as published
52       by the Free Software Foundation; either version 2 of the License, or
53       (at your option) any later version.
54
55       This library is distributed in the hope that it will be useful, but
56       WITHOUT ANY WARRANTY; without even the implied warranty of
57       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
58       Lesser General Public License for more details.
59
60       You should have received a copy of the GNU Lesser General Public
61       License along with this library; if not, write to the Free Software
62       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
63       02110-1301 USA
64
65
66
67libnbd-1.3.7                      2020-04-23                   libnbd-ocaml(3)
Impressum