This repository contains a C program that demonstrates the usage of io_uring
for asynchronous I/O operations on Linux, specifically designed to run on Ubuntu 22.04.
Before building and running this project, you need to install liburing
and PkgConfig
on Ubuntu 22.04 to handle the asynchronous I/O capabilities and manage library paths.
PkgConfig
is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line so an application can use gcc -o test test.c $(pkg-config --libs --cflags glib-2.0)
for instance.
To install PkgConfig
, open a terminal and run:
sudo apt update
sudo apt install pkg-config
liburing
provides an easier and more straightforward way to use Linux kernel's io_uring
interface.
To install liburing
, execute:
sudo apt update
sudo apt install liburing-dev
Once the prerequisites are installed, you can build the program using CMake
. Here's how to set it up:
-
Clone the Repository
First, clone this repository to your local machine:
git clone [email protected]:TSWorld1314/IO_Uring-Example.git cd IO_Uring-Example
-
Create a Build Directory
Create a separate build directory for CMake:
mkdir build cd build
-
Configure the Project
Configure the project using CMake. Specify a debug build to include debug symbols:
cmake .. -DCMAKE_BUILD_TYPE=Debug
-
Compile the Project
Compile the project using the generated Makefile:
cmake --build .
-
Run the Program
After building the project, you can run the program directly:
./io_uring_example ../hello.txt