mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
ocaml: Add handling for errno EINVAL.
This commit is contained in:
@@ -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\"
|
||||
|
||||
@@ -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);
|
||||
@@ -442,6 +443,13 @@ ocaml_guestfs_last_errno (value gv)
|
||||
CAMLreturn (rv);
|
||||
}
|
||||
|
||||
/* NB: "noalloc" function. */
|
||||
value
|
||||
ocaml_guestfs_get_EINVAL (value unitv)
|
||||
{
|
||||
return Val_int (EINVAL);
|
||||
}
|
||||
|
||||
/* NB: "noalloc" function. */
|
||||
value
|
||||
ocaml_guestfs_get_ENOTSUP (value unitv)
|
||||
|
||||
Reference in New Issue
Block a user