Displaying 5 results from an estimated 5 matches for "pread_fn".
Did you mean:
read_fn
2017 Jan 27
2
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...need to save errno around caml_enter_blocking_section
since that unblocks and processes signals.
IOW:
static int
pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset)
{
CAMLparam0 ();
CAMLlocal3 (rv, strv, offsetv);
+ int saved_errno;
...
rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv);
+ saved_errno = errno;
if (Is_exception_result (rv)) {
nbdkit_error ("%s", caml_format_exception (Extract_exception (rv)));
caml_enter_blocking_section ();
+ errno = saved_errno;
CAMLreturnT (int, -1);
}
Rich.
--
Richard Jo...
2017 Jan 27
0
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...ince that unblocks and processes signals.
>
> IOW:
>
> static int
> pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset)
> {
> CAMLparam0 ();
> CAMLlocal3 (rv, strv, offsetv);
> + int saved_errno;
> ...
> rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv);
> + saved_errno = errno;
> if (Is_exception_result (rv)) {
> nbdkit_error ("%s", caml_format_exception (Extract_exception (rv)));
> caml_enter_blocking_section ();
> + errno = saved_errno;
> CAMLreturnT (int, -1)...
2019 Apr 23
0
[PATCH nbdkit v2 1/2] ocaml: Change pread method to avoid leaking heap memory.
...();
- strv = caml_alloc_string (count);
+ countv = caml_copy_int32 (count);
offsetv = caml_copy_int64 (offset);
flagsv = Val_flags (flags);
- value args[] = { *(value *) h, strv, offsetv, flagsv };
+ value args[] = { *(value *) h, countv, offsetv, flagsv };
rv = caml_callbackN_exn (pread_fn, sizeof args / sizeof args[0], args);
if (Is_exception_result (rv)) {
nbdkit_error ("%s", caml_format_exception (Extract_exception (rv)));
@@ -455,7 +456,14 @@ pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset,
CAMLreturnT (int, -1);
}
- memcpy (buf, St...
2019 Apr 23
4
[PATCH nbdkit v2 0/2] Be careful not to leak server heap memory to the client.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2019-April/msg00144.html
Version 2 makes a couple of much larger changes:
The OCaml patch changes the API of the pread method so it matches what
other language bindings are already doing, ie. get the language plugin
to return a newly allocated buffer, check it is long enough, copy out
the data.
The server patch implements a
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
This cleans up the existing code base with regards to implicit
use of errno from language bindings, then rebases the previous
work in python on top of that.
I'm still playing with the perl bindings, but got further after
reading 'perldoc perlembed'.
Eric Blake (4):
plugins: Don't use bogus errno from non-C plugins
plugins: Add new nbdkit_set_error() utility function
python: