Page MenuHomeFreeBSD

timezone: Move to the XSI/POSIX definition for timezone.
ClosedPublic

Authored by imp on Mar 8 2024, 6:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 12:08 AM
Unknown Object (File)
Fri, Nov 8, 12:05 AM
Unknown Object (File)
Oct 4 2024, 9:56 PM
Unknown Object (File)
Oct 4 2024, 9:48 PM
Unknown Object (File)
Sep 26 2024, 2:35 AM
Unknown Object (File)
Sep 26 2024, 2:34 AM
Unknown Object (File)
Sep 26 2024, 2:34 AM
Unknown Object (File)
Sep 26 2024, 2:34 AM
Subscribers
None

Details

Summary

The old timezone(3) function has long since been obsolete and has a
fatally flawed interface. Retain this function for compatibility
purposes, but shift to providing the offset from UTC in the timezone
variable, whether or not the timezone observes summer time in the
'daylight' variable. Document the tzname variable that's already been
set. Also make _tztab() static. It's not used in libc (or anywhere in
the tree) and it's not exported as a public dynamic symbol.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Mar 8 2024, 6:11 PM
imp created this revision.
lib/libc/gen/Symbol.map
461

Should these go in lib/libc/stdtime/Symbol.map along with tzname since the definitions all come from contrib/tzcode/localtime.c?

lib/libc/gen/tzset.3
36

Should there be an MLINK for discoverability?

imp marked 2 inline comments as done.Mar 11 2024, 9:34 PM
imp added inline comments.
lib/libc/gen/Symbol.map
461

Yes. Done.

lib/libc/gen/tzset.3
36

Good idea.

imp marked 2 inline comments as done.Mar 11 2024, 9:35 PM

So I don't think I need timezone.3 in the old files stuff...

In D44281#1010587, @imp wrote:

So I don't think I need timezone.3 in the old files stuff...

Yeah, MLINK means you don't need it.

This whole interface is a bit pre-threading, but it is what it is...

lib/libc/gen/Makefile.inc
538

Maybe move to libc/stdtime/Makefile.inc? (Sorry I didn't mention this before.)

This revision is now accepted and ready to land.Mar 11 2024, 10:24 PM
lib/libc/gen/Makefile.inc
538

So tzset.3 is already is already in gen/Makefile.inc. Are you suggesting I remove it from there and move it to stdtime/Makefile.inc?

lib/libc/gen/Makefile.inc
538

Oh, I got confused because the implementation is in localtime.c now. I think that tzset.3 should likely to in stdtime since localtime.c is listed there, but leaving things alone or making a separate commit would be fine.

lib/libc/gen/Makefile.inc
538

I'll do a second commit that moves it over.