This is an archive of the discontinued LLVM Phabricator instance.

[libc] cleanup changes to gettimeofday.
ClosedPublic

Authored by rtenneti on Nov 15 2022, 2:20 PM.

Details

Summary

+ Deleted duplicate definitions of StructTimeVal and StructTimeValPtr.
+ Caled syscall clock_gettime to get timespec data.
+ Added tests to test for sleeping 200 and 1000 microseconds.
+ Fixed comments from https://reviews.llvm.org/D137881

Diff Detail

Event Timeline

rtenneti created this revision.Nov 15 2022, 2:20 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 15 2022, 2:20 PM
rtenneti requested review of this revision.Nov 15 2022, 2:20 PM
sivachandra accepted this revision.Nov 15 2022, 3:00 PM
sivachandra added inline comments.
libc/src/time/gettimeofday.cpp
26

Nit: You can avoid the clockid var and just use long(CLOCK_REALTIME) here.

This revision is now accepted and ready to land.Nov 15 2022, 3:00 PM
This revision was automatically updated to reflect the committed changes.