1 extern int gettimeofday(struct timeval *tv, struct timezone *tz);
2 function psi\gettimeofday(array &$tv = NULL, array &$tz = NULL) : int {
3 let tv = calloc(1, struct timeval);
4 let tz = calloc(1, struct timezone);
5 return to_int(gettimeofday);
6 set $tv = to_array(*tv,
9 set $tz = to_array(*tz,
10 to_int(tz_minuteswest),
14 extern char *asctime(struct tm *tm);
15 function psi\asctime(array $tm = NULL) : string {
17 return to_string(asctime);
20 extern char *asctime_r(struct tm *tm, char *buf);
21 function psi\asctime_r(array $tm = NULL) : string {
23 let buf = calloc(32, char);
24 return to_string(asctime_r);
27 extern struct tm *gmtime(time_t *tp);
28 function psi\gmtime(int $ts) : array {
29 let tp = &intval($ts);
30 return to_array(*gmtime,
43 extern struct tm *gmtime_r(time_t *tp, struct tm *buf);
44 function psi\gmtime_r(int $ts) : array {
45 let tp = &intval($ts);
46 let buf = calloc(1, struct tm);
47 return to_array(*gmtime_r,
60 extern int nanosleep(struct timespec *rqtp, struct timespec *rmtp);
61 function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int {
62 let rqtp = arrval($rq);
63 let rmtp = calloc(1, struct timespec);
64 return to_int(nanosleep);
65 set $rm = to_array(*rmtp,
71 extern clock_t times(struct tms *buf);
72 function psi\times(array &$tms = NULL) : int {
73 let buf = calloc(1, struct tms);
75 set $tms = to_array(*buf,