plugins/streaming/streaming.c
/* Read data back from the stream. */
Read data back from the stream.
Read data back from the stream .
static int
streaming_pread (void *handle, void *buf, uint32_t count, uint64_t offset)
{
  if (errorstate) {
    nbdkit_error ("unrecoverable error state");
    errno = EIO;
    return -1;
  }
  if (offset >= highestwrite) {
    memset (buf, 0, count);
    return 0;
  }
  nbdkit_error ("client tried to read: "
                "the streaming plugin does not currently support this");
  errorstate = 1;
  errno = EIO;
  return -1;
}
static int streaming_pread ( void * handle , void * buf , uint32_t count , uint64_t offset ) { if ( errorstate ) { nbdkit_error ( " " ) ; errno = EIO ; return -1 ; } if ( offset >= highestwrite ) { memset ( buf , 0 , count ) ; return 0 ; } nbdkit_error ( " " " " ) ; errorstate = 1 ; errno = EIO ; return -1 ; }
Read data back from the stream.
Read data back from the stream .
/* Allow reads which are entirely >= highestwrite.  These return zeroes. */