From patchwork Fri Oct 25 12:08:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 177731 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3601297ill; Fri, 25 Oct 2019 05:08:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqySbJ1bqVCqSBDfEmwJ3cmw9UWi/k489cm1FGkl9G9w80Fz0Rl/6/19URjFdVYgy70kfU70 X-Received: by 2002:a05:6402:1492:: with SMTP id e18mr3510876edv.140.1572005337170; Fri, 25 Oct 2019 05:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572005337; cv=none; d=google.com; s=arc-20160816; b=DlrBy0XB9zcFdEeDAMSWtLZV2qMTmOv6tGPBgAodLyHRkenDHrTW13BQdrTC8lXbul L24P4mv/nvuu7elTumo+tlutADEQotTZkDpDtzMceMjy65wWkcCTAWsBgzZshJ5pspE3 EbUPgPMR9GPmak3zD5txQpUVXwlnqSYDiDcK1EVP6zBSWpStiPTSKBPX1Ss7+0EmNzLt F0K/tBwTces9+siyaYohHQHWdpfeXdB5u4JhK6FPy40v9dkc8TH43Y87X9UbQrEbhuSE 3BHVlOXi3uxtVGGvtcYAtK5NactRzY+HbVztvUzMmzRJ2676BFMTEq+VLDFsmkQAq2cq FcVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=10SPGclZ4SGETbtTnWpx2c/jR4w84NuY3nO6ko3Rf5Q=; b=HzPiWDS0XAk28Id69XokY0pdvR7NrBqhOozzSjyLHL0shrh2ZwaKmcjAkuxmLrv9B9 Q7g6ySiagn16A4cyWQOwVq7EcS8NrkoryxTHagQxh+zUKwmuQ8gVwizersGr7xkCJn7m DdVeqELT7D3su8VDiaLbtGyGqKLTcxoHZtTsFPm/67ryCrgblqMhLRNJFkUh32sp5wwU 0gwXe9ZZ5C2ZU42uhgkivrmBl3Ui/wutYuW5nZjGv4uUAAjFaVrrbgXdvdH2tzfbkNiM 5KXrL9ymNDPEbZJ/bqF5dP68P/gFpArZLZLY+fZuKQUa5STaPaNCxKXxFkMX6m0uAt2D YV2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=av7YKZNX; dkim=pass header.i=@linaro.org header.s=google header.b=CqwrGq74; spf=pass (google.com: domain of libc-alpha-return-106281-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106281-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g6si1213588eda.377.2019.10.25.05.08.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Oct 2019 05:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-106281-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=av7YKZNX; dkim=pass header.i=@linaro.org header.s=google header.b=CqwrGq74; spf=pass (google.com: domain of libc-alpha-return-106281-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106281-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=CRa2widuIvvu+0nsH6/Sf/UAZOwUpOMjSIZ5rCsUjhhNK571NSfAa SZzi4GXrkKeuVnUnHsNylkd6HdHkue98WKXKAWDWDEIlMTfeQTLJCMYG4PdHus0c 7R6ZLljLAwwYlNEXqtbHCS7QYv5R67Gan0++broEyR39nQZziUwZZo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=F1GupYnbY35DHURtlMRrwzOgL/o=; b=av7YKZNXLhAAzCna04RAAJXjfQTF FeMQcG65BVOwB8B3EzzhwHNHgtobBGGL1CoG4j+NQzpQQv0i1ttQhjqJvVJm0gYU UTM/OfIzeHF9DS6yqilPGv0MYxssH7/R8iOWT/HQqJeQ/7a37jwH5imi7E8FcC+E psej8B0u6JhISs8= Received: (qmail 76336 invoked by alias); 25 Oct 2019 12:08:45 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 76327 invoked by uid 89); 25 Oct 2019 12:08:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-13.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=withdraw, aims X-HELO: mail-qk1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=10SPGclZ4SGETbtTnWpx2c/jR4w84NuY3nO6ko3Rf5Q=; b=CqwrGq74tkgFcGBOjd1Am3sA2gAFgRMTAihCX/S+bC3n3S5yAfLYb1O+h0OfmIutEl lk3k8iy54iMTBUB0fo+sV8EFvak06BW9aWq9ykMvv6/rPVv+7lTi7gIjB3P1VGwZXAZ9 j6L7kyqlnIAPdKWGlxyjpC7UhVY6GzcwqK2tNH1KTidzzjH/K96vSB2e4/1ClGnx0W44 TbuwV/INBUurHmWAvsB4yA1FugGwgN9DPWDOvSowDivbG9ssKv9HdNvYtAmbhSguGfsV pZ1OiXXwU8PcY/Zd6iRT9I2RQ76EgU2giJDxkhf51/X6Syk6qFH3QJLa8m2f2MuvOMxm 5teQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Lukasz Majewski Subject: [PATCH v2 00/11] Y2038 preparation: use clock_[gs]ettime to implement the other time-getting and -setting functions. Date: Fri, 25 Oct 2019 09:08:21 -0300 Message-Id: <20191025120832.27667-1-adhemerval.zanella@linaro.org> This is an updated version from Zack Weinberg patchset [1]. This patchset aims to make the Y2038 project a little easier by implementing the other time-getting and time-setting functions (time, ftime, stime, gettimeofday, and settimeofday) in terms of clock_gettime and clock_settime. Internal uses of (__)gettimeofday are also all changed to __clock_gettime. I also changed the internal uses of time(), which allowed some cleanup in arch specific code. The user-visible consequences of this patchset are: - The obsolete function stime is no longer availabe to new binaries and the function ftime is marked as deprecated. - gettimeofday and ftime now always report a crude time zone corresponding to UTC. - settimeofday will fail with EINVAL when both of its arguments are non-null. - Programs that call gettimeofday with a non-null tzp argument will receive compile-time warnings (with GCC and when optimizing). This patchset also includes a partial revision of manual/time.texi clock_gettime and clock_settime are now documented, and the obsolescent status of stime, settimeofday, and gettimeofday is clearer. I only documented CLOCK_REALTIME and CLOCK_MONOTONIC, because most of the other clock constants are either extremely Linux-specific or they have to do with measuring CPU time, and I didn't touch the measuring-CPU-time part of time.texi. (That part also deserves a rewrite, but I don't know enough about the topic and this patchset is already long enough.) I ran build-many-glibcs on most abi targets (aarch64, alpha, arm-eabihf, csky, hppa, ia64, m68k, m68k-coldfire, microblaze, microblazeel, mips64, powerpc64, powercp64le, riscv64, s390x, and x86_64), I couldn't run on i686-gnu due it is currently broken on master. The patches were tested fully on x86_64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu, and aarch64-linux-gnu. [1] https://sourceware.org/ml/libc-alpha/2019-08/msg00725.html Adhemerval Zanella (3): Use clock_gettime to implement time. Change most internal uses of time to __clock_gettime. Use clock_gettime to implement gettimeofday. Zack Weinberg (8): Linux/Alpha: don't use timeval32 system calls. Change most internal uses of __gettimeofday to __clock_gettime. Use clock_settime to implement stime; withdraw stime. Use clock_settime to implement settimeofday. Consolidate and deprecate ftime Use clock_gettime to implement timespec_get. Make second argument of gettimeofday as 'void *' Revise the documentation of simple calendar time. NEWS | 46 + include/sys/time.h | 7 +- include/time.h | 11 +- inet/deadline.c | 8 +- login/logout.c | 9 +- login/logwtmp.c | 7 +- manual/filesys.texi | 2 +- manual/llio.texi | 10 +- manual/threads.texi | 2 +- manual/time.texi | 1072 ++++++++++------- misc/syslog.c | 2 +- nis/nis_call.c | 4 +- nptl/pthread_join_common.c | 7 +- nptl/pthread_mutex_timedlock.c | 7 +- nscd/nscd_gethst_r.c | 2 +- nscd/nscd_helper.c | 28 +- resolv/gai_misc.c | 6 +- resolv/gai_suspend.c | 6 +- resolv/res_send.c | 7 +- string/strfry.c | 4 +- sunrpc/auth_des.c | 19 +- sunrpc/auth_unix.c | 9 +- sunrpc/create_xid.c | 6 +- sunrpc/svcauth_des.c | 7 +- support/support_test_main.c | 23 +- sysdeps/generic/memusage.h | 16 +- sysdeps/{unix => mach}/clock_gettime.c | 37 +- sysdeps/{unix => mach/hurd}/clock_settime.c | 51 +- sysdeps/mach/hurd/getitimer.c | 11 +- sysdeps/mach/hurd/setitimer.c | 13 +- sysdeps/mach/hurd/times.c | 7 +- sysdeps/mach/nanosleep.c | 36 +- sysdeps/mach/usleep.c | 5 - sysdeps/posix/gettimeofday.c | 67 -- sysdeps/posix/tempname.c | 9 +- sysdeps/pthread/aio_misc.c | 6 +- sysdeps/pthread/aio_suspend.c | 6 +- sysdeps/unix/make-syscalls.sh | 2 +- sysdeps/unix/syscalls.list | 2 - sysdeps/unix/sysv/linux/Makefile | 2 +- .../unix/sysv/linux/aarch64/gettimeofday.c | 38 +- sysdeps/unix/sysv/linux/adjtime.c | 40 +- sysdeps/unix/sysv/linux/adjtimex.c | 40 + sysdeps/unix/sysv/linux/alpha/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/adjtime.c | 82 +- sysdeps/unix/sysv/linux/alpha/adjtimex.c | 22 + .../linux/{time.c => alpha/gettimeofday.c} | 31 +- sysdeps/unix/sysv/linux/alpha/osf_adjtime.c | 130 ++ .../sysv/linux/alpha/osf_getitimer.c} | 40 +- .../linux/alpha/osf_getrusage.c} | 33 +- .../unix/sysv/linux/alpha/osf_gettimeofday.c | 48 + sysdeps/unix/sysv/linux/alpha/osf_setitimer.c | 49 + .../sysv/linux/alpha/osf_settimeofday.c} | 51 +- .../gettimeofday.c => alpha/osf_utimes.c} | 36 +- .../sysv/linux/alpha/osf_wait4.c} | 41 +- sysdeps/unix/sysv/linux/alpha/settimeofday.c | 22 + sysdeps/unix/sysv/linux/alpha/syscalls.list | 26 +- sysdeps/unix/sysv/linux/alpha/tv32-compat.h | 146 +++ sysdeps/unix/sysv/linux/check_native.c | 2 +- sysdeps/unix/sysv/linux/check_pf.c | 2 +- sysdeps/unix/sysv/linux/ftime.c | 3 - sysdeps/unix/sysv/linux/getsysstats.c | 2 +- sysdeps/unix/sysv/linux/gettimeofday.c | 39 - sysdeps/unix/sysv/linux/ifaddrs.c | 2 +- .../unix/sysv/linux/powerpc/gettimeofday.c | 71 +- sysdeps/unix/sysv/linux/powerpc/time.c | 71 +- sysdeps/unix/sysv/linux/settimezone.c | 36 + sysdeps/unix/sysv/linux/syscalls.list | 2 - .../linux/{i386/time.c => time-internal.h} | 24 +- sysdeps/unix/sysv/linux/timespec_get.c | 46 - sysdeps/unix/sysv/linux/x86/gettimeofday.c | 47 +- sysdeps/unix/sysv/linux/x86/time.c | 34 +- .../unix/sysv/linux/x86_64/x32/gettimeofday.c | 1 + .../unix/sysv/linux/x86_64/x32/syscalls.list | 1 - time/Makefile | 8 +- time/ftime.c | 26 +- time/getdate.c | 2 +- time/gettimeofday.c | 32 +- time/settimeofday.c | 24 +- sysdeps/unix/stime.c => time/settimezone.c | 23 +- time/stime.c | 25 +- time/sys/time.h | 23 +- time/sys/timeb.h | 3 +- .../timespec_get.c => time/time-internal.h | 26 +- time/time.c | 14 +- time/time.h | 6 - time/timespec_get.c | 14 +- time/tst-ftime.c | 7 + 88 files changed, 1681 insertions(+), 1393 deletions(-) rename sysdeps/{unix => mach}/clock_gettime.c (65%) rename sysdeps/{unix => mach/hurd}/clock_settime.c (65%) delete mode 100644 sysdeps/posix/gettimeofday.c create mode 100644 sysdeps/unix/sysv/linux/adjtimex.c create mode 100644 sysdeps/unix/sysv/linux/alpha/adjtimex.c rename sysdeps/unix/sysv/linux/{time.c => alpha/gettimeofday.c} (64%) create mode 100644 sysdeps/unix/sysv/linux/alpha/osf_adjtime.c rename sysdeps/{mach/gettimeofday.c => unix/sysv/linux/alpha/osf_getitimer.c} (50%) rename sysdeps/unix/{bsd/ftime.c => sysv/linux/alpha/osf_getrusage.c} (59%) create mode 100644 sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c create mode 100644 sysdeps/unix/sysv/linux/alpha/osf_setitimer.c rename sysdeps/{mach/hurd/settimeofday.c => unix/sysv/linux/alpha/osf_settimeofday.c} (54%) rename sysdeps/unix/sysv/linux/{i386/gettimeofday.c => alpha/osf_utimes.c} (56%) rename sysdeps/{posix/time.c => unix/sysv/linux/alpha/osf_wait4.c} (51%) create mode 100644 sysdeps/unix/sysv/linux/alpha/settimeofday.c create mode 100644 sysdeps/unix/sysv/linux/alpha/tv32-compat.h delete mode 100644 sysdeps/unix/sysv/linux/ftime.c delete mode 100644 sysdeps/unix/sysv/linux/gettimeofday.c create mode 100644 sysdeps/unix/sysv/linux/settimezone.c rename sysdeps/unix/sysv/linux/{i386/time.c => time-internal.h} (62%) delete mode 100644 sysdeps/unix/sysv/linux/timespec_get.c create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/gettimeofday.c rename sysdeps/unix/stime.c => time/settimezone.c (67%) rename sysdeps/posix/timespec_get.c => time/time-internal.h (62%) -- 2.17.1