Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ocaml: Add Guestfs.Errno.errno_EPERM.
  • Loading branch information
rwmjones committed Mar 26, 2015
1 parent 0c396a4 commit 6297534
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generator/ocaml.ml
Expand Up @@ -133,6 +133,7 @@ val last_errno : t -> int
module Errno : sig
val errno_ENOTSUP : int
val errno_EPERM : int
val errno_ESRCH : int
end
Expand Down Expand Up @@ -276,6 +277,8 @@ external last_errno : t -> int = \"ocaml_guestfs_last_errno\"
module Errno = struct
external enotsup : unit -> int = \"ocaml_guestfs_get_ENOTSUP\" \"noalloc\"
let errno_ENOTSUP = enotsup ()
external eperm : unit -> int = \"ocaml_guestfs_get_EPERM\" \"noalloc\"
let errno_EPERM = eperm ()
external esrch : unit -> int = \"ocaml_guestfs_get_ESRCH\" \"noalloc\"
let errno_ESRCH = esrch ()
end
Expand Down
8 changes: 8 additions & 0 deletions ocaml/guestfs-c.c
Expand Up @@ -64,6 +64,7 @@ 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_ENOTSUP (value unitv);
value ocaml_guestfs_get_EPERM (value unitv);
value ocaml_guestfs_get_ESRCH (value unitv);

/* Allocate handles and deal with finalization. */
Expand Down Expand Up @@ -448,6 +449,13 @@ ocaml_guestfs_get_ENOTSUP (value unitv)
return Val_int (ENOTSUP);
}

/* NB: "noalloc" function. */
value
ocaml_guestfs_get_EPERM (value unitv)
{
return Val_int (EPERM);
}

/* NB: "noalloc" function. */
value
ocaml_guestfs_get_ESRCH (value unitv)
Expand Down

0 comments on commit 6297534

Please sign in to comment.