X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=ocaml%2Fguestfs_c_actions.c;fp=ocaml%2Fguestfs_c_actions.c;h=04be818009ffa6dcdeb8f98d75d59fdce953439b;hp=d8b0567701a6592f65ed66511ad62ec122285a06;hb=b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18;hpb=405cf2a5772611ea05cca9fefa843154a9bc64a3 diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index d8b0567..04be818 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -4542,3 +4542,49 @@ ocaml_guestfs_tail_n (value gv, value nrlinesv, value pathv) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_df (value gv) +{ + CAMLparam1 (gv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("df: used handle after closing it"); + + char *r; + + caml_enter_blocking_section (); + r = guestfs_df (g); + caml_leave_blocking_section (); + if (r == NULL) + ocaml_guestfs_raise_error (g, "df"); + + rv = caml_copy_string (r); + free (r); + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_df_h (value gv) +{ + CAMLparam1 (gv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("df_h: used handle after closing it"); + + char *r; + + caml_enter_blocking_section (); + r = guestfs_df_h (g); + caml_leave_blocking_section (); + if (r == NULL) + ocaml_guestfs_raise_error (g, "df_h"); + + rv = caml_copy_string (r); + free (r); + CAMLreturn (rv); +} +