Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 12916 - Incorrect clock ticks per second value
Summary: Incorrect clock ticks per second value
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Brandon Low (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-29 16:06 UTC by Vladimir Sekissov
Modified: 2002-12-31 13:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Sekissov 2002-12-29 16:06:56 UTC
The problem is in kernel settings:

sysconfig(_SC_CLK_TCK) reports 100,

but the actual value is equal 1024.

As the result all programs which try to make decision about time correction
could work incorrectly (ogle, xine and other soft realtime programs). 
For example the short program at the end of this letter returns on my system:

clocks: 100
times1:1280320765
1 sec pause
times2:1280321790

(times1 - times2) must be near clocks value, but:
1280321790-1280320765=1025

#include <stdio.h>
#include <sys/times.h>
#include <unistd.h>

struct tms dummy_tms;

int main (int argc, char *argv[]) {

printf("clocks: %li\n", sysconf(_SC_CLK_TCK));
printf("times1: %li\n", times(&dummy_tms));
 sleep(1);
printf("1 sec pause\n");
printf("times2: %li\n", times(&dummy_tms));

}
Comment 1 Brandon Low (RETIRED) gentoo-dev 2002-12-31 13:21:40 UTC
known problem in current gentoo-sources, I just tested on current lolo-sources
and it werks tasty fine, and so will work tasty fine on the next gentoo-sources.