1
2
3
4
5
6
7
8
9#ifndef __LINUX_UIO_H
10#define __LINUX_UIO_H
11
12#include <uapi/linux/uio.h>
13
14
15struct kvec {
16 void *iov_base;
17 size_t iov_len;
18};
19
20
21
22
23
24
25
26
27static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
28{
29 unsigned long seg;
30 size_t ret = 0;
31
32 for (seg = 0; seg < nr_segs; seg++)
33 ret += iov[seg].iov_len;
34 return ret;
35}
36
37unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
38
39int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
40int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len);
41#endif
42