Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2223965/?format=api
{ "id": 2223965, "url": "http://patchwork.ozlabs.org/api/patches/2223965/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260416-fix_clock_settime_helper-v1-1-2874202291bf@suse.com/", "project": { "id": 59, "url": "http://patchwork.ozlabs.org/api/projects/59/?format=api", "name": "Linux Test Project development", "link_name": "ltp", "list_id": "ltp.lists.linux.it", "list_email": "ltp@lists.linux.it", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260416-fix_clock_settime_helper-v1-1-2874202291bf@suse.com>", "list_archive_url": null, "date": "2026-04-16T13:01:00", "name": "clock_settime: use POSIX runtime detection for CLOCK_MONOTONIC", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "41db941ea3598c6b3bb6548c2fc8826173d87cf8", "submitter": { "id": 83220, "url": "http://patchwork.ozlabs.org/api/people/83220/?format=api", "name": "Andrea Cervesato", "email": "andrea.cervesato@suse.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260416-fix_clock_settime_helper-v1-1-2874202291bf@suse.com/mbox/", "series": [ { "id": 500158, "url": "http://patchwork.ozlabs.org/api/series/500158/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=500158", "date": "2026-04-16T13:01:00", "name": "clock_settime: use POSIX runtime detection for CLOCK_MONOTONIC", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500158/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2223965/comments/", "check": "success", "checks": "http://patchwork.ozlabs.org/api/patches/2223965/checks/", "tags": {}, "related": [], "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\" (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=Ma7fQros;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.de\n header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=7t/sLOMy;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa\n header.b=A5dwI5/l;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=J3bLZwYT;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=213.254.12.146; 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 [213.254.12.146])\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 4fxJ6Z0ngpz1yHP\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 23:01:10 +1000 (AEST)", "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 34A943E263B\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 15:01:08 +0200 (CEST)", "from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::2])\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 68AAD3E1685\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 15:01:03 +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-2.smtp.seeweb.it (Postfix) with ESMTPS id 1E702600AD1\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 15:01:02 +0200 (CEST)", "from imap1.dmz-prg2.suse.org (unknown [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 6CF875BD7D;\n Thu, 16 Apr 2026 13:01:01 +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 4B2FF593A3;\n Thu, 16 Apr 2026 13:01:01 +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 szMMEI3d4GnUPQAAD6G6ig\n (envelope-from <andrea.cervesato@suse.de>); Thu, 16 Apr 2026 13:01:01 +0000" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776344462;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=DsjoFYEYgu/QbZu8RRooZNushuASSxkldLeCQiDB7Co=;\n b=Ma7fQros/G0zdA49Z40Xg09Na251kVIojUXWoqxzs2VVxtY6XSnVTHd9O+9uVFvmn/sqdt\n kci1f1ylCfCG7+7emDLojPjI/jwGu2/xKPN49tHBdpws8uN/g0STmM+T/To2ahGmrFhgos\n iWN9e7mqI4vpdJ5bkCVzGcgg3SNaOrg=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776344462;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=DsjoFYEYgu/QbZu8RRooZNushuASSxkldLeCQiDB7Co=;\n b=7t/sLOMyJeeFaFHBXrAybivsqhgJHSwNNZK2cmivcjjNpHAg3b6uRG9dXbBqhmBkuugBzL\n seaxrOC5JTqoZdCA==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776344461;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=DsjoFYEYgu/QbZu8RRooZNushuASSxkldLeCQiDB7Co=;\n b=A5dwI5/lAjhr7OLxeX2kFbqrQyh+Gh52Er+LRkjCztBAuPYNIIbo9uuxFL9JuU5hSY5rQY\n itlpgBDoMF7ACSAbumsicVvTg1RjUnkTk4LbAVNCqjcNbr6JjfD8sL/nZkuDqS0noZfHkk\n 8XFN8TSfoQiB7lfeMxLRZ9kp9gZudmE=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776344461;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=DsjoFYEYgu/QbZu8RRooZNushuASSxkldLeCQiDB7Co=;\n b=J3bLZwYTisD3lyqaxtuukq6W8B9Xw7O6MA1X5rQodgRqMrgE6jReQnio8sqZoybPF8BNUm\n ZnqbnaYgiGkPTxCg==" ], "From": "Andrea Cervesato <andrea.cervesato@suse.de>", "Date": "Thu, 16 Apr 2026 15:01:00 +0200", "MIME-Version": "1.0", "Message-Id": "<20260416-fix_clock_settime_helper-v1-1-2874202291bf@suse.com>", "X-B4-Tracking": "v=1; b=H4sIAIvd4GkC/x2MSwqAMBDFriKztjCKH/AqIkXbpw5+aYsI4t0tL\n gNJHvJwAk9N8pDDJV6OPUKWJmTmfp+gxEamnPOKi6xSo9zarIdZtEcIskHPWE84ZYt6ZDswlzU\n o5qdDdP91273vB/Kw6CBqAAAA", "X-Change-ID": "20260416-fix_clock_settime_helper-d47f0db0057e", "To": "Linux Test Project <ltp@lists.linux.it>", "X-Mailer": "b4 0.14.2", "X-Developer-Signature": "v=1; a=ed25519-sha256; t=1776344461; l=4148;\n i=andrea.cervesato@suse.com; s=20251210; h=from:subject:message-id;\n bh=70LUBT04Z3zHf5DWXoaacy5QinYOUj1McgJT5YOW/Mc=;\n b=b4w30k5dQ5dPzhslAJgOTwassrH+ZAU+OcoGN58ms9sPkFfiVFoTyzGN1xYgIKO2iIO5LUYk0\n xAV30qVfNDJAaWhW6S1itwdQ0h+bH0w1Be+DZg9ZmhdoihOeuaneayd", "X-Developer-Key": "i=andrea.cervesato@suse.com; a=ed25519;\n pk=zKY+6GCauOiuHNZ//d8PQ/UL4jFCTKbXrzXAOQSLevI=", "X-Spamd-Result": "default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n TO_DN_ALL(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[];\n RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[];\n FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+];\n RCVD_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid, suse.com:email,\n imap1.dmz-prg2.suse.org:helo]", "X-Spam-Score": "-4.30", "X-Spam-Level": "", "X-Spam-Status": "No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,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-2.smtp.seeweb.it", "X-Virus-Scanned": "clamav-milter 1.0.9 at in-2.smtp.seeweb.it", "X-Virus-Status": "Clean", "Subject": "[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>", "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>" }, "content": "From: Andrea Cervesato <andrea.cervesato@suse.com>\n\nThe clock_settime helpers.h used a compile-time #ifdef on\n_POSIX_MONOTONIC_CLOCK to select between real and stub\nimplementations of pts_mono_time_start()/pts_mono_time_check().\n\nOn Linux/glibc, _POSIX_MONOTONIC_CLOCK is defined as 0, meaning\nsupport is optional and must be verified at runtime via\nsysconf(_SC_MONOTONIC_CLOCK). The #ifdef treated 0 the same as\n>0 (always available), which is not POSIX-correct.\n\nReplace the compile-time #ifdef/#else split with a runtime\npts_mono_available() helper that performs proper POSIX detection\nvia sysconf(). Also add a missing #ifndef include guard and\n#include <unistd.h> so _POSIX_MONOTONIC_CLOCK is always defined.\n\nFixes: 9ecb4a004b18 (\"clock_settime: Detect external clock adjustments via CLOCK_MONOTONIC\")\nSigned-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\n---\nbase-commit: 620d596c79493af089ba6a1c4dc79efcc76a67c7\nchange-id: 20260416-fix_clock_settime_helper-d47f0db0057e\n\nBest regards,", "diff": "diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h\nindex 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)\n+\t\treturn 1;\n+#endif\n+\treturn 0;\n+}\n \n static inline int pts_mono_time_start(void)\n {\n-\tif (clock_gettime(CLOCK_MONOTONIC, &_pts_mono_start) != 0) {\n+\tif (!pts_mono_available()) {\n+\t\tstatic int warned;\n+\n+\t\tif (!warned) {\n+\t\t\tprintf(\"CLOCK_MONOTONIC unavailable, test may fail due to clock adjustment\\n\");\n+\t\t\twarned = 1;\n+\t\t}\n+\t\treturn 0;\n+\t}\n+\n+#ifdef _POSIX_MONOTONIC_CLOCK\n+\tif (clock_gettime(CLOCK_MONOTONIC, &pts_mono_start) != 0) {\n \t\tperror(\"clock_gettime(CLOCK_MONOTONIC) failed\");\n \t\treturn -1;\n \t}\n+#endif\n \treturn 0;\n }\n \n static inline int pts_mono_time_check(unsigned int expected_secs)\n {\n-\tstruct timespec now;\n-\tlong elapsed;\n-\n-\tif (clock_gettime(CLOCK_MONOTONIC, &now) != 0) {\n-\t\tperror(\"clock_gettime(CLOCK_MONOTONIC) failed\");\n-\t\treturn -1;\n-\t}\n+#ifdef _POSIX_MONOTONIC_CLOCK\n+\tif (pts_mono_available()) {\n+\t\tstruct timespec now;\n+\t\tlong elapsed;\n \n-\telapsed = now.tv_sec - _pts_mono_start.tv_sec;\n+\t\tif (clock_gettime(CLOCK_MONOTONIC, &now) != 0) {\n+\t\t\tperror(\"clock_gettime(CLOCK_MONOTONIC) failed\");\n+\t\t\treturn -1;\n+\t\t}\n \n-\tif (labs(elapsed - (long)expected_secs) > 1) {\n-\t\tprintf(\"Clock adjustment detected (elapsed %lds, expected ~%us)\\n\",\n-\t\t elapsed, expected_secs);\n-\t\treturn 1;\n-\t}\n-\treturn 0;\n-}\n-#else\n-static inline int pts_mono_time_start(void)\n-{\n-\tstatic int warned;\n+\t\telapsed = now.tv_sec - pts_mono_start.tv_sec;\n \n-\tif (!warned) {\n-\t\tprintf(\"CLOCK_MONOTONIC unavailable, test may fail due to clock adjustment\\n\");\n-\t\twarned = 1;\n+\t\tif (labs(elapsed - (long)expected_secs) > 1) {\n+\t\t\tprintf(\"Clock adjustment detected (elapsed %lds, expected ~%us)\\n\",\n+\t\t\t elapsed, expected_secs);\n+\t\t\treturn 1;\n+\t\t}\n+\t\treturn 0;\n \t}\n-\treturn 0;\n-}\n-\n-static inline int pts_mono_time_check(unsigned int expected_secs)\n-{\n+#endif\n \t(void)expected_secs;\n \treturn 0;\n }\n-#endif\n \n+#endif /* CLOCK_SETTIME_HELPERS_H */\n", "prefixes": [] }