diff -Naurw lmbench3.orig/run_lmbench lmbench3/run_lmbench
--- lmbench3.orig/run_lmbench	1969-12-31 16:00:00.000000000 -0800
+++ lmbench3/run_lmbench	2012-02-15 17:38:59.361147076 -0800
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+OS='@@OS@@'   # Replaced with BUILD_PLATFORM by Makefile
+export OS     # Needed by scripts
+hostname $OS  # Make sure hostname is sane
+
+# Run from /tmp in case /benchmark/lmbench is read-only.
+# lmbench is not very good about separating RO from RW data.
+if [ ! -d /tmp/lmbench ]; then cp -r /benchmark/lmbench /tmp; fi
+cd /tmp/lmbench/src
+
+# Configure benchmark if it hasn't been done yet.
+if [ ! -f ../bin/$OS/CONFIG.$OS ]; then ../scripts/config-run; fi
+
+# Run the benchmark.
+echo ''; echo "  --- Running lmbench ---"; echo ''
+../scripts/results
+echo ''; echo "  --- lmbench results are in /tmp/lmbench/results ---"; echo ''
diff -Naurw lmbench3.orig/scripts/lmbench lmbench3/scripts/lmbench
--- lmbench3.orig/scripts/lmbench	2005-08-22 17:19:54.000000000 -0700
+++ lmbench3/scripts/lmbench	2012-02-15 17:38:59.362147576 -0800
@@ -101,6 +101,7 @@
 
 echo \[`date`] 1>&2
 echo \[`uptime`] 1>&2
+if netstat -i > /dev/null 2>&1; then
 netstat -i | while read i
 do	echo \[net: "$i"] 1>&2
 	set `echo $i`
@@ -112,6 +113,7 @@
 			;;
 	esac
 done
+fi
 
 mount | while read i
 do	echo \[mount: "$i"] 1>&2
diff -Naurw lmbench3.orig/src/Makefile lmbench3/src/Makefile
--- lmbench3.orig/src/Makefile	2005-08-22 17:19:54.000000000 -0700
+++ lmbench3/src/Makefile	2012-02-15 17:38:59.388160574 -0800
@@ -111,8 +111,8 @@
 	$O/lib_sched.o
 
 lmbench: $(UTILS)
-	@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
-	-@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="-k $(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
+	@env MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
+	-@env MAKE="$(MAKE)" MAKEFLAGS="-k $(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
 
 results: lmbench
 	@env OS="${OS}" ../scripts/config-run
@@ -136,7 +136,7 @@
 	@env OS="${OS}" BENCHMARK_HARDWARE=NO  BENCHMARK_OS=YES ../scripts/results
 
 install: lmbench
-	@env CFLAGS=-O MAKE="$(MAKE)"  MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target
+	@env MAKE="$(MAKE)"  MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target
 
 install-target:
 	if [ ! -d $(BASE) ]; then mkdir $(BASE); fi
@@ -165,10 +165,10 @@
 assembler:
 	@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm
 
-bk.ver: ../SCCS/s.ChangeSet
-	rm -f bk.ver
-	-echo `bk prs -hr+ -d'$$if(:SYMBOL:){:SYMBOL: }:UTC:' ../ChangeSet;` > bk.ver
-	touch bk.ver
+#bk.ver: ../SCCS/s.ChangeSet
+#	rm -f bk.ver
+#	-echo `bk prs -hr+ -d'$$if(:SYMBOL:){:SYMBOL: }:UTC:' ../ChangeSet;` > bk.ver
+#	touch bk.ver
 
 dist: bk.ver
 	@if [ "X`cd ..; bk sfiles -c`" != "X" ]; then \
diff -Naurw lmbench3.orig/src/bk.ver lmbench3/src/bk.ver
--- lmbench3.orig/src/bk.ver	1969-12-31 16:00:00.000000000 -0800
+++ lmbench3/src/bk.ver	2012-02-15 17:38:59.390161577 -0800
@@ -0,0 +1 @@
+ROKU
diff -Naurw lmbench3.orig/src/lat_ops.c lmbench3/src/lat_ops.c
--- lmbench3.orig/src/lat_ops.c	2005-08-22 17:19:54.000000000 -0700
+++ lmbench3/src/lat_ops.c	2012-02-15 17:38:59.393163078 -0800
@@ -87,7 +87,7 @@
 	register int s = (int)iterations;
 
 	while (iterations-- > 0) {
-		HUNDRED(r ^= iterations; s ^= r; r |= s;)
+		HUNDRED(r ^= iterations; r &= s; s |= (int)cookie;)
 	}
 	use_int(r);
 }
@@ -100,7 +100,7 @@
 	register int b = pState->N + 31;
 
 	while (iterations-- > 0) {
-		HUNDRED(a += b; b -= a;)
+		HUNDRED(a += b; b += a;)
 	}
 	use_int(a+b);
 }
@@ -111,11 +111,10 @@
 	struct _state *pState = (struct _state*)cookie;
 	register int r = pState->N + 37431;
 	register int s = pState->N + 4;
-	register int t = r * s * s * s * s * s * s * s * s * s * s - r;
 
 	while (iterations-- > 0) {
-		TEN(r *= s;); r -= t;
-		TEN(r *= s;); r -= t;
+		TEN(r *= s;); s -= iterations;
+		TEN(r *= s;); s -= iterations;
 	}
 	use_int(r);
 }
@@ -155,7 +154,7 @@
 	register int64 i = (int64)iterations<<34 - 1;
 
 	while (iterations-- > 0) {
-		HUNDRED(r ^= i; s ^= r; r |= s;)
+		HUNDRED(r ^= i; r &= s; s |= i;)
 		i--;
 	}
 	use_int((int)r);
@@ -172,7 +171,7 @@
 	b += (int64)(0xFFFE + pState->N)<<29;
 
 	while (iterations-- > 0) {
-		HUNDRED(a += b; b -= a;)
+		HUNDRED(a += b; b += a;)
 	}
 	use_int((int)a+(int)b);
 }
@@ -183,14 +182,12 @@
 	struct _state *pState = (struct _state*)cookie;
 	register int64 r = (int64)pState->N + 37420;
 	register int64 s = (int64)pState->N + 4;
-	register int64 t;
 
 	r += (int64)(pState->N + 6)<<32;
-	t = r * s * s * s * s * s * s * s * s * s * s - r;
 
 	while (iterations-- > 0) {
-		TEN(r *= s;); r -= t;
-		TEN(r *= s;); r -= t;
+		TEN(r *= s;); s -= iterations;
+		TEN(r *= s;); s -= iterations;
 	}
 	use_int((int)r);
 }
diff -Naurw lmbench3.orig/src/memsize.c lmbench3/src/memsize.c
--- lmbench3.orig/src/memsize.c	2005-08-22 17:19:55.000000000 -0700
+++ lmbench3/src/memsize.c	2012-02-15 17:42:49.543181021 -0800
@@ -15,7 +15,7 @@
 #define	CHK(x)	if ((x) == -1) { perror("x"); exit(1); }
 
 #ifndef	TOO_LONG
-#define	TOO_LONG	10	/* usecs */
+#define	TOO_LONG	25	/* usecs */
 #endif
 
 int	alarm_triggered = 0;
