From patchwork Wed Apr 15 20:59:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 133148 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 1DE9B4BA2E2B for ; Wed, 15 Apr 2026 20:59:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DE9B4BA2E2B X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 4FC434BA2E10 for ; Wed, 15 Apr 2026 20:59:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FC434BA2E10 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4FC434BA2E10 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776286749; cv=none; b=aZX+uoFWVzj961zJ7cZaxEYs0D4QXs9yX/UdiJY8zEZOR9k+dq5PqgBj0gNqCapINZepgPWb8mwi9ifOJnwG9Jd4TDUO4LJb3lad3l6zt1YY5fOZMX8E41dJruBHD1reH1YraqSI5mlbScClf+aux7T5vpxnA+AA1ZFsSeMJcjk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776286749; c=relaxed/simple; bh=RV+UbgvL/fzsBl717634iazNW3bzo+X8edDLHh6ESzc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=nHcYny9w26u05D5Yt+DcZRnAna1m3Ex37rdL/Tq1uswDa290WpaIQB/g7ka1ezH6/tbPlH7fJcdJNx2cEl+dgmLmAHs5crh2JKZS7fSfJV2wOU2T1YzzFodYXKP4W9Duz+QTi2w8cW9JFL7C0MvFwBiDEHY3o9ilzc0NzEGtZdw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FC434BA2E10 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 26681A01E2; Wed, 15 Apr 2026 22:59:07 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sgDmPnxzuTnA; Wed, 15 Apr 2026 22:59:07 +0200 (CEST) Received: from end (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 9D0D2A027C; Wed, 15 Apr 2026 22:59:06 +0200 (CEST) Received: from samy by end with local (Exim 4.99.1) (envelope-from ) id 1wD7KE-00000005HF0-0fCN; Wed, 15 Apr 2026 22:59:06 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Michael Kelly , commit-hurd@gnu.org Subject: [hurd, commited 3/3] hurd: __adjtime() to support NULL delta whilst returning olddelta. Date: Wed, 15 Apr 2026 22:59:05 +0200 Message-ID: <20260415205905.1257892-4-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260415205905.1257892-1-samuel.thibault@ens-lyon.org> References: <20260415205905.1257892-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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 From: Michael Kelly This is required to obtain the remaining time of day adjustment without altering the required adjustment. Message-ID: <20260415180318.109742-4-mike@weatherwax.co.uk> --- sysdeps/mach/hurd/adjtime.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sysdeps/mach/hurd/adjtime.c b/sysdeps/mach/hurd/adjtime.c index 9d01533b23..4408b1cff5 100644 --- a/sysdeps/mach/hurd/adjtime.c +++ b/sysdeps/mach/hurd/adjtime.c @@ -18,6 +18,7 @@ #include #include #include +#include /* Adjust the current time of day by the amount in DELTA. If OLDDELTA is not NULL, it is filled in with the amount @@ -44,7 +45,18 @@ __adjtime (const struct timeval *delta, struct timeval *olddelta) rpc_delta.microseconds = delta->tv_usec; } else +#ifdef MACH_ADJTIME_USECS_OMIT + { + /* gnumach will not attempt to update the system time if the + specified 'microseconds' is specifically + MACH_ADJTIME_USECS_OMIT. It will still return the olddelta + under these circumstances. */ + rpc_delta.seconds = 0; + rpc_delta.microseconds = MACH_ADJTIME_USECS_OMIT; + } +#else return EINVAL; +#endif err = __host_adjust_time (hostpriv, rpc_delta, &rpc_olddelta); __mach_port_deallocate (__mach_task_self (), hostpriv);