Changeset: 3c8b4c3417e6 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3c8b4c3417e6 Modified Files: configure.ag gdk/gdk_system.c testing/Mtest.py.in Branch: default Log Message:
Merge with Dec2016 branch. diffs (88 lines): diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -2561,6 +2561,7 @@ AC_CHECK_FUNCS([\ asctime_r \ backtrace \ cbrt \ + clock_gettime \ ctime_r \ fabsf \ fallocate \ diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -895,16 +895,36 @@ GDKusec(void) return (lng) (((ctr.QuadPart - start.QuadPart) * 1000000) / freq.QuadPart); } #endif +#ifdef HAVE_CLOCK_GETTIME +#if defined(CLOCK_UPTIME_FAST) +#define CLK_ID CLOCK_UPTIME_FAST /* FreeBSD */ +#elif defined(CLOCK_MONOTONIC_COARSE) +#define CLK_ID CLOCK_MONOTONIC_COARSE /* Linux >= 2.6.32 */ +#else +#define CLK_ID CLOCK_MONOTONIC /* Posix (fallback) */ +#endif + { + static struct timespec tsbase; + struct timespec ts; + if (tsbase.tv_sec == 0) { + clock_gettime(CLK_ID, &tsbase); + return tsbase.tv_nsec / 1000; + } + if (clock_gettime(CLK_ID, &ts) == 0) + return (ts.tv_sec - tsbase.tv_sec) * 1000000 + ts.tv_nsec / 1000; + } +#endif #ifdef HAVE_GETTIMEOFDAY { static struct timeval tpbase; /* automatically initialized to 0 */ struct timeval tp; - if (tpbase.tv_sec == 0) + if (tpbase.tv_sec == 0) { gettimeofday(&tpbase, NULL); + return (lng) tpbase.tv_usec; + } gettimeofday(&tp, NULL); - tp.tv_sec -= tpbase.tv_sec; - return (lng) tp.tv_sec * 1000000 + (lng) tp.tv_usec; + return (lng) (tp.tv_sec - tpbase.tv_sec) * 1000000 + (lng) tp.tv_usec; } #else #ifdef HAVE_FTIME @@ -912,11 +932,12 @@ GDKusec(void) static struct timeb tbbase; /* automatically initialized to 0 */ struct timeb tb; - if (tbbase.time == 0) + if (tbbase.time == 0) { ftime(&tbbase); + return (lng) tbbase.millitm * 1000; + } ftime(&tb); - tb.time -= tbbase.time; - return (lng) tb.time * 1000000 + (lng) tb.millitm * 1000; + return (lng) (tb.time - tbbase.time) * 1000000 + (lng) tb.millitm * 1000; } #endif #endif diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -3126,14 +3126,6 @@ def Check(command, input) : STDERR.write("\n") STDERR.flush() #sys.exit(1) - if sys.platform == 'linux2': - proc = process.Popen(['netstat', '-ap'], - stdout = process.PIPE, - stderr = process.PIPE, - universal_newlines = True) - out, err = proc.communicate() - STDERR.write(err) - STDOUT.write(out) if noErr: STDOUT.flush() STDERR.writelines(noErr) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list