From e0d589c074de2d6c9d139fd4cafb3c2d4baf034f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 19 Feb 2020 23:09:37 +0100 Subject: [PATCH] LibC: Add hack implementation of gmtime_r() matching gmtime() --- Libraries/LibC/time.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Libraries/LibC/time.cpp b/Libraries/LibC/time.cpp index e56a77c3b7..0594695601 100644 --- a/Libraries/LibC/time.cpp +++ b/Libraries/LibC/time.cpp @@ -127,6 +127,12 @@ struct tm* gmtime(const time_t* t) return localtime(t); } +struct tm* gmtime_r(const time_t* t, struct tm* tm) +{ + // FIXME: This is obviously not correct. What about timezones bro? + return localtime_r(t, tm); +} + char* asctime(const struct tm*) { ASSERT_NOT_REACHED(); @@ -174,11 +180,6 @@ int clock_getres(clockid_t, struct timespec*) ASSERT_NOT_REACHED(); } -struct tm* gmtime_r(const time_t*, struct tm*) -{ - ASSERT_NOT_REACHED(); -} - struct tm* localtime_r(const time_t* t, struct tm* tm) { time_to_tm(tm, *t);