Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4778619imb; Wed, 6 Mar 2019 23:48:33 -0800 (PST) X-Google-Smtp-Source: APXvYqx0IaMKoeHWbyqqTH76JWbk1ejMUgEPNTRFO5qQFns31Y4W70dov8f6gXfz/izcpYODYaGj X-Received: by 2002:a17:902:ea8c:: with SMTP id cv12mr11260619plb.123.1551944913281; Wed, 06 Mar 2019 23:48:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551944913; cv=none; d=google.com; s=arc-20160816; b=k54BfaCNNJCX5c9QodKKMeZuT9VS5vlutHUpj1NI6OoGHYYUTv23ZcqC5peXrJXv/Q 0geht01AyYBnlSqQb2i2HdiElKnEiYYHWBl+FrQBlhRK1h+mqd34H6+qaPJswxDuLSLj FOPb5RLt42ZFNPv5wamO6VS8cje4QR3hVV5GbU5uRM9nIVlGREKd6iJYYaGD5udXfDU4 xbzCV4N0gVvKHMUdDJwC8K7PCg1l0Db4L5iWhgJElTZws2tbQuaQ8nZtk68H6CI7xrYL JCTNpQkFM2fBjIXrdF75AhiqzJewANEatWoSwkW0RstHqb7gmd/8AI6SM7W3L7Qtk9bX o8Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=Zn/zKIcN4zXCveYui3iG9YUDFMJFfgPYtVdLQxPdEcM=; b=l0LSfYLZL/TL6S3kroI27FG3koYXPTcpwGm23NsnCuZEov2ZL23GFDR/Xj/r6ayaIL 8KfJ4+kr7T7E9umNtSrLq4x1WPfbdtNC5lH3+Ii4Lbf6nxBCT21vcz9sywWmpSyHbxKV a5zDOOdhRTpZ4MguS7xq+OObcVWmt0RqzHALuASzbHCWx7nK6p9XjWVfg9uGRs+jVI6M ed8d/Nvb1xQoiq7Ah8kuIeQmyjA/plQ1BaJPeBt4RzakDKRX7ILCMhXK92KE3di8mHyB xvEl15pxWZgHIFvc73okVVr6ElRMcQmIRboUOUw+DGkevP/FuCUmRZYteVxbFbQ/C9qk YHyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r201si3196683pgr.445.2019.03.06.23.48.17; Wed, 06 Mar 2019 23:48:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726148AbfCGHr5 (ORCPT + 99 others); Thu, 7 Mar 2019 02:47:57 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:37138 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbfCGHr5 (ORCPT ); Thu, 7 Mar 2019 02:47:57 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 44FN5j4H3sz1r2tT; Thu, 7 Mar 2019 08:47:53 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 44FN5j3mQ0z1qrht; Thu, 7 Mar 2019 08:47:53 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id I8xNU0h7eey9; Thu, 7 Mar 2019 08:47:52 +0100 (CET) X-Auth-Info: R11V2e9QPk0WWIrDs49LgWO/hYCeYbOH2yqfbIUa4XQ= Received: from jawa (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 7 Mar 2019 08:47:52 +0100 (CET) Date: Thu, 7 Mar 2019 08:47:44 +0100 From: Lukasz Majewski To: Arnd Bergmann Cc: Linux Kernel Mailing List , Joseph Myers , GNU C Library Subject: Re: [Y2038] Question regarding support of old time interfaces beyond y2038 Message-ID: <20190307084619.299d8692@jawa> In-Reply-To: References: <20190305162351.5aadde66@jawa> Organization: denx.de X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/aGcDOv8bf_ZCsww=8nd30jT"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/aGcDOv8bf_ZCsww=8nd30jT Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Arnd, > On Tue, Mar 5, 2019 at 4:24 PM Lukasz Majewski wrote: > > > > Dear Arnd, > > > > In your "playground" repository [1] (branch: y2038), the time > > functions (stime, settimeofday, etc) are not converted in Linux to > > be Y2038 aware (as for example clock_settime{64}() is). =20 >=20 > Correct. FWIW, this is now merged into the mainline kernel. >=20 The arch/arm/tools/syscall.tbl linux-next 20190306 SHA1: cf08baa29613dd899954089e7cc7dba1d478b365 Has now: 403 common clock_gettime64 sys_clock_gettime 404 common clock_settime64 sys_clock_settime 405 common clock_adjtime64 sys_clock_adjtime 406 common clock_getres_time64 sys_clock_getres 407 common clock_nanosleep_time64 sys_clock_nanosleep 408 common timer_gettime64 sys_timer_gettime 409 common timer_settime64 sys_timer_settime 410 common timerfd_gettime64 sys_timerfd_gettime 411 common timerfd_settime64 sys_timerfd_settime 412 common utimensat_time64 sys_utimensat 413 common pselect6_time64 sys_pselect6 414 common ppoll_time64 sys_ppoll 416 common io_pgetevents_time64 sys_io_pgetevents 417 common recvmmsg_time64 sys_recvmmsg 418 common mq_timedsend_time64 sys_mq_timedsend 419 common mq_timedreceive_time64 sys_mq_timedreceive 420 common semtimedop_time64 sys_semtimedop 421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait 422 common futex_time64 sys_futex 423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval > > I've also searched on the Internet and I've found some old > > discussions regarding them: > > > > SHA1: d33c577cccd0b3e5bb2425f85037f26714a59363 [2] > > From commit message: > > > > "The time, stime, utime, utimes, and futimesat system calls are only > > used on older architectures, and we do not provide y2038 safe > > variants of them, as they are replaced by clock_gettime64, > > clock_settime64, and utimensat_time64." > > > > Moreover, the stime has been even explicitly marked as obsolete [3]. > > > > > > From other discussion [4] - regarding the following system calls: > > time, stime, gettimeofday, settimeofday, adjtimex, nanosleep, > > alarm, getitimer, setitimer, select, utime, utimes, futimesat, and > > {old,new}{l,f,}stat{,64}. > > > > "These all pass 32-bit time_t arguments on 32-bit > > architectures and are replaced by other interfaces (e.g. posix > > timers and clocks, statx). C libraries implementing 64-bit time_t > > in 32-bit architectures have to implement the handles by wrapping > > around the newer interfaces." > > > > > > > > > > Has something changed since then? Has any new idea for conversion > > emerged? =20 >=20 > No, this has been the plan for many years now. Ok. >=20 > > After observing the development of y2038 on playground [1], I can > > deduce that new interfaces are only going to be supported and > > converted (clock_settime64/clock_gettime64, etc.) > > > > Considering the above - would it be best to drop Y2038 support on 32 > > bit machines for old syscalls (stime and friends) and for some > > others (settimeofday/gettimeofday) write Y2038 wrappers based on > > new time kernel API (clock_gettime/settime) in the C library (i.e. > > glibc)? =20 >=20 > There are multiple dimensions to what you are asking here: >=20 > - On the user space interface, the C library (glibc, musl, > uclibc, ...) implements a set of interfaces for time management. The > set that is implemented here is defined by POSIX and other > standards and decided by the respective C library implementation. > All functions that get implemented here have to use the same > definition of time_t however, so if there is both a clock_gettime() > function and a time() function, they must either both use 32-bit > time_t or both must use 64-bit time_t. Both can be implemented > on top of any kernel interface for getting the time (time, > gettimeofday, clock_gettime, clock_gettime64), but the only sensible > implementation is to use clock_gettime64() in order to have the full > range and resolution. I see. I just would like to be sure that the "old" API calls (for example the settimeofday, gettimeofday, stime, etc) are not recommended (planned?) for conversion to have 64 bit interfaces (like clock_{get|set}time). >=20 > - The kernel has a growing set of system calls, i.e. we tend to > only add new ones but not take old ones away. In many cases, > a new syscall is a superset of the old one (e.g. oldstat, newstat > stat64, xstat), any architecture that had an old version has > to keep it around, but new architectures only ever provide the > most recent variant. >=20 > Arnd Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/aGcDOv8bf_ZCsww=8nd30jT Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAlyAzKAACgkQAR8vZIA0 zr1QVQf+Mau3HTmwZFMYblgOKZ7QqTrgsRuAy9/tpwJZYNlXFfKjs2Nj2d+lLyZ0 7BYetfZf7Vkl3V7IMHYWHZR43sX7iqF1Rym6byBCwaUvGVKKraSmjUcMr3uSpIdq GL2OqDcCNdBYMkaXMcE+NJR6ti5qFNWqaWSZZfL6TtelDSPamCto8n8I2R2rFW/f qvka2DFVA+2j/bbgfMlAX8fLGTn33i7dbfNvjPOzdQSPCt3bKnIqaSaq9mVVispU OAy2aC+tYYjk5AeV/BjeDUJrPazbaq32EzBDbkrUBYxAu4GpQs3Pyl9WGKGRd4mp otcxGiveaLsPSOvUnohcm6sho2RGAg== =+1Io -----END PGP SIGNATURE----- --Sig_/aGcDOv8bf_ZCsww=8nd30jT--