From patchwork Thu Nov 28 11:32:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 102014 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 551E23858C48 for ; Thu, 28 Nov 2024 11:33:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 551E23858C48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1732793631; bh=5MtVeOIYvtIprSXbUde9BC/4q/pjUNuUYWKIfUfsABs=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=tnz5vgEP11ptC1Y1cuQ+LUXwV50gPSVMxE/8d3Ejjwq4cu3Wqn/zckMLKBibsHBVD BVFMaaac45uaAHWGnf4HL2NfOPRUt/Yr9A6cHCOutkM4eEgX51gOB4wG/oA2sIAnK0 ZO5pcmCtbAEXniJGCMxVwUl7VeVnwBy+1/K1rXg0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from zebra.cherry.relay.mailchannels.net (zebra.cherry.relay.mailchannels.net [23.83.223.195]) by sourceware.org (Postfix) with ESMTPS id 6AB353858D20 for ; Thu, 28 Nov 2024 11:33:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AB353858D20 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=sourceware.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=sourceware.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6AB353858D20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=23.83.223.195 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1732793585; cv=pass; b=m0EA8EsLH+Qp1ty8udVKmUYIZgyHvSdmrLqOadNJoRge5lXhgJ2848V9wuOYg5NbAOeVYRF8Xaj67kwCVlWt6NYWyjdIAHq+2H1QBguK6bnpz7ZmXHOGkRQiI+kmf5iuphIev0b7j7RiHk1gxE+LSsinojliBc2Hkpn+PLXa4Lw= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1732793585; c=relaxed/simple; bh=JsEC+oOKKsPpwQYGp+GjlAsrgGtaB4TIO44npJ242s4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=kjpa1DnkNgGt0rZuuumhHvHVkqA34mfXV1rLZxCuKIDvWYx2wUgOPULYb1hxhYIbdzgy/8GXYB5X1A/GAcZHyDPy2VKyo4LAICYr1UMbQsFOom0E9l8PMBQIJmhE6Cl34bw0dMRAs6pwtSy+hG/bvVo5sXAFCREDTb5JcAS7UAs= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AB353858D20 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 74E8A902C02; Thu, 28 Nov 2024 11:33:04 +0000 (UTC) Received: from pdx1-sub0-mail-a290.dreamhost.com (100-122-93-195.trex-nlb.outbound.svc.cluster.local [100.122.93.195]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5A056901EF5; Thu, 28 Nov 2024 11:33:03 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1732793583; a=rsa-sha256; cv=none; b=hMr2gF+ZtStF1PerQfIYu2lWjNtzuJTqC8GBJq1pIevTjQnpg1vvL50T9HNBeeH3eAvxTO HywZ5vsbPA3OWJ4UeS5TdV2gTU1W1HxULUcC2W4H8U2/2w7T9IUzl/gLED/PteCRO1TTA+ iqynIiX9skI6CuqDwSsu7WovSOYZNymMaYfnqWAmp4RhFYF3VYHFS+etOhJZtj9O+DKvlg WVU/kcrANk+vuPiPad6O50gzOoOXO8H+XzeMAifd46F0FoR3Qg7tLbCw9x4LCilMOmxFBn 5jjRuj8ins40xZsZkoTEZp0kbl9fB6WnffnI9GHpXT9pZLxVlDhQ36+VFSSdbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1732793583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5MtVeOIYvtIprSXbUde9BC/4q/pjUNuUYWKIfUfsABs=; b=45fHwknEPxrzmn3nXyn+E94CSii0/tt/CvPNlH+R6Gm5QdTZKSlm4uWeTpk0DE+WapIgtU a0/4Eur+f+L1VbadRFAco4U3oohs0gUThvTf7zyGGktt6L02qZZn65TQp89KvAyVrRPMmz YgCpB0f7jRWvp4JZCwceJbPbqsrBgMv+X/lY0MZTpx2l6wJLGZL3L1SZnRqIXSUcRtu+AU hjO0HUhu0ozbkmR/vJBWwtM+ph1uJNZT3eQNVoMsiXr9/YZhl4gPB5jZshzR6hNN+Rc6G1 LPNI0C9FYWkvJVa8QQJ/Osz87MSb0Z5lCj4CGJlwv8AFZjTxCMX2vSryH15R/w== ARC-Authentication-Results: i=1; rspamd-868968d99d-v7p4j; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@sourceware.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Stretch-Zesty: 6cf498b90a45ccc4_1732793583584_3846632145 X-MC-Loop-Signature: 1732793583584:56418315 X-MC-Ingress-Time: 1732793583583 Received: from pdx1-sub0-mail-a290.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.122.93.195 (trex/7.0.2); Thu, 28 Nov 2024 11:33:03 +0000 Received: from fedora.redhat.com (bras-base-toroon4859w-grc-89-184-146-156-41.dsl.bell.ca [184.146.156.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a290.dreamhost.com (Postfix) with ESMTPSA id 4XzZ1V6zv4zLZ; Thu, 28 Nov 2024 03:33:02 -0800 (PST) From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Cc: carlos@redhat.com Subject: [PATCH] pthread_getcpuclockid: Add descriptive comment to smoke test Date: Thu, 28 Nov 2024 06:32:58 -0500 Message-ID: <20241128113259.2113810-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1166.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_SHORT, LOCAL_AUTHENTICATION_FAIL_DMARC, LOCAL_AUTHENTICATION_FAIL_SPF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_SOFTFAIL, 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.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Add a descriptive comment to the tst-pthread-cpuclockid-invalid test and also drop pthread_getcpuclockid from the TODO-testing list since it now has full coverage. --- nptl/TODO-testing | 4 ---- nptl/tst-pthread-getcpuclockid-invalid.c | 12 ++++++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/nptl/TODO-testing b/nptl/TODO-testing index e076e5624f..f50d2ceb51 100644 --- a/nptl/TODO-testing +++ b/nptl/TODO-testing @@ -10,10 +10,6 @@ pthread_attr_[sg]etstack some more tests needed -pthread_getcpuclockid - - check that value is reset -> rt subdir - pthread_getschedparam pthread_setschedparam diff --git a/nptl/tst-pthread-getcpuclockid-invalid.c b/nptl/tst-pthread-getcpuclockid-invalid.c index e88a563427..df1ad18226 100644 --- a/nptl/tst-pthread-getcpuclockid-invalid.c +++ b/nptl/tst-pthread-getcpuclockid-invalid.c @@ -1,5 +1,4 @@ -/* Smoke test to verify that pthread_getcpuclockid fails with ESRCH when the - thread in question has exited. +/* pthread_getcpuclockid should fail with ESRCH when the thread exits. Copyright the GNU Toolchain Authors. This file is part of the GNU C Library. @@ -17,6 +16,15 @@ License along with the GNU C Library; if not, see . */ +/* The input thread descriptor to pthread_getcpuclockid needs to be valid when + the function is called. For the purposes of this test, this means that the + thread should not be detached, have exited, but not joined. There is also a + tiny window where the TCB has been allocated but the target thread itself + not created, where pthread_getcpuclockid could return ESRCH, but it's not + possible to tap into that window to reliably test it. It's not necessary + anyway, since the window this test exploits is good enough to complete + coverage for pthread_getcpuclockid alongside tst-clock2. */ + #include #include #include