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
30 extern "C" {
31 #endif
32 
34 typedef struct iolist iolist_t;
35 
39 struct iolist {
41  void *iol_base;
42  size_t iol_len;
43 };
44 
52 unsigned iolist_count(const iolist_t *iolist);
53 
64 size_t iolist_size(const iolist_t *iolist);
65 
67 struct iovec;
68 
83 size_t iolist_to_iovec(const iolist_t *iolist, struct iovec *iov, unsigned *count);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 #endif /* IOLIST_H */
89 
iolist::iol_len
size_t iol_len
size of data pointet to by ptr
Definition: iolist.h:42
iolist_count
unsigned iolist_count(const iolist_t *iolist)
Count number of entries in an iolist_t.
iolist::iol_base
void * iol_base
ptr to this list entries data
Definition: iolist.h:41
iolist
iolist structure definition
Definition: iolist.h:39
iolist_size
size_t iolist_size(const iolist_t *iolist)
Sum up number of bytes in iolist.
iovec
Structure for scatter/gather I/O.
Definition: uio.h:33
iolist_to_iovec
size_t iolist_to_iovec(const iolist_t *iolist, struct iovec *iov, unsigned *count)
Create struct iovec from iolist.
iolist::iol_next
iolist_t * iol_next
ptr to next list entry
Definition: iolist.h:40