From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id CB60D3858D3C for ; Tue, 7 Mar 2023 14:11:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB60D3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x331.google.com with SMTP id a4-20020a056830008400b0069432af1380so7183062oto.13 for ; Tue, 07 Mar 2023 06:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678198268; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=yT92GDWhbl4rUYeXEni/4E17vmSHQbXyQCCm09KnCTQ=; b=Bw09gMojCVeXIzjTC8/BZuxCOfOHPg9j+lrvTvn8yMUU1UenJx7cR8ohYrVQyKZ+pV eGCTBS5jNoek3T5s5gJT5dlK4Ztx0/ch76YY3dEo2tja6X8ShyAyFMEEMsBpBooC+vRK V5j1klf9EelyeEqhnTc3j02Owr6F7kVuahNydJSKy13RoXQZDedIoLv5XooyjmSyeBUo OA1gNh0AXADwJhd85bRlCAEh0mCCU/RWwZJxxbShR7h9PNmMV2W7aoFxFLPkLkEIca3S 2dipPOsmTLxdnxNn8ZhCk3kG82DE0Y6ohBvFJv8Kp2dWxjKUtgWv/lYQRNmIIvpP3/ks D5zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678198268; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yT92GDWhbl4rUYeXEni/4E17vmSHQbXyQCCm09KnCTQ=; b=otMVronv5U0QYXPYY7Yast+aKL3ljFPRTEYp2WTNXz364qBxv99McITo0CuDhetv5Q B0VuS8Nm4n49aA+AWJ/joEDFDzwhNnJ+p1vCKjqC9JqE8GzN5I1GdtfgWsEBUVzGWg3p tSgvCk+iLNedk1LevQCf12T/k8EBTiMmEEZSfm/hOaXqz69Yv0iYM0xtx0UQIABdHiKk lSQY6rmUzSDvc5NdalS0DbEdiIpu+wNetXUu8oi8+hmPfT35+nyi4CiZrnpNnDqYI4tf 7wuIHrYeCITgsEKbMEiSIpvcIiHXgZv+Lq0RyIZpvOfjBa+EE7R45jknPYYYODih/7dz 7wLg== X-Gm-Message-State: AO0yUKW2Q0RFQloBA6BCSMCkMRtUP2P6lR5o0Mf2JkVuWlcOV4323rC2 xzx4qSMr0GjGuwi/YHbEGK2KrmxZOSb668N2s9/wSg== X-Google-Smtp-Source: AK7set/hEdvLvecUkBllK+fISPQ4lp7+PeOFn6rM69Br6hLQBmhF9jliQQN8rfA7vKk3KUIxUZ/+/g== X-Received: by 2002:a05:6830:448e:b0:694:4f92:e7db with SMTP id r14-20020a056830448e00b006944f92e7dbmr7784121otv.13.1678198267979; Tue, 07 Mar 2023 06:11:07 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c3:d849:85a1:d2e8:5a25:72e7? ([2804:1b3:a7c3:d849:85a1:d2e8:5a25:72e7]) by smtp.gmail.com with ESMTPSA id v17-20020a05683011d100b0068d3ec1427bsm5290746otq.69.2023.03.07.06.11.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Mar 2023 06:11:07 -0800 (PST) Message-ID: <86175abc-2553-f786-1b6d-cfe95fc869ef@linaro.org> Date: Tue, 7 Mar 2023 11:11:04 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] linux: fix ntp_gettime abi break Content-Language: en-US To: =?UTF-8?Q?Kacper_Piwi=c5=84ski?= Cc: Carlos O'Donell , libc-alpha@sourceware.org References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 03/03/23 13:43, Kacper PiwiƄski wrote: > From 64bbb7cc698c8e2c8d8c94247e0bc47ac3b18f77 Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?Kacper=20Piwi=C5=84ski?= > Date: Wed, 22 Feb 2023 18:58:38 +0100 > Subject: [PATCH] linux: fix ntp_gettime abi break > > --- > sysdeps/unix/sysv/linux/ntp_gettime.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/sysdeps/unix/sysv/linux/ntp_gettime.c > b/sysdeps/unix/sysv/linux/ntp_gettime.c > index 4879573530..a577314636 100644 > --- a/sysdeps/unix/sysv/linux/ntp_gettime.c > +++ b/sysdeps/unix/sysv/linux/ntp_gettime.c > @@ -40,7 +40,6 @@ __ntp_gettime64 (struct __ntptimeval64 *ntv) > ntv->time = tntx.time; > ntv->maxerror = tntx.maxerror; > ntv->esterror = tntx.esterror; > - ntv->tai = tntx.tai; > return result; > } > > @@ -54,7 +53,10 @@ __ntp_gettime (struct ntptimeval *ntv) > int result; > > result = __ntp_gettime64 (&ntv64); > - *ntv = valid_ntptimeval64_to_ntptimeval (ntv64); > + //manually update fields to maintain abi with v2.11 struct definition Sigh, so we decided to not add symbol versioning, and add ntp_gettimex instead. Comments should be in the form of '/* ... */', with first uppercase and with final period. But I think we should make it clear that this function should not work on 'struct ntptimeval', even though users might call glibc 2.12 version: /* glibc 2.12 added the 'tai' field to follow along the kernel, but it did not add a compatibility symbol, instead it added __ntp_gettimex. However ntptimeval was still used in both cases, so to keep compatibility it can not set all the new field. */ struct old_ntptimeval { struct timeval time; long int maxerror; long int esterror; }; int __old_ntp_gettime (struct old_ntptimeval *ntv) { struct __ntptimeval64 ntv64; int result; result = __ntp_gettime64 (&ntv64); ntv->time = valid_timeval64_to_timeval (ntv64.time); ntv->maxerror = ntv64.maxerror; ntv->esterror = ntv64.esterror; return result; } strong_alias (__old_ntp_gettime, __ntp_gettime) > + ntv->time = valid_timeval64_to_timeval (ntv64.time); > + ntv->maxerror = ntv64.maxerror; > + ntv->esterror = ntv64.esterror; > > return result; > }