From patchwork Wed Oct 19 22:14:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 59094 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0FEC13851A9A for ; Wed, 19 Oct 2022 22:16:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FEC13851A9A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217777; bh=OjELyAtioKsqYmKe5p1cAuCgAkWm7yKZsOkUPkVVZc0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ywSlL/CcCBWhLB3+acFo30hPrQsFNf8ZcXXzcfCJ/0aztbc30dwIZsDqJtfOpq2vS uXP+XpodQwCQBQ4+ZcHCVVzfvwVovOzKm92yvfhjDlP70zG1sqS8FiFs+BP/72zj+0 Krn4IhfBfN+YQ01VNxaAv/eAZgFR2tIX+ao2fBJE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id EFA3E3858286 for ; Wed, 19 Oct 2022 22:14:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EFA3E3858286 Received: by mail-oi1-x232.google.com with SMTP id p127so20212480oih.9 for ; Wed, 19 Oct 2022 15:14:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OjELyAtioKsqYmKe5p1cAuCgAkWm7yKZsOkUPkVVZc0=; b=GlYWDx8xAaB9eo5RusCAPdAXmxpAPxXCHVe0ZgxvbHDybs3NqfocHnfBUlVCsCj562 BluVEvJbYX3Z/G530sPGRKMxA/QEtTp+4hSXiVo3utI/jEnhoVVM1X7IvpuunJIWFlnC hKZ4e+q0ALW0x5f+X9JVXHnZEKUM/DMRfYoY77+v6wcRFrI8iDzZ44Uc7FcEvh3i7BhW KwYtev9rKT4QPC0WnHgJTWdbDmB5ol+gU1N8UI9jVkQ2zMFzJUZNRZcWJGs+uARqSlJW BtyWEbYeLrpQD9NgHTc7tJ+VCOLHzN93wIh14MNVtaXizy+3KdzCsPnFC7mJgbf4rXgi RU7A== X-Gm-Message-State: ACrzQf2BRIeJ3e2VNSWnRN2eNpAKw7pzgyG445LGOads7i8S8Clr+gVa zkpZVm4MzjZAFr+B4tq76TNdTiRynBW0ARcu X-Google-Smtp-Source: AMsMyM5p4Edzfb+lotheZcmj2g0J1rBwrhQkIfXh4/GK/k/0NxuJWFmKZwU97OMpI7reqBdk1McXGw== X-Received: by 2002:a05:6808:1408:b0:355:2101:e28c with SMTP id w8-20020a056808140800b003552101e28cmr5689651oiv.296.1666217685881; Wed, 19 Oct 2022 15:14:45 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:45 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 06/30] Lninux: consolidate epoll_create implementation Date: Wed, 19 Oct 2022 19:14:09 -0300 Message-Id: <20221019221433.1082017-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use epoll_create syscall if defined, otherwise use epoll_create1. Reviewed-by: Florian Weimer Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/epoll_create.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/epoll_create.c (79%) 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)