Displaying 4 results from an estimated 4 matches for "do_pread".
2009 Nov 25
1
[PATCH] daemon/Win32: Replace pread on platforms that don't have this function.
...7 @@ AC_CHECK_FUNCS([\
lremovexattr \
mknod \
posix_fallocate \
+ pread \
removexattr \
setxattr \
sync])
diff --git a/daemon/file.c b/daemon/file.c
index 252c02c..e6bbc19 100644
--- a/daemon/file.c
+++ b/daemon/file.c
@@ -402,6 +402,7 @@ do_pread (const char *path, int count, int64_t offset, size_t *size_r)
return NULL;
}
+#ifdef HAVE_PREAD
r = pread (fd, buf, count, offset);
if (r == -1) {
reply_with_perror ("pread: %s", path);
@@ -409,6 +410,25 @@ do_pread (const char *path, int count, int64_t offset, size_t...
2018 Jul 31
0
[PATCH nbdkit 3/4] Add map filter.
...*h = handle;
+ int64_t r;
+
+ r = map_size (&h->map);
+ nbdkit_debug ("map: filter size: %" PRIi64, r);
+ return r;
+}
+
+/* Read data. */
+struct pread_data {
+ struct nbdkit_next_ops *next_ops;
+ void *nxdata;
+ void *buf;
+ uint32_t flags;
+ int *err;
+};
+
+static int
+do_pread (void *vp, uint32_t count, uint64_t offs)
+{
+ struct pread_data *data = vp;
+
+ if (data->next_ops->pread (data->nxdata, data->buf,
+ count, offs, data->flags, data->err) == -1)
+ return -1;
+ data->buf += count;
+ return 0;
+}
+
+static int...
2010 Aug 26
1
[PATCH] New APIs: hopen-device hopen-file hread hwrite hseek hclose hclose-all
These APIs provide handle-based read/write streaming and random access to files
and block devices.
---
daemon/.gitignore | 1 +
daemon/Makefile.am | 1 +
daemon/hfile.c | 196 +++++++++++++++++++++++++++++++++++++++++++++
daemon/m4/gnulib-cache.m4 | 3 +-
po/POTFILES.in | 2 +
regressions/Makefile.am | 1 +
regressions/test-hfile.pl | 102
2018 Jul 31
7
[PATCH nbdkit 0/4] Add truncate and map filters.
This patch series proposes two new filters.
* truncate: This can truncate, extend, round up or round down the size
of a plugin/device. A typical usage is to fix the qemu problem that
it can only handle devices which are a multiple of 512-bytes:
nbdkit --filter=truncate random size=500 round-up=512
This will serve a virtual device with size 512 bytes. Reading from
the last 12 bytes will