This is an archive of the discontinued LLVM Phabricator instance.

[libc] Introduces localtime to LLVM libc, based on C99/C2X/Single Unix Sp.
Needs ReviewPublic

Authored by rtenneti on Dec 21 2022, 5:35 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This change doesn't handle TIMEZONE, tm_isdst and leap seconds.

localtime and gmtime share the same common code. They call update_from_seconds.
Thus added only validation tests for localtime.

Diff Detail

Event Timeline

rtenneti created this revision.Dec 21 2022, 5:35 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 21 2022, 5:35 PM
rtenneti requested review of this revision.Dec 21 2022, 5:35 PM

I don't think landing this without it having any way of displaying a different time than gmtime is a good idea. Happily, I started working on the TZ patch again, so this might be good to land early in the year.

Thanks Jeff. I have taken this CL off of reviewers.

rtenneti updated this revision to Diff 484918.Dec 22 2022, 11:50 AM

Added locatime_r function and its tests.