Patch for OFED-1.2 build on OpenSUSE 10 with a nice updated kernel

Tracking this one down was fun. It turns out someone, either in SuSE-land or Linux-land, has decided that HZ is a dangerous macro to expose to users.

Dangerous. Therefore, they wrap it in a kernel cloak. Which has the net effect of breaking large swaths of code which happen to use the quite innocuous HZ macro.

Grrrrrr.

digging through and dereferencing all the included header files I found this …


#ifndef _ASMx86_64_PARAM_H
#define _ASMx86_64_PARAM_H

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

Cool … NOT!!!!

The “solution” to this manufactured problem is to replace the use of the HZ macro with a function call sysconf(_SC_CLK_TCK)

Maybe a simpler patch would be using -DHZ=sysconf(_SC_CLK_TCK)

Well, the “patch” worked, though now it dies in srp, with the same problem.

Grrrrrrrrr

Viewed 6118 times by 1115 viewers

Facebooktwittergoogle_plusredditpinterestlinkedinmail