path: root/src
diff options
authorStefan Hajnoczi <>2019-07-24 09:24:50 +0100
committerJens Axboe <>2019-07-24 09:11:44 -0600
commitc31c7ec4bcd7bb0d7b28897d730431c02b9d4ea1 (patch)
treebaffe189e6dc69fa17adc8fe08ad1d133b328ade /src
parentb42c59d7afc79370cf0140d5b9978b1e8c350408 (diff)
src/Makefile: keep private headers in <liburing/*.h>
It is not possible to install barrier.h and compat.h into the top-level /usr/include directly since they are likely to conflict with other software. io_uring.h could be confused with the system's kernel header file. Put liburing headers into <liburing/*.h> so there is no chance of conflicts or confusion. Existing applications continue to build successfully since the location of <liburing.h> is unchanged. In-tree examples and tests require modification because src/liburing.h is moved to src/include/liburing.h. Signed-off-by: Stefan Hajnoczi <> Signed-off-by: Jens Axboe <>
Diffstat (limited to 'src')
-rw-r--r--src/include/liburing.h (renamed from src/liburing.h)6
-rw-r--r--src/include/liburing/barrier.h (renamed from src/barrier.h)0
-rw-r--r--src/include/liburing/compat.h (renamed from src/compat.h)0
-rw-r--r--src/include/liburing/io_uring.h (renamed from src/io_uring.h)0
9 files changed, 19 insertions, 19 deletions
diff --git a/src/Makefile b/src/Makefile
index aa93199..cbd3fda 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,7 +3,7 @@ includedir ?= $(prefix)/include
libdir ?= $(prefix)/lib
CFLAGS ?= -g -fomit-frame-pointer -O2
-override CFLAGS += -Wall -I.
+override CFLAGS += -Wall -Iinclude/
@@ -27,7 +27,7 @@ liburing_srcs := setup.c queue.c syscall.c register.c
liburing_objs := $(patsubst %.c,%.ol,$(liburing_srcs))
liburing_sobjs := $(patsubst %.c,%.os,$(liburing_srcs))
-$(liburing_objs) $(liburing_sobjs): io_uring.h
+$(liburing_objs) $(liburing_sobjs): include/liburing/io_uring.h
%.os: %.c
$(CC) $(SO_CFLAGS) -c -o $@ $<
@@ -46,10 +46,10 @@ $(libname): $(liburing_sobjs)
$(CC) $(SO_CFLAGS) -Wl, -Wl,-soname=$(soname) -o $@ $(liburing_sobjs) $(LINK_FLAGS)
install: $(all_targets)
- install -D -m 644 io_uring.h $(includedir)/io_uring.h
- install -D -m 644 liburing.h $(includedir)/liburing.h
- install -D -m 644 compat.h $(includedir)/compat.h
- install -D -m 644 barrier.h $(includedir)/barrier.h
+ install -D -m 644 include/liburing/io_uring.h $(includedir)/liburing/io_uring.h
+ install -D -m 644 include/liburing.h $(includedir)/liburing.h
+ install -D -m 644 include/liburing/compat.h $(includedir)/liburing/compat.h
+ install -D -m 644 include/liburing/barrier.h $(includedir)/liburing/barrier.h
install -D -m 644 liburing.a $(libdir)/liburing.a
ifeq ($(ENABLE_SHARED),1)
install -D -m 755 $(libname) $(libdir)/$(libname)
@@ -57,7 +57,7 @@ ifeq ($(ENABLE_SHARED),1)
ln -sf $(libname) $(libdir)/
-$(liburing_objs): liburing.h
+$(liburing_objs): include/liburing.h
rm -f $(all_targets) $(liburing_objs) $(liburing_sobjs) $(soname).new
diff --git a/src/liburing.h b/src/include/liburing.h
index a350a01..fb78cd3 100644
--- a/src/liburing.h
+++ b/src/include/liburing.h
@@ -9,9 +9,9 @@ extern "C" {
#include <signal.h>
#include <string.h>
#include <inttypes.h>
-#include "compat.h"
-#include "io_uring.h"
-#include "barrier.h"
+#include "liburing/compat.h"
+#include "liburing/io_uring.h"
+#include "liburing/barrier.h"
* Library interface to io_uring
diff --git a/src/barrier.h b/src/include/liburing/barrier.h
index 98be9e5..98be9e5 100644
--- a/src/barrier.h
+++ b/src/include/liburing/barrier.h
diff --git a/src/compat.h b/src/include/liburing/compat.h
index d322499..d322499 100644
--- a/src/compat.h
+++ b/src/include/liburing/compat.h
diff --git a/src/io_uring.h b/src/include/liburing/io_uring.h
index a61c4a6..a61c4a6 100644
--- a/src/io_uring.h
+++ b/src/include/liburing/io_uring.h
diff --git a/src/queue.c b/src/queue.c
index 72b2293..74a077f 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -6,10 +6,10 @@
#include <string.h>
#include <stdbool.h>
-#include "compat.h"
-#include "io_uring.h"
+#include "liburing/compat.h"
+#include "liburing/io_uring.h"
#include "liburing.h"
-#include "barrier.h"
+#include "liburing/barrier.h"
static int __io_uring_get_cqe(struct io_uring *ring,
struct io_uring_cqe **cqe_ptr, int wait)
diff --git a/src/register.c b/src/register.c
index 7561575..f5fc196 100644
--- a/src/register.c
+++ b/src/register.c
@@ -5,8 +5,8 @@
#include <errno.h>
#include <string.h>
-#include "compat.h"
-#include "io_uring.h"
+#include "liburing/compat.h"
+#include "liburing/io_uring.h"
#include "liburing.h"
int io_uring_register_buffers(struct io_uring *ring, const struct iovec *iovecs,
diff --git a/src/setup.c b/src/setup.c
index 343a317..47b0deb 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -5,8 +5,8 @@
#include <errno.h>
#include <string.h>
-#include "compat.h"
-#include "io_uring.h"
+#include "liburing/compat.h"
+#include "liburing/io_uring.h"
#include "liburing.h"
static int io_uring_mmap(int fd, struct io_uring_params *p,
diff --git a/src/syscall.c b/src/syscall.c
index d0c58cf..3fd8713 100644
--- a/src/syscall.c
+++ b/src/syscall.c
@@ -5,8 +5,8 @@
#include <sys/syscall.h>
#include <sys/uio.h>
#include <signal.h>
-#include "compat.h"
-#include "io_uring.h"
+#include "liburing/compat.h"
+#include "liburing/io_uring.h"
#ifdef __alpha__