Porting IO Ring to linux by implementing io_uring

This commit is contained in:
2026-04-15 21:03:54 +01:00
parent 0294498538
commit e117334dee
9 changed files with 1225 additions and 289 deletions

44
base.h
View File

@@ -1,23 +1,11 @@
#pragma once
#define _CRT_SECURE_NO_WARNINGS
#include <assert.h>
#include <immintrin.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#if defined(_WIN32) || defined(_WIN64)
// #define PLATFORM_WINDOWS 1
// #define WIN32_LEAN_AND_MEAN
// #define NTDDI_VERSION NTDDI_WIN11
//
// #pragma comment(lib, "kernel32.Lib")
#if defined(_MSC_VER)
#pragma comment(lib, "advapi32.lib")
#endif
#include <aclapi.h>
#include <fcntl.h>
@@ -29,20 +17,36 @@
#include <windows.h>
#include <winerror.h>
#if defined(_MSC_VER)
#pragma comment(lib, "advapi32.lib")
#elif defined(__linux__)
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#define strdup _strdup
#else
#include <dirent.h>
#include <fcntl.h>
#include <liburing.h>
#include <pthread.h>
#include <pwd.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <unistd.h>
#include <poll.h>
#include <sys/eventfd.h>
#endif
#include <assert.h>
#include <ctype.h>
#include <immintrin.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/* ------------------------------------------------------------
Base types
------------------------------------------------------------ */