From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 68167382E44B; Wed, 7 Dec 2022 19:14:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68167382E44B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670440499; bh=DGWNrlsFG3A4NnPoW45HD7Z+ZnVDueX3kZoQq+R3f+8=; h=From:To:Subject:Date:From; b=T3lWZI7c0eDVo1cr8XCsH9CvhJcwxM72CP2Q93/4YVOv68ndsRbGOseFM1aPqlCDC frx/5eyYZX6HC7dWBrw1RpNBVn2uRKigY1atHCFWcFTKqCbVR5yR2gTRi8fiqWyNhh oLDT7acjxtihwTi/SAEs9qh0Cg9N1+zxcJWlZlcw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] Lninux: consolidate epoll_create implementation X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella Netto X-Git-Refname: refs/heads/master X-Git-Oldrev: 33ef940302eba1ecf9e98376557af75d7d9c0ed1 X-Git-Newrev: d1d23b134244d59c4d6ef2295df5ec97b81ddb0a Message-Id: <20221207191459.68167382E44B@sourceware.org> Date: Wed, 7 Dec 2022 19:14:59 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d1d23b134244d59c4d6ef2295df5ec97b81ddb0a commit d1d23b134244d59c4d6ef2295df5ec97b81ddb0a Author: Adhemerval Zanella Netto Date: Wed Oct 19 19:14:09 2022 -0300 Lninux: consolidate epoll_create implementation Use epoll_create syscall if defined, otherwise use epoll_create1. Reviewed-by: Florian Weimer Tested-by: Carlos O'Donell Diff: --- sysdeps/unix/sysv/linux/{generic => }/epoll_create.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/generic/epoll_create.c b/sysdeps/unix/sysv/linux/epoll_create.c similarity index 79% rename from sysdeps/unix/sysv/linux/generic/epoll_create.c rename to sysdeps/unix/sysv/linux/epoll_create.c index fa28694929..afb1921637 100644 --- a/sysdeps/unix/sysv/linux/generic/epoll_create.c +++ b/sysdeps/unix/sysv/linux/epoll_create.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Open an epoll file descriptor. Linux version. + Copyright (C) 2011-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,12 +24,16 @@ libc_hidden_proto (epoll_create) int epoll_create (int size) { +#ifdef __NR_epoll_create + return INLINE_SYSCALL_CALL (epoll_create); +#else if (size <= 0) { __set_errno (EINVAL); return -1; } - return INLINE_SYSCALL (epoll_create1, 1, 0); + return INLINE_SYSCALL_CALL (epoll_create1, 0); +#endif } libc_hidden_def (epoll_create)