From owner-svn-src-all@freebsd.org Tue Mar 12 04:49:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 706821544096; Tue, 12 Mar 2019 04:49:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 129A772D04; Tue, 12 Mar 2019 04:49:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFCB81DA99; Tue, 12 Mar 2019 04:49:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2C4nmtJ069663; Tue, 12 Mar 2019 04:49:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2C4nlGO069658; Tue, 12 Mar 2019 04:49:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201903120449.x2C4nlGO069658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 12 Mar 2019 04:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345049 - in head/sys: amd64/linux32 compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: amd64/linux32 compat/freebsd32 kern sys X-SVN-Commit-Revision: 345049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 129A772D04 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2019 04:49:49 -0000 Author: imp Date: Tue Mar 12 04:49:47 2019 New Revision: 345049 URL: https://svnweb.freebsd.org/changeset/base/345049 Log: Kill tz_minuteswest and tz_dsttime. Research Unix, 7th Edition introduced TIMEZONE and DSTFLAG compile-time constants in sys/param.h to communicate these values for the machine. 4.2BSD moved from the compile-time to run-time and introduced these variables and used for localtime() to return the right offset from UTC (sometimes referred to as GMT, for this purpose is the same). 4.4BSD migrated to using the tzdata code/database and these variables were basically unused. FreeBSD removed the real need for these with adjkerntz in 1995. However, some RTC clocks continued to use these variables, though they were largely unused otherwise. Later, phk centeralized most of the uses in utc_offset, but left it using both tz_minuteswest and adjkerntz. POSIX (IEEE Std 1003.1-2017) states in the gettimeofday specification "If tzp is not a null pointer, the behavior is unspecified" so there's no standards reason to retain it anymore. In fact, gettimeofday has been marked as obsolecent, meaning it could be removed from a future release of the standard. It is the only interface defined in POSIX that references these two values. All other references come from the tzdata database via tzset(). These were used to more faithfully implement early unix ABIs which have been removed from FreeBSD. NetBSD has completely eliminated these variables years ago. Linux has migrated to tzdata as well, though these variables technically still exist for compatibility with unspecified older programs. So, there's no real reason to have them these days. They are a historical vestige that's no longer used in any meaningful way. Reviewed By: jhb@, brooks@ Differential Revision: https://reviews.freebsd.org/D19550 Modified: head/sys/amd64/linux32/linux32_machdep.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_time.c head/sys/kern/subr_clock.c head/sys/sys/clock.h Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Tue Mar 12 02:52:22 2019 (r345048) +++ head/sys/amd64/linux32/linux32_machdep.c Tue Mar 12 04:49:47 2019 (r345049) @@ -674,8 +674,8 @@ linux_gettimeofday(struct thread *td, struct linux_get error = copyout(&atv32, uap->tp, sizeof(atv32)); } if (error == 0 && uap->tzp != NULL) { - rtz.tz_minuteswest = tz_minuteswest; - rtz.tz_dsttime = tz_dsttime; + rtz.tz_minuteswest = 0; + rtz.tz_dsttime = 0; error = copyout(&rtz, uap->tzp, sizeof(rtz)); } return (error); Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Mar 12 02:52:22 2019 (r345048) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Mar 12 04:49:47 2019 (r345049) @@ -834,8 +834,8 @@ freebsd32_gettimeofday(struct thread *td, error = copyout(&atv32, uap->tp, sizeof (atv32)); } if (error == 0 && uap->tzp != NULL) { - rtz.tz_minuteswest = tz_minuteswest; - rtz.tz_dsttime = tz_dsttime; + rtz.tz_minuteswest = 0; + rtz.tz_dsttime = 0; error = copyout(&rtz, uap->tzp, sizeof (rtz)); } return (error); Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Tue Mar 12 02:52:22 2019 (r345048) +++ head/sys/kern/kern_time.c Tue Mar 12 04:49:47 2019 (r345049) @@ -660,8 +660,8 @@ sys_gettimeofday(struct thread *td, struct gettimeofda error = copyout(&atv, uap->tp, sizeof (atv)); } if (error == 0 && uap->tzp != NULL) { - rtz.tz_minuteswest = tz_minuteswest; - rtz.tz_dsttime = tz_dsttime; + rtz.tz_minuteswest = 0; + rtz.tz_dsttime = 0; error = copyout(&rtz, uap->tzp, sizeof (rtz)); } return (error); @@ -712,10 +712,6 @@ kern_settimeofday(struct thread *td, struct timeval *t tv->tv_sec < 0) return (EINVAL); error = settime(td, tv); - } - if (tzp && error == 0) { - tz_minuteswest = tzp->tz_minuteswest; - tz_dsttime = tzp->tz_dsttime; } return (error); } Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Tue Mar 12 02:52:22 2019 (r345048) +++ head/sys/kern/subr_clock.c Tue Mar 12 04:49:47 2019 (r345049) @@ -52,9 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -int tz_minuteswest; -int tz_dsttime; - /* * The adjkerntz and wall_cmos_clock sysctls are in the "machdep" sysctl * namespace because they were misplaced there originally. @@ -386,5 +383,5 @@ int utc_offset(void) { - return (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0)); + return (wall_cmos_clock ? adjkerntz : 0); } Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Tue Mar 12 02:52:22 2019 (r345048) +++ head/sys/sys/clock.h Tue Mar 12 04:49:47 2019 (r345049) @@ -51,12 +51,6 @@ #ifdef _KERNEL /* No user serviceable parts */ -/* - * Timezone info from settimeofday(2), usually not used - */ -extern int tz_minuteswest; -extern int tz_dsttime; - int utc_offset(void); /*