source: libcfa/src/concurrency/iofwd.hfa @ 12c1eef

ADTast-experimentalenumpthread-emulationqualifiedEnum
Last change on this file since 12c1eef was ff1240f, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Added missing forward declaretion

  • Property mode set to 100644
File size: 6.7 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2020 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// iofwd.hfa --
8//
9// Author           : Thierry Delisle
10// Created On       : Thu Apr 23 17:31:00 2020
11// Last Modified By :
12// Last Modified On :
13// Update Count     :
14//
15
16#pragma once
17
18#include <unistd.h>
19extern "C" {
20        #include <asm/types.h>
21        #if CFA_HAVE_LINUX_IO_URING_H
22                #include <linux/io_uring.h>
23        #endif
24}
25#include "bits/defs.hfa"
26#include "time.hfa"
27
28#if defined(CFA_HAVE_IOSQE_FIXED_FILE)
29        #define CFA_IO_FIXED_FD1 IOSQE_FIXED_FILE
30#endif
31#if defined(CFA_HAVE_SPLICE_F_FD_IN_FIXED)
32        #define CFA_IO_FIXED_FD2 SPLICE_F_FD_IN_FIXED
33#endif
34#if defined(CFA_HAVE_IOSQE_IO_DRAIN)
35        #define CFA_IO_DRAIN IOSQE_IO_DRAIN
36#endif
37#if defined(CFA_HAVE_IOSQE_ASYNC)
38        #define CFA_IO_ASYNC IOSQE_ASYNC
39#endif
40
41#if __OFF_T_MATCHES_OFF64_T
42        typedef __off64_t off_t;
43#else
44        typedef __off_t off_t;
45#endif
46typedef __off64_t off64_t;
47
48struct cluster;
49struct io_future_t;
50struct $io_context;
51
52struct iovec;
53struct msghdr;
54struct sockaddr;
55struct statx;
56struct epoll_event;
57
58struct io_uring_sqe;
59
60//----------
61// underlying calls
62extern struct $io_context * cfa_io_allocate(struct io_uring_sqe * out_sqes[], __u32 out_idxs[], __u32 want)  __attribute__((nonnull (1,2)));
63extern void cfa_io_submit( struct $io_context * in_ctx, __u32 in_idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1,2)));
64
65//----------
66// synchronous calls
67#if defined(CFA_HAVE_PREADV2)
68        extern ssize_t cfa_preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags, __u64 submit_flags);
69#endif
70#if defined(CFA_HAVE_PWRITEV2)
71        extern ssize_t cfa_pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags, __u64 submit_flags);
72#endif
73extern int cfa_fsync(int fd, __u64 submit_flags);
74extern int cfa_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event, __u64 submit_flags);
75extern int cfa_sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags, __u64 submit_flags);
76extern  ssize_t cfa_sendmsg(int sockfd, const struct msghdr *msg, int flags, __u64 submit_flags);
77extern ssize_t cfa_recvmsg(int sockfd, struct msghdr *msg, int flags, __u64 submit_flags);
78extern ssize_t cfa_send(int sockfd, const void *buf, size_t len, int flags, __u64 submit_flags);
79extern ssize_t cfa_recv(int sockfd, void *buf, size_t len, int flags, __u64 submit_flags);
80extern int cfa_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags, __u64 submit_flags);
81extern int cfa_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen, __u64 submit_flags);
82extern int cfa_fallocate(int fd, int mode, off_t offset, off_t len, __u64 submit_flags);
83extern int cfa_posix_fadvise(int fd, off_t offset, off_t len, int advice, __u64 submit_flags);
84extern int cfa_madvise(void *addr, size_t length, int advice, __u64 submit_flags);
85extern int cfa_openat(int dirfd, const char *pathname, int flags, mode_t mode, __u64 submit_flags);
86#if defined(CFA_HAVE_OPENAT2)
87        extern int cfa_openat2(int dirfd, const char *pathname, struct open_how * how, size_t size, __u64 submit_flags);
88#endif
89extern int cfa_close(int fd, __u64 submit_flags);
90#if defined(CFA_HAVE_STATX)
91        extern int cfa_statx(int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf, __u64 submit_flags);
92#endif
93extern ssize_t cfa_read(int fd, void * buf, size_t count, __u64 submit_flags);
94extern ssize_t cfa_write(int fd, void * buf, size_t count, __u64 submit_flags);
95extern ssize_t cfa_splice(int fd_in, __off64_t *off_in, int fd_out, __off64_t *off_out, size_t len, unsigned int flags, __u64 submit_flags);
96extern ssize_t cfa_tee(int fd_in, int fd_out, size_t len, unsigned int flags, __u64 submit_flags);
97
98//----------
99// asynchronous calls
100#if defined(CFA_HAVE_PREADV2)
101        extern void async_preadv2(io_future_t & future, int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags, __u64 submit_flags);
102#endif
103#if defined(CFA_HAVE_PWRITEV2)
104        extern void async_pwritev2(io_future_t & future, int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags, __u64 submit_flags);
105#endif
106extern void async_fsync(io_future_t & future, int fd, __u64 submit_flags);
107extern void async_epoll_ctl(io_future_t & future, int epfd, int op, int fd, struct epoll_event *event, __u64 submit_flags);
108extern void async_sync_file_range(io_future_t & future, int fd, off64_t offset, off64_t nbytes, unsigned int flags, __u64 submit_flags);
109extern void async_sendmsg(io_future_t & future, int sockfd, const struct msghdr *msg, int flags, __u64 submit_flags);
110extern void async_recvmsg(io_future_t & future, int sockfd, struct msghdr *msg, int flags, __u64 submit_flags);
111extern void async_send(io_future_t & future, int sockfd, const void *buf, size_t len, int flags, __u64 submit_flags);
112extern void async_recv(io_future_t & future, int sockfd, void *buf, size_t len, int flags, __u64 submit_flags);
113extern void async_accept4(io_future_t & future, int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags, __u64 submit_flags);
114extern void async_connect(io_future_t & future, int sockfd, const struct sockaddr *addr, socklen_t addrlen, __u64 submit_flags);
115extern void async_fallocate(io_future_t & future, int fd, int mode, off_t offset, off_t len, __u64 submit_flags);
116extern void async_posix_fadvise(io_future_t & future, int fd, off_t offset, off_t len, int advice, __u64 submit_flags);
117extern void async_madvise(io_future_t & future, void *addr, size_t length, int advice, __u64 submit_flags);
118extern void async_openat(io_future_t & future, int dirfd, const char *pathname, int flags, mode_t mode, __u64 submit_flags);
119#if defined(CFA_HAVE_OPENAT2)
120        extern void async_openat2(io_future_t & future, int dirfd, const char *pathname, struct open_how * how, size_t size, __u64 submit_flags);
121#endif
122extern void async_close(io_future_t & future, int fd, __u64 submit_flags);
123#if defined(CFA_HAVE_STATX)
124        extern void async_statx(io_future_t & future, int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf, __u64 submit_flags);
125#endif
126void async_read(io_future_t & future, int fd, void * buf, size_t count, __u64 submit_flags);
127extern void async_write(io_future_t & future, int fd, void * buf, size_t count, __u64 submit_flags);
128extern void async_splice(io_future_t & future, int fd_in, __off64_t *off_in, int fd_out, __off64_t *off_out, size_t len, unsigned int flags, __u64 submit_flags);
129extern void async_tee(io_future_t & future, int fd_in, int fd_out, size_t len, unsigned int flags, __u64 submit_flags);
130
131
132//-----------------------------------------------------------------------------
133// Check if a function is blocks a only the user thread
134bool has_user_level_blocking( fptr_t func );
Note: See TracBrowser for help on using the repository browser.