X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=psi.d%2Ftime.psi;h=9bf08515a1a3fccb4ed3d09f62025720a2098030;hb=0682ecb84dfe1de08b609c6c0ae641b06f3fa481;hp=716e17610bd5b8613671417d488018c6c1ec8685;hpb=fecb0372ee8e219a7ebd51406dee3e1008ccb7ec;p=m6w6%2Fext-psi diff --git a/psi.d/time.psi b/psi.d/time.psi index 716e176..9bf0851 100644 --- a/psi.d/time.psi +++ b/psi.d/time.psi @@ -1,5 +1,5 @@ -#ifdef linux /* old, anyway */ -lib "rt"; +#ifdef __linux__ /* old, anyway */ +#pragma lib "rt" #endif #include @@ -13,16 +13,13 @@ function psi\time() : int { } // extern int gettimeofday(struct timeval *tp, struct timezone *tz); -function psi\gettimeofday(array &$tv = NULL, array &$tz = NULL) : int { +function psi\gettimeofday(array &$tv = NULL) : int { let tp = calloc(1, sizeof(struct timeval)); - let tz = calloc(1, sizeof(struct timezone)); + let tz = NULL; return gettimeofday(tp, tz) as to_int(gettimeofday); set $tv = to_array(*tp, to_int(tv_sec), to_int(tv_usec)); - set $tz = to_array(*tz, - to_int(tz_minuteswest), - to_int(tz_dsttime)); } // extern char *asctime(struct tm *tm); @@ -124,5 +121,5 @@ function psi\tzset() : void { } function psi\tzname() : array { - return tzname_get() as to_array(tzname_get, 2, to_string(*tzname_get)); + return tzname_get() as to_array(*tzname_get, 2, to_string(*tzname_get)); }