diff -urN a/tcsim/klink.c b/tcsim/klink.c
--- a/tcsim/klink.c	2002-10-11 00:38:29.000000000 +0200
+++ b/tcsim/klink.c	2004-01-24 04:33:02.000000000 +0100
@@ -316,5 +316,11 @@
 {
     extern double tick_in_usec;
 
+#if PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES
     tick_in_usec = (HZ << PSCHED_JSCALE)/1000000.0;
+#elif PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+    tick_in_usec = 1;
+#else
+#error "Invalid PSCHED_CLOCK_SOURCE"
+#endif
 }
diff -urN a/tcsim/setup.klib b/tcsim/setup.klib
--- a/tcsim/setup.klib	2003-11-22 10:44:20.000000000 +0100
+++ b/tcsim/setup.klib	2004-01-24 04:35:08.000000000 +0100
@@ -44,9 +44,11 @@
 fi
 if [ -r $KSRC/net/sched/sch_htb.c ]; then
     #
-    # Stop all of sch_htb's timers when the simulation is terminating
+    # Stop all of sch_htb's timers when the simulation is terminating,
+    # turn off debugging (does not compile with PSCHED_GETTIMEOFDAY).
     #
-    sed 's/.*add_timer(&[^)]*);.*/{ extern int terminating; \
+    sed -e 's/.*define HTB_DEBUG.*//' \
+        -e 's/.*add_timer(&[^)]*);.*/{ extern int terminating; \
       if (!terminating || sch->q.qlen) & }/' \
       <$KSRC/net/sched/sch_htb.c >sch_htb.c
 else
