---
generator/ocaml.ml | 3 +++
ocaml/guestfs-c.c | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/generator/ocaml.ml b/generator/ocaml.ml
index d2a4690..05c7456 100644
--- a/generator/ocaml.ml
+++ b/generator/ocaml.ml
@@ -132,6 +132,7 @@ val last_errno : t -> int
which you can use to test the return value of {!Guestfs.last_errno}. *)
module Errno : sig
+ val errno_EINVAL : int
val errno_ENOTSUP : int
val errno_EPERM : int
val errno_ESRCH : int
@@ -286,6 +287,8 @@ external event_to_string : event list -> string
external last_errno : t -> int = \"ocaml_guestfs_last_errno\"
module Errno = struct
+ external einval : unit -> int = \"ocaml_guestfs_get_EINVAL\"
\"noalloc\"
+ let errno_EINVAL = einval ()
external enotsup : unit -> int = \"ocaml_guestfs_get_ENOTSUP\"
\"noalloc\"
let errno_ENOTSUP = enotsup ()
external eperm : unit -> int = \"ocaml_guestfs_get_EPERM\"
\"noalloc\"
diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c
index f1a941c..9603f04 100644
--- a/ocaml/guestfs-c.c
+++ b/ocaml/guestfs-c.c
@@ -63,6 +63,7 @@ value ocaml_guestfs_set_event_callback (value gv, value closure, value
events);
value ocaml_guestfs_delete_event_callback (value gv, value eh);
value ocaml_guestfs_event_to_string (value events);
value ocaml_guestfs_last_errno (value gv);
+value ocaml_guestfs_get_EINVAL (value unitv);
value ocaml_guestfs_get_ENOTSUP (value unitv);
value ocaml_guestfs_get_EPERM (value unitv);
value ocaml_guestfs_get_ESRCH (value unitv);
@@ -444,6 +445,13 @@ ocaml_guestfs_last_errno (value gv)
/* NB: "noalloc" function. */
value
+ocaml_guestfs_get_EINVAL (value unitv)
+{
+ return Val_int (EINVAL);
+}
+
+/* NB: "noalloc" function. */
+value
ocaml_guestfs_get_ENOTSUP (value unitv)
{
return Val_int (ENOTSUP);
--
2.3.1