mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] epoll: return EINVAL from epoll_create() if size is non-positive
@ 2022-08-24 14:26 Kristina Martsenko
  2022-08-24 18:47 ` Markus Wichmann
  0 siblings, 1 reply; 3+ messages in thread
From: Kristina Martsenko @ 2022-08-24 14:26 UTC (permalink / raw)
  To: musl

The man page for epoll_create() states that the 'size' argument must be
positive, otherwise EINVAL is returned. musl currently ignores the
argument and does not return EINVAL. Change it to match the man page.

Worth noting that this is needed for an LTP (Linux Test Project) test to
pass (epoll_create02).
---
 src/linux/epoll.c | 1 +
 1 file changed, 1 insertion(+)

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);
 }
 

base-commit: 37e18b7bf307fa4a8c745feebfcba54a0ba74f30
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-24 23:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 14:26 [musl] [PATCH] epoll: return EINVAL from epoll_create() if size is non-positive Kristina Martsenko
2022-08-24 18:47 ` Markus Wichmann
2022-08-24 23:34   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).