X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=ocaml%2Fguestfs_c_actions.c;h=45c9883f6ad93caa5f1561d49759145165b39825;hb=9c662c7ea543ca5bc9ffae45283e92db7ba68e1f;hp=73dfdd9f7b0156851b4dbd1c3bdb485b3b8a8da4;hpb=d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e;p=libguestfs.git diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index 73dfdd9..45c9883 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -4151,3 +4151,50 @@ ocaml_guestfs_e2fsck_f (value gv, value devicev) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_sleep (value gv, value secsv) +{ + CAMLparam2 (gv, secsv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("sleep: used handle after closing it"); + + int secs = Int_val (secsv); + int r; + + caml_enter_blocking_section (); + r = guestfs_sleep (g, secs); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "sleep"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_ntfs_3g_probe (value gv, value rwv, value devicev) +{ + CAMLparam3 (gv, rwv, devicev); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("ntfs_3g_probe: used handle after closing it"); + + int rw = Bool_val (rwv); + const char *device = String_val (devicev); + int r; + + caml_enter_blocking_section (); + r = guestfs_ntfs_3g_probe (g, rw, device); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "ntfs_3g_probe"); + + rv = Val_int (r); + CAMLreturn (rv); +} +