From: Pu, L. <lo...@in...> - 2004-11-22 02:47:57
|
In ltp-20041007, settimeofday01 fails on some platforms(ia64, x86-64) occasionally. Here is the cause: The testcase did not consider the situation when CONFIG_TIME_INTERPOLATION is enabled. When CONFIG_TIME_INTERPOLATION is enabled, kernel dose not update the xtime to what you specify exactly. Instead, It subtracts time_interpolator_get_offset() nanoseconds from the time you specify and then updates xtime. An immediate gettimeofday() after a settimeofday() will return you an earlier time than you specify via settimeofday() in most cases if CONFIG_TIME_INTERPOLATION is enable. The test case just uses settimeofday() to set time to a certain timeval and then uses gettimeofday() to get back a timeval structure immediately to see if two tv_sec in timeval structures are equal. I attached my patch. Pu Long |