[{"id":3678176,"web_url":"http://patchwork.ozlabs.org/comment/3678176/","msgid":"<20260416133555.3952-1-linuxtestproject.agent@gmail.com>","list_archive_url":null,"date":"2026-04-16T13:35:55","subject":"Re: [LTP] clock_settime: use POSIX runtime detection for\n CLOCK_MONOTONIC","submitter":{"id":93132,"url":"http://patchwork.ozlabs.org/api/people/93132/","name":null,"email":"linuxtestproject.agent@gmail.com"},"content":"Hi Andrea,\n\nOn Thu, 16 Apr 2026, Andrea Cervesato wrote:\n> clock_settime: use POSIX runtime detection for CLOCK_MONOTONIC\n\nReviewed-by: LTP AI Reviewer <ltp-ai@noreply.github.com>\n\n---\nNote:\n\nOur agent completed the review of the patch. The full review can be\nfound at: https://github.com/linux-test-project/ltp-agent/actions/runs/24513029369\n\nThe agent can sometimes produce false positives although often its\nfindings are genuine. If you find issues with the review, please\ncomment this email or ignore the suggestions.","headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=RplAUx5U;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"],"Received":["from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxJts6gMPz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 23:36:05 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 2C4943E4AD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 15:36:03 +0200 (CEST)","from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id B14DD3E4AD5\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 15:35:59 +0200 (CEST)","from mail-dl1-x1243.google.com (mail-dl1-x1243.google.com\n [IPv6:2607:f8b0:4864:20::1243])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 0EFC8600B5C\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 15:35:59 +0200 (CEST)","by mail-dl1-x1243.google.com with SMTP id\n a92af1059eb24-12732165d1eso19497411c88.1\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 06:35:58 -0700 (PDT)","from\n runnervm35a4x.prajoiou5htenajwodrmzf4tne.dx.internal.cloudapp.net\n ([68.220.60.1]) by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2de8f569f4bsm7125962eec.21.2026.04.16.06.35.56\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 16 Apr 2026 06:35:56 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776346557; x=1776951357; darn=lists.linux.it;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=GN0mI51QXbU+n0scjrVS7RwLGhG39cDT1nAycs3B5MQ=;\n b=RplAUx5UfdLqQibU5Wd+z27D9h+4+CQ4cXFEfJm9kE30ppry1oEyLmVDgIzZday0iG\n ciBIk92k7KHL0XXZPO5awUMQPX8KiJvBjKmQHFXewPx7Hv/v1zeLX+5MRi4kD6y4lg9m\n Y5YrK60aIm04jQnXRpKiB62Bw1lvLh+6XCLTRCnWixSRIkR9bCEuDkSZayyB42HRfGFc\n Qr4tm69cTBV/Z5j9WH3kfZthxGdNaWMQQeMYoCoVimLe2WRMP7VjN8tES4CA3367FCb1\n K4YVwM7OT4V/hYu9QRwi3zRGUbKZUDvYrZ/j8ncfj6psLaZadapO40D4m7NTuR85ar+j\n 493g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776346557; x=1776951357;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=GN0mI51QXbU+n0scjrVS7RwLGhG39cDT1nAycs3B5MQ=;\n b=PpldA08r8GQVmDjReyMKAdQ3DIZgrEz4DUws5tjQM5vy5OaWuKv5pjVWTwGoJB43HG\n NiMYjm4may/EOBbAjwF/jk778+k/O1GaTCyvlcgXOwhGk8vR0Fs2pqXhv1HS88brNqBm\n s9s31BAASwJSNMsGFNJtqMpkvEC9DskAjQearVYtmWzyg8j0wtN5s0m5vySmOGRd3qG0\n LqJRDbd/iWs7MZFfZNYIf780GsKYZib+BfzXZHq0oMedwpuCB59K/M2rgGI5FRqlvb6K\n PL6vbiHmWlWk04Lnr9gnCQ239/zJDF72szfR1HjMN928wxYieZHuFrlCk6fgUH2l+aS2\n Rotg==","X-Gm-Message-State":"AOJu0Yy2+nuQznIl9gwxUUB53PuIJ/NJlN4Bxx5OX0r7MAnqQsNBz4QH\n U3K9nBxndz6BrcoThKDkX4cWWAyaIeh0N8+3z3igcOnvs6YSZqQRDPDU","X-Gm-Gg":"AeBDietuaPUytRcePHwCtV8Ej7iEHuvbhU4N+eseLcm3xe4dxb//6SAhFyX/T2Ba0oi\n scZ0xYuoIK11AvF13XgDo4MhsCJLgq9Qfh9OblgObH7p1KiXoIhvDLbHKsN9rDhW4GgJ3/Dbtp5\n Mvk1s4JDyYSx0thMH82LuWcWU6pPaFJKpKY708y/a+yYtfwAqsJ0im20yWzLfcrCdOppG+sSNEI\n MKzjqc4ZM4dxa+ViNxOHl88AIgO6n7LdNo6UGM9AEPzFQaAGImPsIPxIqbMimLtT4ciqkD05M1Q\n zddF4hMR/yR+VElCbXLYNmLh0ivOLIUiyM+5+j+JPX28pBpa0LWy8BSVPODBtxgx6GWoCrng5MF\n r61a1L9InvQ1PKD0Muir+LYTn+rA4zhj25u++yABLoepr9AYMtXhR2nt+65sdLoLU85x2lVrMyL\n 9PtDvupeRpmUDWpfaHTSLWxbpce+A7zpVaUcShPguSo9xn1o/Uyj54sALyYLxj6Lw27VkmR9SSr\n fsxdVXSoLPx2nptOxX55Sq/A936KZH+AeWp","X-Received":"by 2002:a05:7022:6b8d:b0:129:fe5:117e with SMTP id\n a92af1059eb24-12c34edd87dmr14168595c88.26.1776346557097;\n Thu, 16 Apr 2026 06:35:57 -0700 (PDT)","From":"linuxtestproject.agent@gmail.com","To":"Andrea Cervesato <andrea.cervesato@suse.de>","Date":"Thu, 16 Apr 2026 13:35:55 +0000","Message-ID":"<20260416133555.3952-1-linuxtestproject.agent@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260416-fix_clock_settime_helper-v1-1-2874202291bf@suse.com>","References":"<20260416-fix_clock_settime_helper-v1-1-2874202291bf@suse.com>","MIME-Version":"1.0","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-5.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] clock_settime: use POSIX runtime detection for\n CLOCK_MONOTONIC","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Cc":"ltp@lists.linux.it, LTP AI Reviewer <ltp-ai@noreply.github.com>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"}},{"id":3678719,"web_url":"http://patchwork.ozlabs.org/comment/3678719/","msgid":"<20260417125322.GA419619@pevik>","list_archive_url":null,"date":"2026-04-17T12:53:22","subject":"Re: [LTP] [PATCH] clock_settime: use POSIX runtime detection for\n CLOCK_MONOTONIC","submitter":{"id":70792,"url":"http://patchwork.ozlabs.org/api/people/70792/","name":"Petr Vorel","email":"pvorel@suse.cz"},"content":"> From: Andrea Cervesato <andrea.cervesato@suse.com>\n\n> The clock_settime helpers.h used a compile-time #ifdef on\n> _POSIX_MONOTONIC_CLOCK to select between real and stub\n> implementations of pts_mono_time_start()/pts_mono_time_check().\n\n> On Linux/glibc, _POSIX_MONOTONIC_CLOCK is defined as 0, meaning\n> support is optional and must be verified at runtime via\n> sysconf(_SC_MONOTONIC_CLOCK). The #ifdef treated 0 the same as\n> >0 (always available), which is not POSIX-correct.\n\n> Replace the compile-time #ifdef/#else split with a runtime\n> pts_mono_available() helper that performs proper POSIX detection\n> via sysconf(). Also add a missing #ifndef include guard and\n> #include <unistd.h> so _POSIX_MONOTONIC_CLOCK is always defined.\n\n> Fixes: 9ecb4a004b18 (\"clock_settime: Detect external clock adjustments via CLOCK_MONOTONIC\")\n> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>\n> ---\n>  .../conformance/interfaces/clock_settime/helpers.h | 76 +++++++++++++---------\n>  1 file changed, 46 insertions(+), 30 deletions(-)\n\n> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h\n> index 37bf30926f039553e9e370751b7938ca5ea1d00a..b568ec8122d3bba8246b09a5b694f1263084a408 100644\n> --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h\n> +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h\n> @@ -13,7 +13,11 @@\n>   * by those tests.\n>   */\n\n> +#ifndef CLOCK_SETTIME_HELPERS_H\n> +#define CLOCK_SETTIME_HELPERS_H\n> +\n>  #include <stdlib.h>\n> +#include <unistd.h>\n\n>  static int getBeforeTime(struct timespec *tpget)\n>  {\n> @@ -37,53 +41,65 @@ static int setBackTime(struct timespec tpset)\n\n>  #define PTS_MONO_MAX_RETRIES 3\n\n> +static struct timespec pts_mono_start;\n> +\n> +static inline int pts_mono_available(void)\n> +{\n>  #ifdef _POSIX_MONOTONIC_CLOCK\n> -static struct timespec _pts_mono_start;\n> +\tif (_POSIX_MONOTONIC_CLOCK > 0)\n> +\t\treturn 1;\n> +\n> +\tif (!_POSIX_MONOTONIC_CLOCK && sysconf(_SC_MONOTONIC_CLOCK) > 0)\nThis and the previous condition is the same as in patch for nanosleep.\nIt's a simple code, but because it's still a bit specific, wouldn't it make\nsense to move the function from nanosleep/helpers.h [1]\nto newly created file in testcases/open_posix_testsuite/include/clock.h?\nAnd both tests would use it?\n\nKind regards,\nPetr\n\n[1] https://patchwork.ozlabs.org/project/ltp/patch/20260416-fix_nanosleep_include-v2-1-b3147763acb8@suse.com/\n\n> +\t\treturn 1;\n> +#endif\n> +\treturn 0;\n> +}\n\n\nKind regards,\nPetr","headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)","smtp-out2.suse.de;\n\tnone"],"Received":["from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxvvZ0fktz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 22:53:46 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 595103E5955\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 14:53:43 +0200 (CEST)","from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id E82383E2983\n for <ltp@lists.linux.it>; Fri, 17 Apr 2026 14:53:40 +0200 (CEST)","from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 3BA4B140032C\n for <ltp@lists.linux.it>; Fri, 17 Apr 2026 14:53:39 +0200 (CEST)","from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id 4FA385BD1C;\n Fri, 17 Apr 2026 12:53:39 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2F459593AE;\n Fri, 17 Apr 2026 12:53:39 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id OBluClMt4mkNSAAAD6G6ig\n (envelope-from <pvorel@suse.cz>); Fri, 17 Apr 2026 12:53:39 +0000"],"Date":"Fri, 17 Apr 2026 14:53:22 +0200","From":"Petr Vorel <pvorel@suse.cz>","To":"Andrea Cervesato <andrea.cervesato@suse.de>","Message-ID":"<20260417125322.GA419619@pevik>","References":"<20260416-fix_clock_settime_helper-v1-1-2874202291bf@suse.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20260416-fix_clock_settime_helper-v1-1-2874202291bf@suse.com>","X-Rspamd-Pre-Result":["action=no action; module=replies;\n Message is reply to one we originated","action=no action; module=replies;\n Message is reply to one we originated"],"X-Rspamd-Server":"rspamd2.dmz-prg2.suse.org","X-Spamd-Result":"default: False [-4.00 / 50.00];\n\tREPLY(-4.00)[]","X-Rspamd-Queue-Id":"4FA385BD1C","X-Rspamd-Action":"no action","X-Spam-Score":"-4.00","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-6.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-6.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] [PATCH] clock_settime: use POSIX runtime detection for\n CLOCK_MONOTONIC","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Reply-To":"Petr Vorel <pvorel@suse.cz>","Cc":"Linux Test Project <ltp@lists.linux.it>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"}}]