summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristina Martsenko <kristina.martsenko@arm.com>2022-08-24 15:26:52 +0100
committerRich Felker <dalias@aerifal.cx>2022-08-24 20:35:47 -0400
commitd4f987e4ac44e4e5ca2bcf68365b4c2b77bdf2d0 (patch)
tree88efc0c35d9c99f514c0bb2a44c34509f5aefdaa
parent2e5fff43dd7fc808197744c67cca7908ac19bb4f (diff)
downloadmusl-d4f987e4ac44e4e5ca2bcf68365b4c2b77bdf2d0.tar.gz
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).
-rw-r--r--src/linux/epoll.c1
1 files changed, 1 insertions, 0 deletions
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);
}