[Libwebsockets] [PATCH] Add Linux io_uring in the list of recognized libev backends

Olivier Langlois olivier at olivierlanglois.net
Fri Feb 21 05:38:50 CET 2020


and also check libev version and only include the 2 latest backends
only if
lws is compiled against a recent enough libev version.

Linux AIO requires libev >= 4.26 and kernel v4.19+
Linux io_uring requires libev >= 4.31 and kernel v5.1+
---
 lib/event-libs/libev/libev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/event-libs/libev/libev.c b/lib/event-
libs/libev/libev.c
index 14b8a44c..1ac16931 100644
--- a/lib/event-libs/libev/libev.c
+++ b/lib/event-libs/libev/libev.c
@@ -183,9 +183,16 @@ elops_init_pt_ev(struct lws_context *context, void
*_loop, int tsi)
 	case EVBACKEND_EPOLL:
 		backend_name = "epoll";
 		break;
+#if EV_VERSION_MAJOR == 4 && EV_VERSION_MINOR >= 26
 	case EVBACKEND_LINUXAIO:
 		backend_name = "Linux AIO";
 		break;
+#endif
+#if EV_VERSION_MAJOR == 4 && EV_VERSION_MINOR >= 31
+	case EVBACKEND_IOURING:
+		backend_name = "Linux io_uring";
+	break;
+#endif
 	case EVBACKEND_KQUEUE:
 		backend_name = "kqueue";
 		break;
-- 
2.25.0



More information about the Libwebsockets mailing list