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
24#ifndef IOLIST_H
25#define IOLIST_H
26
27#include <unistd.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
34typedef struct iolist iolist_t;
35
39struct iolist {
41 void *iol_base;
42 size_t iol_len;
43};
44
52unsigned iolist_count(const iolist_t *iolist);
53
65
67struct iovec;
68
83size_t iolist_to_iovec(const iolist_t *iolist, struct iovec *iov, unsigned *count);
84
95ssize_t iolist_to_buffer(const iolist_t *iolist, void *dst, size_t len);
96
97#ifdef __cplusplus
98}
99#endif
100#endif /* IOLIST_H */
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.
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:39
void * iol_base
ptr to this list entries data
Definition iolist.h:41
size_t iol_len
size of data pointet to by ptr
Definition iolist.h:42
iolist_t * iol_next
ptr to next list entry
Definition iolist.h:40
Structure for scatter/gather I/O.
Definition uio.h:33