634
ssize_t qio_channel_pread(QIOChannel *ioc, void *buf, size_t buflen,
635
off_t offset, Error **errp);
636
637
+/**
638
+ * qio_channel_preadv_all_eof:
639
+ * @ioc: the channel object
640
+ * @iov: the array of memory regions to read data into
641
+ * @niov: the length of the @iov array
642
+ * @offset: the starting offset in the channel to read from
643
+ * @errp: pointer to a NULL-initialized error object
644
+ *
645
+ * Reads @iov, possibly blocking or (if the channel is non-blocking)
646
+ * yielding from the current coroutine multiple times until the entire
647
+ * content is read. If end-of-file occurs immediately it is not an
648
+ * error, but if it occurs after data has been read it will return
649
+ * an error rather than a short-read. Otherwise behaves as
650
+ * qio_channel_preadv().
651
+ *
652
+ * Returns: 1 if all bytes were read, 0 if end-of-file occurs
653
+ * without data, or -1 on error
654
+ */
655
+int coroutine_mixed_fn qio_channel_preadv_all_eof(QIOChannel *ioc,
656
+ const struct iovec *iov,
657
+ size_t niov,
658
+ off_t offset,
659
+ Error **errp);
660
+
661
+/**
662
+ * qio_channel_preadv_all:
663
+ * @ioc: the channel object
664
+ * @iov: the array of memory regions to read data into
665
+ * @niov: the length of the @iov array
666
+ * @offset: the starting offset in the channel to read from
667
+ * @errp: pointer to a NULL-initialized error object
668
+ *
669
+ * Reads @iov, possibly blocking or (if the channel is non-blocking)
670
+ * yielding from the current coroutine multiple times until the entire
671
+ * content is read. If end-of-file occurs before all requested data
672
+ * has been read, an error will be reported. Otherwise behaves as
673
+ * qio_channel_preadv().
674
+ *
675
+ * Returns: 0 if all bytes were read, or -1 on error
676
+ */
677
+int coroutine_mixed_fn qio_channel_preadv_all(QIOChannel *ioc,
678
+ const struct iovec *iov,
679
+ size_t niov,
680
+ off_t offset,
681
+ Error **errp);
682
+
683
+/**
684
+ * qio_channel_pread_all_eof:
685
+ * @ioc: the channel object
686
+ * @buf: the memory region to read data into
687
+ * @buflen: the number of bytes to read into @buf
688
+ * @offset: the starting offset in the channel to read from
689
+ * @errp: pointer to a NULL-initialized error object
690
+ *
691
+ * Reads @buflen bytes, possibly blocking or (if the channel is
692
+ * non-blocking) yielding from the current coroutine multiple times
693
+ * until the entire content is read. If end-of-file occurs
694
+ * immediately it is not an error, but if it occurs after data has
695
+ * been read it will return an error rather than a short-read.
696
+ * Otherwise behaves as qio_channel_pread().
697
+ *
698
+ * Returns: 1 if all bytes were read, 0 if end-of-file occurs
699
+ * without data, or -1 on error
700
+ */
701
+int coroutine_mixed_fn qio_channel_pread_all_eof(QIOChannel *ioc,
702
+ void *buf,
703
+ size_t buflen,
704
+ off_t offset,
705
+ Error **errp);
706
+
707
+/**
708
+ * qio_channel_pread_all:
709
+ * @ioc: the channel object
710
+ * @buf: the memory region to read data into
711
+ * @buflen: the number of bytes to read into @buf
712
+ * @offset: the starting offset in the channel to read from
713
+ * @errp: pointer to a NULL-initialized error object
714
+ *
715
+ * Reads @buflen bytes, possibly blocking or (if the channel is
716
+ * non-blocking) yielding from the current coroutine multiple times
717
+ * until the entire content is read. If end-of-file occurs before
718
+ * all requested data has been read, an error will be reported.
719
+ * Otherwise behaves as qio_channel_pread().
720
+ *
721
+ * Returns: 0 if all bytes were read, or -1 on error
722
+ */
723
+int coroutine_mixed_fn qio_channel_pread_all(QIOChannel *ioc,
724
+ void *buf,
725
+ size_t buflen,
726
+ off_t offset,
727
+ Error **errp);
728
+
729
/**
730
* qio_channel_shutdown:
731
* @ioc: the channel object