diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-04 14:59:16 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-04 15:06:27 +0100 |
commit | b6adf09c4d2cc3f1d0285950c151b1fd7688ec67 (patch) | |
tree | 7ff59df24162a39824e65bf5e4fd0b4dafcad13a /ocaml/guestfs_c_actions.c | |
parent | 2ef06eacc2be08b0268c98a4d157176aff9356e0 (diff) | |
download | libguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.tar.gz libguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.tar.xz libguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.zip |
Generated code for the 'sleep' command.
Diffstat (limited to 'ocaml/guestfs_c_actions.c')
-rw-r--r-- | ocaml/guestfs_c_actions.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index 73dfdd9f..615d209e 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -4151,3 +4151,26 @@ 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); +} + |