From d4f987e4ac44e4e5ca2bcf68365b4c2b77bdf2d0 Mon Sep 17 00:00:00 2001 From: Kristina Martsenko Date: Wed, 24 Aug 2022 15:26:52 +0100 Subject: epoll_create: fail with EINVAL if size is non-positive This is a part of the interface contract defined in the Linux man page (official for a Linux-specific interface) and asserted by test cases in the Linux Test Project (LTP). --- src/linux/epoll.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/linux/epoll.c') diff --git a/src/linux/epoll.c b/src/linux/epoll.c index 93baa814..e56e8f4c 100644 --- a/src/linux/epoll.c +++ b/src/linux/epoll.c @@ -5,6 +5,7 @@ int epoll_create(int size) { + if (size<=0) return __syscall_ret(-EINVAL); return epoll_create1(0); } -- cgit 1.4.1