search for: fcd839b

Displaying 3 results from an estimated 3 matches for "fcd839b".

2018 Dec 14
0
[PATCH nbdkit 1/3] sh: Implement inline scripts.
...' + case "$1" in + get_size) echo 1M ;; + pread) dd if=/dev/zero count=$3 iflag=count_bytes ;; + *) exit 2 ;; + esac + EOF + =head1 WRITING AN NBDKIT SH PLUGIN For an example plugin written in Bash, see: diff --git a/plugins/sh/sh.c b/plugins/sh/sh.c index 368f1eb..fcd839b 100644 --- a/plugins/sh/sh.c +++ b/plugins/sh/sh.c @@ -39,6 +39,7 @@ #include <string.h> #include <unistd.h> #include <errno.h> +#include <sys/stat.h> #include <nbdkit-plugin.h> @@ -115,6 +116,50 @@ sh_dump_plugin (void) } } +/* This implements the "...
2018 Dec 14
0
[PATCH nbdkit 2/3] sh: Switch nbdkit-sh-plugin to use API version 2.
...t;>. In future +a comma-separated list of flags may be present. + +Unlike in other languages, if you provide a C<zero> method you B<must> +also provide a C<can_zero> method which exits with code C<0> (true). =back diff --git a/plugins/sh/sh.c b/plugins/sh/sh.c index fcd839b..58693fb 100644 --- a/plugins/sh/sh.c +++ b/plugins/sh/sh.c @@ -41,6 +41,8 @@ #include <errno.h> #include <sys/stat.h> +#define NBDKIT_API_VERSION 2 + #include <nbdkit-plugin.h> #include "call.h" @@ -360,7 +362,8 @@ sh_get_size (void *handle) } static int -sh...
2018 Dec 14
6
[PATCH nbdkit 0/3] tests: Test export flags (eflags).
Some feature additions to the shell script plugin allow us to test the export flags field reasonably easily. Rich.