[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Questions about cdrtools-2.01a33



So what's wrong with asking OS, e.g. with sysconf(_SC_CLK_TCK)? A.

In first place : i did not know about _SC_CLK_TCK but second : it returns 100 within the adjtimex(2) application where this
value is clearly wrong.

No, it's not. At least SG interface expects 100 [on IA-32] and explicitly scales it to 1000 for internal purposes. Note that the fact that it expect 100 on IA-32 doesn't mean that it expects 100 on all platforms. On Alpha for example HZ exposed to user-land is 1024.

In my system's  /usr/include/asm/param.h  i read :

#ifdef __KERNEL__
# define HZ             1000            /* Internal kernel timer frequency */
# define USER_HZ        100             /* .. some user interfaces are in
"ticks" */
# define CLOCKS_PER_SEC (USER_HZ)       /* like times() */
#endif

#ifndef HZ
#define HZ 100
#endif

My current assumption is that cdrecord would prefer the kernel oriented value
of 1000.

Computing is pretty much about perfection. Application don't "prefer" so to say nor have luxury to. User-land application should stick to whatever kernel expect them to stick to. Period. And IA-32 kernel expects USER_HZ or 100. Of course it's no quarantee that kernel treat the values expressed in HZ correctly (e.g. 2.5 didn't), but it doesn't make it matter of "preference":-) Cheers. A.



Reply to: