Explorar o código

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).
Kristina Martsenko %!s(int64=2) %!d(string=hai) anos
pai
achega
d4f987e4ac
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/linux/epoll.c

+ 1 - 0
src/linux/epoll.c

@@ -5,6 +5,7 @@
 
 int epoll_create(int size)
 {
+	if (size<=0) return __syscall_ret(-EINVAL);
 	return epoll_create1(0);
 }