Loading...
Searching...
No Matches
iolist.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Kaspar Schleiser <kaspar@schleiser.de>
3 * 2018 Inria
4 * 2018 Freie Universität Berlin
5 *
6 * This file is subject to the terms and conditions of the GNU Lesser
7 * General Public License v2.1. See the file LICENSE in the top level
8 * directory for more details.
9 */
10
11#pragma once
12
25
26#include <unistd.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
33typedef struct iolist iolist_t;
34
38struct iolist {
40 void *iol_base;
41 size_t iol_len;
42};
43
51unsigned iolist_count(const iolist_t *iolist);
52
64
66struct iovec;
67
82size_t iolist_to_iovec(const iolist_t *iolist, struct iovec *iov, unsigned *count);
83
94ssize_t iolist_to_buffer(const iolist_t *iolist, void *dst, size_t len);
95
96#ifdef __cplusplus
97}
98#endif
unsigned iolist_count(const iolist_t *iolist)
Count number of entries in an iolist_t.
size_t iolist_size(const iolist_t *iolist)
Sum up number of bytes in iolist.
size_t iolist_to_iovec(const iolist_t *iolist, struct iovec *iov, unsigned *count)
Create struct iovec from iolist.
struct iolist iolist_t
iolist forward declaration
Definition iolist.h:33
ssize_t iolist_to_buffer(const iolist_t *iolist, void *dst, size_t len)
Copies the bytes of the iolist to a buffer.
iolist structure definition
Definition iolist.h:38
void * iol_base
ptr to this list entries data
Definition iolist.h:40
size_t iol_len
size of data pointet to by ptr
Definition iolist.h:41
iolist_t * iol_next
ptr to next list entry
Definition iolist.h:39
Structure for scatter/gather I/O.
Definition uio.h:33