2 typedef int suseconds_t;
33 extern int gettimeofday(struct timeval *tv, struct timezone *tz);
34 function psi\gettimeofday(array &$tv = NULL, array &$tz = NULL) : int {
35 let tv = calloc(1, struct timeval);
36 let tz = calloc(1, struct timezone);
37 return to_int(gettimeofday);
38 set $tv = to_array(*tv);
39 set $tz = to_array(*tz);
42 extern char *asctime(struct tm *tm);
43 function psi\asctime(array $tm = NULL) : string {
45 return to_string(asctime);
49 extern struct tm *gmtime(time_t tp);
50 function psi\gmtime(int $ts) : array {
51 let tp = &intval($ts);
52 return to_array(gmtime);
55 extern int nanosleep(struct timespec *rqtp, struct timespec *rmtp);
56 function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int {
57 let rqtp = arrval($rq);
58 let rmtp = calloc(1, struct timespec);
59 return to_int(nanosleep);
60 set $rm = to_array(*rmtp);