Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102832297
D38445.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38445.diff
View Options
diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c
--- a/contrib/tzcode/localtime.c
+++ b/contrib/tzcode/localtime.c
@@ -1517,9 +1517,8 @@
}
static void
-tzset_unlocked(void)
+tzset_unlocked_name(char const *name)
{
- char const *name = getenv("TZ");
struct state *sp = lclptr;
int lcl = name ? strlen(name) < sizeof lcl_TZname : -1;
if (lcl < 0
@@ -1541,6 +1540,12 @@
lcl_is_set = lcl;
}
+static void
+tzset_unlocked(void)
+{
+ tzset_unlocked_name(getenv("TZ"));
+}
+
void
tzset(void)
{
@@ -1550,6 +1555,18 @@
unlock();
}
+void
+freebsd13_tzsetwall(void)
+{
+ if (lock() != 0)
+ return;
+ tzset_unlocked_name(NULL);
+ unlock();
+}
+__sym_compat(tzsetwall, freebsd13_tzsetwall, FBSD_1.0);
+__warn_references(tzsetwall,
+ "warning: tzsetwall() is deprecated, use tzset() instead.");
+
static void
gmtcheck(void)
{
diff --git a/lib/libc/gen/tzset.3 b/lib/libc/gen/tzset.3
--- a/lib/libc/gen/tzset.3
+++ b/lib/libc/gen/tzset.3
@@ -31,7 +31,7 @@
.\" @(#)tzset.3 8.2 (Berkeley) 11/17/93
.\" $FreeBSD$
.\"
-.Dd November 17, 1993
+.Dd February 8, 2023
.Dt TZSET 3
.Os
.Sh NAME
@@ -102,10 +102,14 @@
.Pp
The
.Fn tzsetwall
-function
-sets things up so that
-.Xr localtime 3
-returns the best available approximation of local wall clock time.
+function is equivalent to calling
+.Fn tzset
+with the
+.Ev TZ
+environment variable unset.
+It is deprecated and may not be available in
+.Fx 14.0
+and later.
.Sh SPECIFICATION FORMAT
When
.Ev TZ
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 6:20 PM (21 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14702507
Default Alt Text
D38445.diff (1 KB)
Attached To
Mode
D38445: tzcode: Resurrect tzsetwall(3) with a deprecation warning.
Attached
Detach File
Event Timeline
Log In to Comment