From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x935.google.com (mail-ua1-x935.google.com [IPv6:2607:f8b0:4864:20::935]) by sourceware.org (Postfix) with ESMTPS id 36531385802E for ; Wed, 10 Aug 2022 17:24:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 36531385802E Received: by mail-ua1-x935.google.com with SMTP id f15so6033215uao.12 for ; Wed, 10 Aug 2022 10:24:54 -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; bh=fMnFymX9YSkYh2WbtZ0M0MyZkfzFEuRbXLIj7xauplg=; b=aqZeiLfXMZE/hF0yv8bsCEUe/WS2QkJFrY94KI0D1+5UTiDDjskPsEUta0OZAK/QfU smU6MGVJKKRPz78aNfx3WIg+SWOzYr0cP+NmGAQxnAxvXnhqwjC/+kACo3Dw7zHhgqk9 2sloGNrQDzuXtAeZyFN8A3/wQSvPOB36gfRwuFbio+xdOyFvgkcQnvEzD8PxcL5SmnDZ kXsz2AshUzKEfH53Ak1rQcI0xxItTVnkkAzr3qWePyt+79A/rKmUmdnWg/vqYA8ImQJo 6UK1NAlv63V2dbuqaijR4KPyAAcZjVGFnQIx2Iq7txaEeLOoCkklRtXcNoy5xD4aRhpN iTMA== X-Gm-Message-State: ACgBeo0VzCeFcdtWY8vb+AM7B5BpvL0tbVnEzeQ+ElMuJHOEcHcAJ58v EpDOXXKPFvPrjs079zzVSV0ZHf4h1GZndQ== X-Google-Smtp-Source: AA6agR4Zn5mNDo6vuEFtASkEXZFnlaKlV04CV0K2HBShsQYcxJRilYboCFdLccJjSx+o1/G8eQJ7uA== X-Received: by 2002:ab0:760d:0:b0:384:cea0:b24f with SMTP id o13-20020ab0760d000000b00384cea0b24fmr12743516uap.7.1660152293331; Wed, 10 Aug 2022 10:24:53 -0700 (PDT) Received: from mandiga.. ([2804:431:c7ca:930b:405a:6d95:e89e:4020]) by smtp.gmail.com with ESMTPSA id i31-20020a0561023d1f00b00388859a325asm155722vsv.30.2022.08.10.10.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 10:24:53 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org, Florian Weimer Subject: [PATCH v2 2/5] linux: Use compile_c_snippet to check linux/pidfd.h availability Date: Wed, 10 Aug 2022 14:24:44 -0300 Message-Id: <20220810172447.1502169-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810172447.1502169-1-adhemerval.zanella@linaro.org> References: <20220810172447.1502169-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 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, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Wed, 10 Aug 2022 17:24:55 -0000 Instead of tying to a specific kernel version. Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py index e207b55eef..d732173abd 100644 --- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py +++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py @@ -33,10 +33,12 @@ def main(): help='C compiler (including options) to use') args = parser.parse_args() - linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc) - # Linux started to provide pidfd.h with 5.10. - if linux_version_headers < (5, 10): + if glibcextract.compile_c_snippet( + '#include ', + args.cc).returncode != 0: sys.exit (77) + + linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc) linux_version_glibc = (5, 19) sys.exit(glibcextract.compare_macro_consts( '#include \n', -- 2.34.1