dorcsssc Posted March 1, 2013 Share Posted March 1, 2013 I've just proven that the .tv_sec field of a increments by *10* every second on a PPMAC. Here's the code: struct timespec itval; itval.tv_sec = 42; // Just to verify value is being loaded. while (1) { if (clock_gettime(CLOCK_REALTIME, &itval) < 0) fprintf(stderr, "clock_gettime() barfed, code %d.\n", errno); else fprintf(stderr, "itval.tv_sec = %ul.\n", itval.tv_sec); sleep(1); } Both the range of the number (only a few hundred thousand - no even close to the 1970 epoch) and interval (10) are wrong? What's going on here? Has Xenomai monkeyd around with clock_gettime()? Link to comment Share on other sites More sharing options...
dorcsssc Posted March 1, 2013 Author Share Posted March 1, 2013 Wait - - interval looks wrong due simply to using "%ul" instead of "%lu" in the format statement. So the lower-case 'l' suffix looks like an extra '1' digit, suggestings a number an order of magnitude larger. Oops. Our system fixed fonts are also partly to blame. OK, so that accounts for the interval. Good. Now what about the offset value, though. Why a "realtime" value of only ~22,000? Link to comment Share on other sites More sharing options...
Recommended Posts