Skip to content

Instantly share code, notes, and snippets.

@shuveb
shuveb / io_uring_cp_stdio.c
Last active September 15, 2020 02:14
Simple io_uring example that copies standard input to standard output. Do NOT run this under a kernel < 5.8. It will crash your system due to an io_uring bug.
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <sys/uio.h>
#include <linux/fs.h>
#include <fcntl.h>
#include <unistd.h>