this code works on Linux, but not msys2: #include<stdio.h> #include<sys time.h=""> int main() { struct timezone tz; puts("a"); gettimeofday(NULL, &tz); puts("b"); }
I guess the reason would be winsup/cygwin/times.cc extern "C" int gettimeofday (struct timeval *__restrict tv, void *__restrict tzvp) { struct timezone *tz = (struct timezone *) tzvp; static bool tzflag; LONGLONG now = get_clock (CLOCK_REALTIME)->usecs (); tv->tv_sec = now / USPERSEC; tv->tv_usec = now % USPERSEC; If so, the fix should be add if (tv != NULL) I found this issue due to https://github.com/redis/redis/issues/12719</sys></stdio.h> -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple