diff --git a/sources/system/unix-date-interface.dylan b/sources/system/unix-date-interface.dylan index 6ecefeb146..b0ff367a7c 100644 --- a/sources/system/unix-date-interface.dylan +++ b/sources/system/unix-date-interface.dylan @@ -109,7 +109,7 @@ define method native-clock-to-tm (time :: ) => (tm :: ) => (tm :: ) (primitive-cast-raw-as-pointer(primitive-unwrap-machine-word(timeloc))) end)); diff --git a/sources/system/unix-portability.c b/sources/system/unix-portability.c index 9cfda12bb9..d423d8c1f8 100644 --- a/sources/system/unix-portability.c +++ b/sources/system/unix-portability.c @@ -2,6 +2,7 @@ #include #include #include +#include #ifdef __APPLE__ #include @@ -15,6 +16,12 @@ char **system_environ(void) return environ; } +struct tm *system_localtime(const time_t *timep) +{ + struct tm *res = GC_malloc(sizeof(struct tm)); + return localtime_r(timep, res); +} + /* Adapted from the SBCL run-time system, which in turn is derived * from the CMU CL system, which was written at Carnegie Mellon * University and released into the public domain.