summaryrefslogtreecommitdiffstats
path: root/ocaml
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-07-16 19:11:52 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-07-16 19:15:29 +0100
commite72592563c0be15f1b2400e15205d5e803875685 (patch)
treeda3e31ff7c13b14ffe15cbd6dd07d9ee3eb4e08d /ocaml
parent8ee5c6d3a77b62f7c107db39751bb60366bee7b7 (diff)
downloadlibguestfs-e72592563c0be15f1b2400e15205d5e803875685.tar.gz
libguestfs-e72592563c0be15f1b2400e15205d5e803875685.tar.xz
libguestfs-e72592563c0be15f1b2400e15205d5e803875685.zip
ocaml: Bind guestfs_last_errno.
Diffstat (limited to 'ocaml')
-rw-r--r--ocaml/guestfs_c.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ocaml/guestfs_c.c b/ocaml/guestfs_c.c
index 45b8eaed..3f862ea2 100644
--- a/ocaml/guestfs_c.c
+++ b/ocaml/guestfs_c.c
@@ -52,6 +52,7 @@ CAMLprim value ocaml_guestfs_create (void);
CAMLprim value ocaml_guestfs_close (value gv);
CAMLprim value ocaml_guestfs_set_event_callback (value gv, value closure, value events);
CAMLprim value ocaml_guestfs_delete_event_callback (value gv, value eh);
+value ocaml_guestfs_last_errno (value gv);
value ocaml_guestfs_user_cancel (value gv);
/* Allocate handles and deal with finalization. */
@@ -374,6 +375,24 @@ event_callback_wrapper (guestfs_h *g,
CAMLreturn0;
}
+value
+ocaml_guestfs_last_errno (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+ int r;
+ guestfs_h *g;
+
+ g = Guestfs_val (gv);
+ if (g == NULL)
+ ocaml_guestfs_raise_closed ("last_errno");
+
+ r = guestfs_last_errno (g);
+
+ rv = Val_int (r);
+ CAMLreturn (rv);
+}
+
/* NB: This is and must remain a "noalloc" function. */
value
ocaml_guestfs_user_cancel (value gv)