// SPDX-License-Identifier: GPL-2.0-or-later /* * iov.c - helpers for using (partial) iovecs. * * Copyrigh (c) 2024 Red Hat * Author: Laurent Vivier * * This file also contains code originally from QEMU include/qemu/iov.h * and licensed under the following terms: * * Copyright (C) 2010 Red Hat, Inc. * * Author(s): * Amit Shah * Michael Tokarev * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. * * Contributions after 2012-01-13 are licensed under the terms of the * GNU GPL, version 2 or (at your option) any later version. */ #ifndef IOVEC_H #define IOVEC_H #include #include size_t iov_fill_from_buf(const struct iovec *iov, unsigned int iov_cnt, size_t offset, const void *buf, size_t bytes); size_t iov_fill_to_buf(const struct iovec *iov, const unsigned int iov_cnt, size_t offset, void *buf, size_t bytes); size_t iov_from_buf(const struct iovec *iov, unsigned int iov_cnt, size_t offset, const void *buf, size_t bytes); size_t iov_to_buf(const struct iovec *iov, unsigned int iov_cnt, size_t offset, void *buf, size_t bytes); size_t iov_size(const struct iovec *iov, const unsigned int iov_cnt); unsigned iov_copy(struct iovec *dst_iov, unsigned int dst_iov_cnt, const struct iovec *iov, unsigned int iov_cnt, size_t offset, size_t bytes); #endif /* IOVEC_H */