Bug 200447 - SC_CLK_TCK not defined on IA64
SC_CLK_TCK not defined on IA64
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc-kernheaders (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: David Woodhouse
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2006-07-27 14:50 EDT by Mike Gahagan
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-09-28 17:10:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mike Gahagan 2006-07-27 14:50:09 EDT
Description of problem:
SC_CLK_TCK not defined on IA64, causing builds to fail

Version-Release number of selected component (if applicable):
kernel 2.6.9-42.EL

How reproducible:


Steps to Reproduce:
1.try to build ttcp-1.12
2. Get error message below
Actual results:
make[1]: Entering directory `/usr/src/redhat/BUILD/stress-kernel/ttcp-1.12'
gcc -O2  -funroll-loops -o ttcp ttcp.c
ttcp.c: In function `main':
ttcp.c:271: warning: cast from pointer to integer of different size
ttcp.c: In function `getrusage':
ttcp.c:532: error: `_SC_CLK_TCK' undeclared (first use in this function)
ttcp.c:532: error: (Each undeclared identifier is reported only once
ttcp.c:532: error: for each function it appears in.)
make[1]: *** [ttcp] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/stress-kernel/ttcp-1.12'
error: Bad exit status from /var/tmp/rpm-tmp.71190 (%build)

Expected results:
Build completes, ttcp builds on all other arch's

Additional info:

Patch created by Joshua Giles that fixes the problem:
--- param.h.orig        2006-07-27 08:31:05.000000000 -0400
+++ param.h     2006-07-27 08:30:46.000000000 -0400
@@ -8,8 +8,11 @@
  * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>

-# define HZ    sysconf(_SC_CLK_TCK)
+#include <unistd.h>

+#ifndef HZ
+#define HZ     sysconf(_SC_CLK_TCK)

 #define EXEC_PAGESIZE  65536
Comment 2 David Woodhouse 2006-09-28 17:10:46 EDT
Userspace must not poke in private kernel headers -- ttcp is broken.

If you want sysconf(_SC_CLK_TCK) then use it properly. The man page for
sysconf(3) tells you to include unistd.h.

We _could_ add the #include <unistd.h> to accommodate one set of broken users,
but that would probably break another set of broken users. It's best just to
leave it as it is. HZ is not a documented interface. You'll get away with
abusing it for now if you include unistd.h for yourself, but don't count on it

Note You need to log in before you can comment on or make changes to this bug.