[tz] Deprecating tzsetwall

Guy Harris guy at alum.mit.edu
Wed Apr 22 02:19:04 UTC 2020


On Apr 21, 2020, at 5:30 PM, Paul Eggert <eggert at cs.ucla.edu> wrote:

> In reviewing the tzdb web pages for bad links and suchlike, I noticed that they're still talking about UNIX SVR2 (superseded since 1988) and tzsetwall. So I looked into tzcode's implementation of tzsetwall, and noticed that it does nothing useful because functions like localtime now call tzset (as POSIX has require for many years), thus undoing tzsetwall's effect.
> 
> Since nobody evidently cares whether tzsetwall works, we should remove it.

In practice, it probably won't break anything, but at least one OS *does* document it:

	$ man tzsetwall
	TZSET(3)                 BSD Library Functions Manual                 TZSET(3)

	NAME
	     tzset, tzsetwall -- initialize time conversion information

	LIBRARY
	     Standard C Library (libc, -lc)

	SYNOPSIS
	     #include <time.h>

	     void
	     tzset(void);

	     void
	     tzsetwall(void);

		...

	     The tzsetwall() function sets things up so that localtime returns the
	     best available approximation of local wall clock time.

		...

	$ sw_vers
	ProductName:    Mac OS X
	ProductVersion: 10.15.4
	BuildVersion:   19E287

and that OS *does* attempt to provide at least some level of release-to-release binary compatibility (the main forms of binary incompatibility are "we no longer support that instruction set", e.g. PowerPC and 32-bit x86).

But they may be able to mark it as deprecated (provoking compiler warnings) and kill it eventually.


More information about the tz mailing list