mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Kristina Martsenko <kristina.martsenko@arm.com>
To: musl@lists.openwall.com
Subject: [musl] [PATCH] epoll: return EINVAL from epoll_create() if size is non-positive
Date: Wed, 24 Aug 2022 15:26:52 +0100	[thread overview]
Message-ID: <20220824142652.1424306-1-kristina.martsenko@arm.com> (raw)

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


             reply	other threads:[~2022-08-24 14:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 14:26 Kristina Martsenko [this message]
2022-08-24 18:47 ` Markus Wichmann
2022-08-24 23:34   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220824142652.1424306-1-kristina.martsenko@arm.com \
    --to=kristina.martsenko@arm.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).