summaryrefslogtreecommitdiffstats
path: root/ocaml/guestfs_c_actions.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-05-01 11:18:53 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-05-01 11:18:53 +0100
commit9222136ac9b2e404dba128b1ac74dacaa8bf1038 (patch)
tree84d74f0c966b925c3e22bf3322256df10455d94b /ocaml/guestfs_c_actions.c
parent2dc9e8a858b62830d15a8186fe575eb7903d2171 (diff)
downloadlibguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.tar.gz
libguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.tar.xz
libguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.zip
Generated code for drop-caches command.
Diffstat (limited to 'ocaml/guestfs_c_actions.c')
-rw-r--r--ocaml/guestfs_c_actions.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c
index f4c18088..d6d13053 100644
--- a/ocaml/guestfs_c_actions.c
+++ b/ocaml/guestfs_c_actions.c
@@ -2942,3 +2942,26 @@ ocaml_guestfs_mv (value gv, value srcv, value destv)
CAMLreturn (rv);
}
+CAMLprim value
+ocaml_guestfs_drop_caches (value gv, value whattodropv)
+{
+ CAMLparam2 (gv, whattodropv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("drop_caches: used handle after closing it");
+
+ int whattodrop = Int_val (whattodropv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_drop_caches (g, whattodrop);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "drop_caches");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+