#include <cstring>
#include <memory>
#include <limits>
+#include <sys/uio.h>
#include <type_traits>
#include <boost/iterator/iterator_facade.hpp>
#include "folly/FBString.h"
#include "folly/Range.h"
+#include "folly/FBVector.h"
namespace folly {
*/
std::unique_ptr<IOBuf> cloneOne() const;
+ /**
+ * Return an iovector suitable for e.g. writev()
+ *
+ * auto iov = buf->getIov();
+ * auto xfer = writev(fd, iov.data(), iov.size());
+ *
+ * Naturally, the returned iovector is invalid if you modify the buffer
+ * chain.
+ */
+ folly::fbvector<struct iovec> getIov() const;
+
// Overridden operator new and delete.
// These directly use malloc() and free() to allocate the space for IOBuf
// objects. This is needed since IOBuf::create() manually uses malloc when