From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31755 invoked from network); 24 Aug 2022 14:27:21 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 24 Aug 2022 14:27:21 -0000 Received: (qmail 5796 invoked by uid 550); 24 Aug 2022 14:27:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 5755 invoked from network); 24 Aug 2022 14:27:16 -0000 From: Kristina Martsenko To: musl@lists.openwall.com Date: Wed, 24 Aug 2022 15:26:52 +0100 Message-Id: <20220824142652.1424306-1-kristina.martsenko@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH] epoll: return EINVAL from epoll_create() if size is non-positive 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