-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoperations.h
More file actions
158 lines (151 loc) · 9.76 KB
/
operations.h
File metadata and controls
158 lines (151 loc) · 9.76 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// SPDX-License-Identifier: MIT
#ifndef IOUCONTEXT_OPERATIONS_H
#define IOUCONTEXT_OPERATIONS_H
#include <spawn.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
#ifdef __cplusplus
extern "C" {
#endif
struct epoll_event;
struct flock;
struct futex_waitv;
struct iovec;
struct siginfo_t;
struct sockaddr;
struct statx;
struct timespec;
typedef struct reactor_s reactor_t;
typedef struct _IO_FILE FILE;
int iou_accept(reactor_t *, int fd, struct sockaddr *addr, socklen_t *addrlen, int flags);
int iou_accept_direct(reactor_t *, int fd, struct sockaddr *addr, socklen_t *addrlen, int flags);
void iou_barrier(reactor_t *);
int iou_bind(reactor_t *, int sockfd, const struct sockaddr *addr, socklen_t addrlen);
void iou_cancel_fd_all(reactor_t *, int fd);
void iou_cancel_fd_any(reactor_t *, int fd);
int iou_close(reactor_t *, int fd);
void iou_close_fast(reactor_t *, int fd);
int iou_connect(reactor_t *, int sockfd, const struct sockaddr *addr, socklen_t addrlen, const struct timespec delta);
int iou_discard(reactor_t *, int fd, off_t offset, off_t len);
int iou_epoll_add(reactor_t *, int epfd, int fd, struct epoll_event *event);
int iou_epoll_ctl(reactor_t *, int epfd, int op, int fd, struct epoll_event *event);
int iou_epoll_del(reactor_t *, int epfd, int fd);
int iou_epoll_mod(reactor_t *, int epfd, int fd, struct epoll_event *event);
int iou_epoll_set(reactor_t *, int epfd, int fd, struct epoll_event *event);
int iou_epoll_wait(reactor_t *, int epfd, struct epoll_event *events, int maxevents, const struct timespec delta);
int iou_exchange(reactor_t *, const char *oldpath, const char *newpath);
int iou_exchangeat(reactor_t *, int dirfd, const char *oldpath, const char *newpath);
bool iou_exists(reactor_t *, const char *pathname);
int iou_fadvise(reactor_t *, int fd, off_t offset, off_t len, int advice);
void iou_fadvise_fast(reactor_t *, int fd, off_t offset, off_t len, int advice);
int iou_fallocate(reactor_t *, int fd, int mode, off_t offset, off_t len);
bool iou_fd_fixed(reactor_t *, int fd);
int iou_fd_getlock(reactor_t *, int fd, struct flock *);
int iou_fd_install(reactor_t *, int fd);
int iou_fd_install_no_cloexec(reactor_t *, int fd);
int iou_fd_lock_append(reactor_t *, int fd, off_t length, const struct timespec delta);
int iou_fd_lock_read(reactor_t *, int fd, off_t start, off_t length, const struct timespec delta);
int iou_fd_lock_write(reactor_t *, int fd, off_t start, off_t length, const struct timespec delta);
int iou_fd_register(reactor_t *, int fd);
int iou_fd_setlock(reactor_t *, int fd, const struct flock *, const struct timespec delta);
ssize_t iou_fd_size(reactor_t *, int fd);
int iou_fd_transmute(reactor_t *, int fd);
int iou_fd_unlock(reactor_t *, int fd, off_t start, off_t length);
int iou_fdatasync(reactor_t *, int fd);
int iou_fdatasync_range(reactor_t *, int fd, off_t start, off_t length);
FILE *iou_fdopen(reactor_t *, int fd, const char *mode);
int iou_fgetxattr(reactor_t *, int fd, const char *name, void *value, size_t size);
void iou_flush(reactor_t *);
int iou_fsetxattr(reactor_t *, int fd, const char *name, const void *value, size_t size, int flags);
int iou_fsync(reactor_t *, int fd);
int iou_fsync_range(reactor_t *, int fd, off_t start, off_t length);
int iou_ftruncate(reactor_t *, int fildes, off_t length);
int iou_futex_wait32(reactor_t *, uint32_t *futex, uint32_t value, const struct timespec delta);
int iou_futex_wait32_bitset(reactor_t *, uint32_t *futex, uint32_t value, uint32_t mask, const struct timespec delta);
int iou_futex_waitv(reactor_t *, struct futex_waitv *futexv, uint32_t nr_futex, const struct timespec delta);
int iou_futex_waitv_absolute(reactor_t *, struct futex_waitv *futexv, uint32_t nr_futex, const struct timespec when);
int iou_futex_wake32(reactor_t *, uint32_t *futex, int n);
void iou_futex_wake32_fast(reactor_t *, uint32_t *futex, int n);
int iou_futex_wake32_bitset(reactor_t *, uint32_t *futex, uint32_t mask, int n);
void iou_futex_wake32_bitset_fast(reactor_t *, uint32_t *futex, uint32_t mask, int n);
int iou_getpeername(reactor_t *, int sockfd, struct sockaddr *addr, socklen_t *addrlen);
ssize_t iou_getrandom(reactor_t *, char *buf, size_t buflen);
int iou_getsockname(reactor_t *, int sockfd, struct sockaddr *addr, socklen_t *addrlen);
int iou_getsockopt(reactor_t *, int socket, int level, int option_name, void *option_value, socklen_t *option_len);
int iou_getsockopt_int(reactor_t *, int socket, int level, int option_name);
int iou_getxattr(reactor_t *, const char *path, const char *name, void *value, size_t size);
int iou_link(reactor_t *, const char *oldpath, const char *newpath);
int iou_linkat(reactor_t *, int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags);
int iou_listen(reactor_t *, int sockfd, int backlog);
int iou_madvise(reactor_t *, void *addr, size_t len, int advice);
void iou_madvise_fast(reactor_t *, void *addr, size_t len, int advice);
int iou_mkdir(reactor_t *, const char *pathname, mode_t mode);
int iou_mkdirat(reactor_t *, int dirfd, const char *pathname, mode_t mode);
int iou_open(reactor_t *, const char *pathname, int flags, mode_t mode);
int iou_open_direct(reactor_t *, const char *pathname, int flags, mode_t mode);
int iou_openat(reactor_t *, int dirfd, const char *pathname, int flags, mode_t mode);
int iou_openat_direct(reactor_t *, int dirfd, const char *pathname, int flags, mode_t mode);
int iou_pipe(reactor_t *, int *read_fd, int *write_fd, int flags);
int iou_pipe_direct(reactor_t *, int *read_fd, int *write_fd, int flags);
unsigned iou_poll(reactor_t *, int fd, unsigned events, const struct timespec delta);
unsigned iou_poll_any(reactor_t *, int fd, const struct timespec delta);
bool iou_poll_hup(reactor_t *, int fd, const struct timespec delta);
bool iou_poll_in(reactor_t *, int fd, const struct timespec delta);
bool iou_poll_out(reactor_t *, int fd, const struct timespec delta);
ssize_t iou_pread(reactor_t *, int fildes, void *buf, size_t nbyte, off_t offset);
ssize_t iou_preadv(reactor_t *, int fildes, const struct iovec *iov, int iovcnt, off_t offset, int flags);
int iou_printf(reactor_t *, int fd, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
ssize_t iou_pwrite(reactor_t *, int fildes, const void *buf, size_t nbyte, off_t offset);
ssize_t iou_pwritev(reactor_t *, int fildes, const struct iovec *iov, int iovcnt, off_t offset, int flags);
ssize_t iou_read(reactor_t *, int fildes, void *buf, size_t nbyte);
ssize_t iou_recv(reactor_t *, int socket, void *buffer, size_t length, int flags);
ssize_t iou_recvfrom(reactor_t *, int socket, void *buffer, size_t length, int flags, struct sockaddr *address, socklen_t address_len);
int iou_rename(reactor_t *, const char *oldpath, const char *newpath);
int iou_rename_noreplace(reactor_t *, const char *oldpath, const char *newpath);
int iou_renameat(reactor_t *, int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags);
int iou_rmdir(reactor_t * reactor, const char *pathname);
int iou_rmdirat(reactor_t *, int dirfd, const char *pathname);
int iou_scanf(reactor_t *, int fd, const char *format, ...) __attribute__ ((format (scanf, 3, 4)));
ssize_t iou_send(reactor_t *, int socket, const void *buffer, size_t length, int flags);
ssize_t iou_sendto(reactor_t *, int socket, const void *message, size_t length, int flags, const struct sockaddr *dest_addr, socklen_t dest_len);
int iou_setsockopt(reactor_t *, int socket, int level, int option_name, const void *option_value, socklen_t option_len);
int iou_setsockopt_int(reactor_t *, int socket, int level, int option_name, const int option_value);
int iou_setxattr(reactor_t *, const char *path, const char *name, const void *value, size_t size, int flags);
int iou_shutdown(reactor_t *, int sockfd);
int iou_shutdown_read(reactor_t *, int sockfd);
int iou_shutdown_write(reactor_t *, int sockfd);
int iou_siocinq(reactor_t *, int socket);
int iou_siocoutq(reactor_t *, int socket);
struct timespec iou_sleep(reactor_t *, const struct timespec delta);
bool iou_sleep_absolute(reactor_t *, const struct timespec when);
int iou_socket(reactor_t *, int domain, int type, int protocol);
int iou_socket_direct(reactor_t *, int domain, int type, int protocol);
pid_t iou__spawn(reactor_t *, const posix_spawnattr_t *attrs, int to_fd, int from_fd, const char *command, ...);
#define iou_spawn(...) iou__spawn(__VA_ARGS__, NULL)
pid_t iou_spawnv(reactor_t *, const posix_spawnattr_t *attrs, int to_fd, int from_fd, const char *command, va_list args);
ssize_t iou_splice(reactor_t *, int fd_in, int fd_out, size_t len);
ssize_t iou_splice_all(reactor_t *, int fd_in, int fd_out, size_t len);
ssize_t iou_splice_offset(reactor_t *, int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, int flags);
int iou_statx(reactor_t *, const char *pathname, struct statx *statxbuf);
int iou_statxat(reactor_t *, int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf);
int iou_statxfd(reactor_t *, int fd, struct statx *statxbuf);
int iou_symlink(reactor_t *, const char *path1, const char *path2);
int iou_symlinkat(reactor_t *, const char *path1, int fd, const char *path2);
int iou_sync_file_range(reactor_t *, int fd, off_t offset, off_t nbytes, bool wait);
ssize_t iou_tee(reactor_t *, int fd_in, int fd_out, size_t len);
int iou_unlink(reactor_t *, const char *pathname);
int iou_unlinkat(reactor_t *, int dirfd, const char *pathname);
int iou_vprintf(reactor_t *, int fd, const char *format, va_list args);
int iou_vscanf(reactor_t *, int fd, const char *format, va_list args);
int iou_waitid(reactor_t *, idtype_t idtype, id_t id, siginfo_t *infop, int options);
pid_t iou_waitpid(reactor_t *, pid_t pid, int *wstatus, int options);
ssize_t iou_write(reactor_t *, int fildes, const void *buf, size_t nbyte);
bool iou_yield(reactor_t *);
#ifdef __cplusplus
}
#endif
#endif//IOUCONTEXT_OPERATIONS_H