File: read-write.h

package info (click to toggle)
kvmtool 0.20161128-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,748 kB
  • ctags: 6,310
  • sloc: ansic: 25,215; makefile: 495; asm: 212; sh: 122
file content (45 lines) | stat: -rw-r--r-- 1,641 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef KVM_READ_WRITE_H
#define KVM_READ_WRITE_H

#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>

#ifdef CONFIG_HAS_AIO
#include <libaio.h>
#endif

ssize_t xread(int fd, void *buf, size_t count);
ssize_t xwrite(int fd, const void *buf, size_t count);

ssize_t read_file(int fd, char *buf, size_t max_size);

ssize_t read_in_full(int fd, void *buf, size_t count);
ssize_t write_in_full(int fd, const void *buf, size_t count);

ssize_t xpread(int fd, void *buf, size_t count, off_t offset);
ssize_t xpwrite(int fd, const void *buf, size_t count, off_t offset);

ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset);
ssize_t pwrite_in_full(int fd, const void *buf, size_t count, off_t offset);

ssize_t xreadv(int fd, const struct iovec *iov, int iovcnt);
ssize_t xwritev(int fd, const struct iovec *iov, int iovcnt);

ssize_t readv_in_full(int fd, const struct iovec *iov, int iovcnt);
ssize_t writev_in_full(int fd, const struct iovec *iov, int iovcnt);

ssize_t xpreadv(int fd, const struct iovec *iov, int iovcnt, off_t offset);
ssize_t xpwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset);

ssize_t preadv_in_full(int fd, const struct iovec *iov, int iovcnt, off_t offset);
ssize_t pwritev_in_full(int fd, const struct iovec *iov, int iovcnt, off_t offset);

#ifdef CONFIG_HAS_AIO
int aio_preadv(io_context_t ctx, struct iocb *iocb, int fd, const struct iovec *iov, int iovcnt,
		off_t offset, int ev, void *param);
int aio_pwritev(io_context_t ctx, struct iocb *iocb, int fd, const struct iovec *iov, int iovcnt,
		off_t offset, int ev, void *param);
#endif

#endif /* KVM_READ_WRITE_H */