Bug 200447 - SC_CLK_TCK not defined on IA64
Summary: SC_CLK_TCK not defined on IA64
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc-kernheaders
Version: 4.0
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: David Woodhouse
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-27 18:50 UTC by Mike Gahagan
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-28 21:10:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mike Gahagan 2006-07-27 18:50:09 UTC
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
glibc-kernheaders-2.4-9.1.98

How reproducible:

always

Steps to Reproduce:
1.try to build ttcp-1.12
2. Get error message below
3.
  
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.com>
  */

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

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

 #define EXEC_PAGESIZE  65536

Comment 2 David Woodhouse 2006-09-28 21:10:46 UTC
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
lasting.


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