summaryrefslogtreecommitdiffstats
path: root/ocaml
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-06-04 14:59:16 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-06-04 15:06:27 +0100
commitb6adf09c4d2cc3f1d0285950c151b1fd7688ec67 (patch)
tree7ff59df24162a39824e65bf5e4fd0b4dafcad13a /ocaml
parent2ef06eacc2be08b0268c98a4d157176aff9356e0 (diff)
downloadlibguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.tar.gz
libguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.tar.xz
libguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.zip
Generated code for the 'sleep' command.
Diffstat (limited to 'ocaml')
-rw-r--r--ocaml/guestfs.ml1
-rw-r--r--ocaml/guestfs.mli3
-rw-r--r--ocaml/guestfs_c_actions.c23
3 files changed, 27 insertions, 0 deletions
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml
index cf75d7b9..7df33080 100644
--- a/ocaml/guestfs.ml
+++ b/ocaml/guestfs.ml
@@ -275,3 +275,4 @@ external lvresize : t -> string -> int -> unit = "ocaml_guestfs_lvresize"
external resize2fs : t -> string -> unit = "ocaml_guestfs_resize2fs"
external find : t -> string -> string array = "ocaml_guestfs_find"
external e2fsck_f : t -> string -> unit = "ocaml_guestfs_e2fsck_f"
+external sleep : t -> int -> unit = "ocaml_guestfs_sleep"
diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli
index 686bc609..6f77bb93 100644
--- a/ocaml/guestfs.mli
+++ b/ocaml/guestfs.mli
@@ -604,3 +604,6 @@ val find : t -> string -> string array
val e2fsck_f : t -> string -> unit
(** check an ext2/ext3 filesystem *)
+val sleep : t -> int -> unit
+(** sleep for some seconds *)
+
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);
+}
+