Index: libcfa/src/concurrency/iocall.cfa
===================================================================
--- libcfa/src/concurrency/iocall.cfa	(revision 2606a033886574e16a9cb5dc08e8939c258ac86a)
+++ libcfa/src/concurrency/iocall.cfa	(revision 49981556d70010c36f072dc3534ff01415259a87)
@@ -32,8 +32,8 @@
 	#include "io/types.hfa"
 
-	extern [* struct io_uring_sqe, uint32_t] __submit_alloc( struct __io_data & ring, uint64_t data );
-	extern void __submit( struct io_context * ctx, uint32_t idx ) __attribute__((nonnull (1)));
-
-	static inline void ?{}(struct io_uring_sqe & this, uint8_t opcode, int fd) {
+	extern [* struct io_uring_sqe, __u32] __submit_alloc( struct __io_data & ring, __u64 data );
+	extern void __submit( struct io_context * ctx, __u32 idx ) __attribute__((nonnull (1)));
+
+	static inline void ?{}(struct io_uring_sqe & this, __u8 opcode, int fd) {
 		this.opcode = opcode;
 		#if !defined(IOSQE_ASYNC)
@@ -51,8 +51,8 @@
 	}
 
-	static inline void ?{}(struct io_uring_sqe & this, uint8_t opcode, int fd, void * addr, uint32_t len, uint64_t off ) {
+	static inline void ?{}(struct io_uring_sqe & this, __u8 opcode, int fd, void * addr, __u32 len, __u64 off ) {
 		(this){ opcode, fd };
 		this.off = off;
-		this.addr = (uint64_t)(uintptr_t)addr;
+		this.addr = (__u64)(uintptr_t)addr;
 		this.len = len;
 	}
@@ -105,17 +105,17 @@
 		(void)timeout; (void)cancellation; \
 		if( !context ) context = __get_io_context(); \
-		__io_user_data_t data = { 0, active_thread() }; \
+		__io_user_data_t data = { 0 }; \
 		struct __io_data & ring = *context->thrd.ring; \
 		struct io_uring_sqe * sqe; \
-		uint32_t idx; \
-		uint8_t sflags = REGULAR_FLAGS & submit_flags; \
-		[sqe, idx] = __submit_alloc( ring, (uint64_t)(uintptr_t)&data ); \
+		__u32 idx; \
+		__u8 sflags = REGULAR_FLAGS & submit_flags; \
+		[sqe, idx] = __submit_alloc( ring, (__u64)(uintptr_t)&data ); \
 		sqe->flags = sflags;
 
 	#define __submit_wait \
 		/*__cfaabi_bits_print_safe( STDERR_FILENO, "Preparing user data %p for %p\n", &data, data.thrd );*/ \
-		verify( sqe->user_data == (uint64_t)(uintptr_t)&data ); \
+		verify( sqe->user_data == (__u64)(uintptr_t)&data ); \
 		__submit( context, idx ); \
-		park( __cfaabi_dbg_ctx ); \
+		wait( data.sem ); \
 		if( data.result < 0 ) { \
 			errno = -data.result; \
@@ -149,5 +149,8 @@
 
 	extern int fsync(int fd);
-	extern int sync_file_range(int fd, int64_t offset, int64_t nbytes, unsigned int flags);
+
+	typedef __off64_t off_t;
+	typedef __off64_t off64_t;
+	extern int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags);
 
 	struct msghdr;
@@ -160,6 +163,6 @@
 	extern int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
 
-	extern int fallocate(int fd, int mode, uint64_t offset, uint64_t len);
-	extern int posix_fadvise(int fd, uint64_t offset, uint64_t len, int advice);
+	extern int fallocate(int fd, int mode, off_t offset, off_t len);
+	extern int posix_fadvise(int fd, off_t offset, off_t len, int advice);
 	extern int madvise(void *addr, size_t length, int advice);
 
@@ -190,5 +193,5 @@
 			sqe->fd = fd;
 			sqe->off = offset;
-			sqe->addr = (uint64_t)(uintptr_t)iov;
+			sqe->addr = (__u64)iov;
 			sqe->len = iovcnt;
 			sqe->rw_flags = 0;
@@ -207,5 +210,12 @@
 			__submit_prelude
 
-			(*sqe){ IORING_OP_WRITEV, fd, iov, iovcnt, offset };
+			sqe->opcode = IORING_OP_WRITEV;
+			sqe->ioprio = 0;
+			sqe->fd = fd;
+			sqe->off = offset;
+			sqe->addr = (__u64)iov;
+			sqe->len = iovcnt;
+			sqe->rw_flags = 0;
+			sqe->__pad2[0] = sqe->__pad2[1] = sqe->__pad2[2] = 0;
 
 			__submit_wait
@@ -220,11 +230,18 @@
 		__submit_prelude
 
-		(*sqe){ IORING_OP_FSYNC, fd };
-
-		__submit_wait
-	#endif
-}
-
-int cfa_sync_file_range(int fd, int64_t offset, int64_t nbytes, unsigned int flags, int submit_flags, Duration timeout, io_cancellation * cancellation, io_context * context) {
+		sqe->opcode = IORING_OP_FSYNC;
+		sqe->ioprio = 0;
+		sqe->fd = fd;
+		sqe->off = 0;
+		sqe->addr = 0;
+		sqe->len = 0;
+		sqe->rw_flags = 0;
+		sqe->__pad2[0] = sqe->__pad2[1] = sqe->__pad2[2] = 0;
+
+		__submit_wait
+	#endif
+}
+
+int cfa_sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags, int submit_flags, Duration timeout, io_cancellation * cancellation, io_context * context) {
 	#if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SYNC_FILE_RANGE)
 		return sync_file_range(fd, offset, nbytes, flags);
@@ -275,5 +292,5 @@
 
 		(*sqe){ IORING_OP_SEND, sockfd };
-		sqe->addr = (uint64_t)buf;
+		sqe->addr = (__u64)buf;
 		sqe->len = len;
 		sqe->msg_flags = flags;
@@ -290,5 +307,5 @@
 
 		(*sqe){ IORING_OP_RECV, sockfd };
-		sqe->addr = (uint64_t)buf;
+		sqe->addr = (__u64)buf;
 		sqe->len = len;
 		sqe->msg_flags = flags;
@@ -305,6 +322,6 @@
 
 		(*sqe){ IORING_OP_ACCEPT, sockfd };
-		sqe->addr = (uint64_t)(uintptr_t)addr;
-		sqe->addr2 = (uint64_t)(uintptr_t)addrlen;
+		sqe->addr  = (__u64)addr;
+		sqe->addr2 = (__u64)addrlen;
 		sqe->accept_flags = flags;
 
@@ -320,12 +337,12 @@
 
 		(*sqe){ IORING_OP_CONNECT, sockfd };
-		sqe->addr = (uint64_t)(uintptr_t)addr;
-		sqe->off  = (uint64_t)(uintptr_t)addrlen;
-
-		__submit_wait
-	#endif
-}
-
-int cfa_fallocate(int fd, int mode, uint64_t offset, uint64_t len, int submit_flags, Duration timeout, io_cancellation * cancellation, io_context * context) {
+		sqe->addr = (__u64)addr;
+		sqe->off  = (__u64)addrlen;
+
+		__submit_wait
+	#endif
+}
+
+int cfa_fallocate(int fd, int mode, off_t offset, off_t len, int submit_flags, Duration timeout, io_cancellation * cancellation, io_context * context) {
 	#if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_FALLOCATE)
 		return fallocate( fd, mode, offset, len );
@@ -344,5 +361,5 @@
 }
 
-int cfa_fadvise(int fd, uint64_t offset, uint64_t len, int advice, int submit_flags, Duration timeout, io_cancellation * cancellation, io_context * context) {
+int cfa_fadvise(int fd, off_t offset, off_t len, int advice, int submit_flags, Duration timeout, io_cancellation * cancellation, io_context * context) {
 	#if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_FADVISE)
 		return posix_fadvise( fd, offset, len, advice );
@@ -351,5 +368,5 @@
 
 		(*sqe){ IORING_OP_FADVISE, fd };
-		sqe->off = (uint64_t)offset;
+		sqe->off = (__u64)offset;
 		sqe->len = len;
 		sqe->fadvise_advice = advice;
@@ -366,5 +383,5 @@
 
 		(*sqe){ IORING_OP_MADVISE, 0 };
-		sqe->addr = (uint64_t)addr;
+		sqe->addr = (__u64)addr;
 		sqe->len = length;
 		sqe->fadvise_advice = advice;
@@ -381,5 +398,5 @@
 
 		(*sqe){ IORING_OP_OPENAT, dirfd };
-		sqe->addr = (uint64_t)pathname;
+		sqe->addr = (__u64)pathname;
 		sqe->open_flags = flags;
 		sqe->len = mode;
@@ -414,5 +431,5 @@
 		__submit_prelude
 
-		(*sqe){ IORING_OP_STATX, dirfd, pathname, mask, (uint64_t)statxbuf };
+		(*sqe){ IORING_OP_STATX, dirfd, pathname, mask, (__u64)statxbuf };
 		sqe->statx_flags = flags;
 
@@ -456,5 +473,5 @@
 		}
 		else {
-			sqe->off = (uint64_t)-1;
+			sqe->off = (__u64)-1;
 		}
 		sqe->len = len;
@@ -464,5 +481,5 @@
 		}
 		else {
-			sqe->splice_off_in = (uint64_t)-1;
+			sqe->splice_off_in = (__u64)-1;
 		}
 		sqe->splice_flags  = flags | (SPLICE_FLAGS & submit_flags);
