From 11b6ee423e2498f2ce52c165b3db531ce7dedb36 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 2 Dec 2024 08:27:38 +0200 Subject: [PATCH] LibC: Define timezone structure --- userspace/libraries/LibC/include/sys/time.h | 6 ++++++ userspace/libraries/LibC/sys/time.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/userspace/libraries/LibC/include/sys/time.h b/userspace/libraries/LibC/include/sys/time.h index 2508deae..8deb916e 100644 --- a/userspace/libraries/LibC/include/sys/time.h +++ b/userspace/libraries/LibC/include/sys/time.h @@ -22,6 +22,12 @@ struct itimerval #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 +struct timezone +{ + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of DST correction */ +}; + int getitimer(int which, struct itimerval* value); int gettimeofday(struct timeval* __restrict tp, void* __restrict tzp); int setitimer(int which, const struct itimerval* __restrict value, struct itimerval* __restrict ovalue); diff --git a/userspace/libraries/LibC/sys/time.cpp b/userspace/libraries/LibC/sys/time.cpp index 5f14aca3..6cb8ae7b 100644 --- a/userspace/libraries/LibC/sys/time.cpp +++ b/userspace/libraries/LibC/sys/time.cpp @@ -6,7 +6,8 @@ int gettimeofday(struct timeval* __restrict tp, void* __restrict tzp) { // If tzp is not a null pointer, the behavior is unspecified. - (void)tzp; + if (tzp != nullptr) + *static_cast(tzp) = {}; timespec ts; clock_gettime(CLOCK_REALTIME, &ts);