summaryrefslogtreecommitdiff
path: root/libhw_generic/include/libhw/generic/io.h
blob: 681c5effd766a0025b80db6c48ff989c9690e904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* libhw/generic/io.h - Device-independent I/O definitions
 *
 * Copyright (C) 2024-2025  Luke T. Shumaker <lukeshu@lukeshu.com>
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

#ifndef _LIBHW_GENERIC_IO_H_
#define _LIBHW_GENERIC_IO_H_

#include <stddef.h>    /* for size_t */

/* structs ********************************************************************/

#if __unix__
#include <sys/uio.h>
#else
struct iovec {
	void    *iov_base;
	size_t   iov_len;
};
#endif

struct duplex_iovec {
	void    *iov_read_dst;
	void    *iov_write_src;
	size_t   iov_len;
};

#endif /* _LIBHW_GENERIC_IO_H_ */