Index: src/tests/boundedBuffer.c
===================================================================
--- src/tests/boundedBuffer.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/boundedBuffer.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -8,13 +8,13 @@
 // Created On       : Mon Oct 30 12:45:13 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Oct 30 18:00:10 2017
-// Update Count     : 7
+// Last Modified On : Mon Oct 30 23:02:46 2017
+// Update Count     : 9
 // 
 
 #include <stdlib>
-#include <fstream>
+#include <fstream>										// random
 #include <kernel>
 #include <thread>
-#include <unistd.h>					// getpid
+#include <unistd.h>										// getpid
 
 monitor Buffer {
@@ -52,5 +52,5 @@
 void main( Producer & prod ) {
 	for ( int i = 1; i <= prod.N; i += 1 ) {
-		yield( rand48( 5 ) );
+		yield( random( 5 ) );
 		insert( prod.buffer, 1 );
 	} // for
@@ -69,5 +69,5 @@
 	cons.sum = 0;
 	for ( ;; ) {
-		yield( rand48( 5 ) );
+		yield( random( 5 ) );
 		int item = remove( cons.buffer );
 		if ( item == -1 ) break;				// sentinel ?
@@ -90,6 +90,6 @@
 	processor p;
 
-	//rand48seed( getpid() );
-	rand48seed( 1003 );
+	//random_seed( getpid() );
+	random_seed( 1003 );
 
 	for ( i = 0; i < Cons; i += 1 ) {			// create consumers
Index: src/tests/datingService.c
===================================================================
--- src/tests/datingService.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/datingService.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -9,9 +9,9 @@
 // Created On       : Mon Oct 30 12:56:20 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Oct 30 17:58:41 2017
-// Update Count     : 14
+// Last Modified On : Mon Oct 30 23:02:11 2017
+// Update Count     : 15
 // 
 
-#include <stdlib>										// rand48
+#include <stdlib>										// random
 #include <fstream>
 #include <kernel>
@@ -61,5 +61,5 @@
 
 void main( Girl & g ) {
-	yield( rand48( 100 ) );								// don't all start at the same time
+	yield( random( 100 ) );								// don't all start at the same time
 	unsigned int partner = girl( g.TheExchange, g.id, g.ccode );
 	//sout | "Girl:" | g.id | "is dating Boy at" | partner | "with ccode" | g.ccode | endl;
@@ -79,5 +79,5 @@
 
 void main( Boy & b ) {
-	yield( rand48( 100 ) );								// don't all start at the same time
+	yield( random( 100 ) );								// don't all start at the same time
 	unsigned int partner = boy( b.TheExchange, b.id, b.ccode );
 	//sout | " Boy:" | b.id | "is dating Girl" | partner | "with ccode" | b.ccode | endl;
@@ -96,5 +96,5 @@
 	Boy  *boys[NoOfPairs];
 
-	rand48seed( getpid() );
+	random_seed( getpid() );
 
 	for ( unsigned int i = 0; i < NoOfPairs; i += 1 ) {
Index: src/tests/prodcons.c
===================================================================
--- src/tests/prodcons.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/prodcons.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -10,11 +10,11 @@
 // Created On       : Mon Sep 18 12:23:39 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Oct 30 18:01:19 2017
-// Update Count     : 41
+// Last Modified On : Mon Oct 30 23:06:05 2017
+// Update Count     : 42
 // 
 
 #include <fstream>
 #include <coroutine>
-#include <stdlib>										// rand48
+#include <stdlib>										// random
 #include <unistd.h>										// getpid
 
@@ -30,6 +30,6 @@
 	// 1st resume starts here
 	for ( int i = 0; i < prod.N; i += 1 ) {
-		int p1 = rand48( 100 );
-		int p2 = rand48( 100 );
+		int p1 = random( 100 );
+		int p2 = random( 100 );
 		sout | p1 | " " | p2 | endl;
 		int status = delivery( *prod.c, p1, p2 );
@@ -90,5 +90,5 @@
 	Prod prod;
 	Cons cons = { prod };
-	rand48seed( /* getpid() */ 103 );					// fixed seed for testing
+	random_seed( /* getpid() */ 103 );					// fixed seed for testing
 	start( prod, 5, cons );
 	sout | "main stops" | endl;
Index: src/tests/random.c
===================================================================
--- src/tests/random.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/random.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jul  5 21:29:30 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Jul  6 18:00:29 2016
-// Update Count     : 3
+// Last Modified On : Mon Oct 30 23:06:49 2017
+// Update Count     : 6
 // 
 
@@ -19,27 +19,27 @@
 
 int main() {
-	//rand48seed( getpid() );								// set random seed
-	rand48seed( 1003 );									// fixed seed for repeatable tests
+	//srandom( getpid() );								// set random seed
+	random_seed( 1003 );								// fixed seed for repeatable tests
 
 	// test polymorphic calls to random and stream
-	char c = rand48();
+	char c = random();
 	sout | c | endl;
-	int i = rand48();
+	int i = random();
     sout | i | endl;
-	unsigned int ui = rand48();
+	unsigned int ui = random();
     sout | ui | endl;
-	long int li = rand48();
+	long int li = random();
     sout | li | endl;
-	unsigned long int uli = rand48();
+	unsigned long int uli = random();
     sout | uli | endl;
-    float f = rand48();
+    float f = random();
     sout | f | endl;
-    double d = rand48();
+    double d = random();
     sout | d | endl;
-    float _Complex fc = rand48();
+    float _Complex fc = random();
     sout | fc | endl;
-    double _Complex dc = rand48();
+    double _Complex dc = random();
     sout | dc | endl;
-    long double _Complex ldc = rand48();
+    long double _Complex ldc = random();
     sout | ldc | endl;
 } // main
Index: src/tests/rational.c
===================================================================
--- src/tests/rational.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/rational.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -10,6 +10,6 @@
 // Created On       : Mon Mar 28 08:43:12 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 23 21:40:11 2017
-// Update Count     : 66
+// Last Modified On : Tue Oct 10 23:25:04 2017
+// Update Count     : 67
 //
 
Index: src/tests/sched-ext-barge.c
===================================================================
--- src/tests/sched-ext-barge.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-ext-barge.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -42,9 +42,9 @@
 void main( barger_t & this ) {
 	yield();
-	while( barge( global ) ) { yield(((unsigned)rand48()) % 10); }
+	while( barge( global ) ) { yield(random( 10 )); }
 }
 
 bool do_call( global_t & mutex this ) {
-	yield(((unsigned)rand48()) % 10);
+	yield(random( 10 ));
 	if( this.state != WAITFOR && !this.done && this.started ) {
 		serr | "Barging before caller detected" | endl;
@@ -57,5 +57,5 @@
 thread caller_t {};
 void main( caller_t & this ) {
-	while( do_call(global) ) { yield(((unsigned)rand48()) % 10); }
+	while( do_call(global) ) { yield(random( 10 )); }
 }
 
@@ -63,5 +63,5 @@
 	this.started = true;
 	for( int i = 0; i < N; i++) {
-		yield(((unsigned)rand48()) % 10);
+		yield(random( 10 ));
 		this.state = WAITFOR;
 		waitfor(do_call, this) {
Index: src/tests/sched-ext-dtor.c
===================================================================
--- src/tests/sched-ext-dtor.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-ext-dtor.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -45,5 +45,5 @@
 
 void main( dummy_t & this ) {
-	yield(((unsigned)rand48()) % 10);
+	yield(random( 10 ));
 	set_state( this, MAIN );
 	waitfor( ^?{}, this ) {
@@ -58,5 +58,5 @@
 	for( int i = 0; i < N; i++ ){
 		dummy_t dummy[4];
-		yield( ((unsigned)rand48()) % 100 );
+		yield( random( 100 ) );
 	}
 	sout | "Stopping" | endl;
Index: src/tests/sched-ext-recurse.c
===================================================================
--- src/tests/sched-ext-recurse.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-ext-recurse.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -15,5 +15,5 @@
 static const unsigned long N = 5_000ul;
 
-static inline void rand_yield() { yield(((unsigned)rand48()) % 10); }
+static inline void rand_yield() { yield(random( 10 )); }
 
 enum state_t { FIRST, SECOND, THIRD, LAST, STOP };
@@ -23,5 +23,5 @@
 	for (i = 0; i < 4; i++)
 	{
-		int j = ((unsigned)rand48()) % 4;
+	    int j = random( 4 );
 		enum state_t t = array[j];
 		array[j] = array[i];
@@ -131,5 +131,5 @@
 
 int main() {
-	rand48seed( time(NULL) );
+	random_seed( time(NULL) );
 	sout | "Starting" | endl;
 	{
Index: src/tests/sched-ext-when.c
===================================================================
--- src/tests/sched-ext-when.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-ext-when.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -15,5 +15,5 @@
 static const unsigned long N = 4_998ul;
 
-static inline void rand_yield() { yield(((unsigned)rand48()) % 10); }
+static inline void rand_yield() { yield(random( 10 )); }
 
 monitor global_t {
@@ -77,5 +77,5 @@
 
 int main() {
-	rand48seed( time(NULL) );
+	random_seed( time(NULL) );
 	sout | "Starting" | endl;
 	{
Index: src/tests/sched-ext.c
===================================================================
--- src/tests/sched-ext.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-ext.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -26,8 +26,4 @@
 volatile bool done;
 
-unsigned rand10() {
-	return (unsigned)rand48() % 10;
-}
-
 //----------------------------------------------------------------------------------------------------
 // Acceptor
@@ -36,5 +32,5 @@
 void do_wait( global_t * mutex a ) {
 	sout | "Waiting to accept" | endl;
-	yield( rand10() );
+	yield( random( 10 ) );
 
 	sout | "Accepting" | endl;
@@ -48,5 +44,5 @@
 
 	sout | "Accepted" | endl;
-	yield( rand10() );
+	yield( random( 10 ) );
 }
 
@@ -68,7 +64,7 @@
 void main( Acceptee* this ) {
 	while( !done ) {
-		yield( rand10() );
+		yield( random( 10 ) );
 		do_notify( &globalA );
-		yield( rand10() );
+		yield( random( 10 ) );
 	}
 }
@@ -78,5 +74,5 @@
 int main(int argc, char* argv[]) {
 	done = false;
-	rand48seed( time( NULL ) );
+	random_seed( time( NULL ) );
 	printf("%p\n", &globalA);
 	sout | "Starting" | endl;
Index: src/tests/sched-int-barge.c
===================================================================
--- src/tests/sched-int-barge.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-int-barge.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -64,7 +64,7 @@
 
 	if( action == 0 ) {
-		c.do_signal = max( ((unsigned)rand48()) % 10, 1);
-		c.do_wait1 = ((unsigned)rand48()) % (c.do_signal);
-		c.do_wait2 = ((unsigned)rand48()) % (c.do_signal);
+		c.do_signal = max( random( 10 ), 1);
+		c.do_wait1 = random( c.do_signal );
+		c.do_wait2 = random( c.do_signal );
 
 		if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
@@ -109,5 +109,5 @@
 
 int main(int argc, char* argv[]) {
-	rand48seed(0);
+	random_seed(0);
 	processor p;
 	{
Index: src/tests/sched-int-block.c
===================================================================
--- src/tests/sched-int-block.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-int-block.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -49,5 +49,5 @@
 	wait( &cond, (uintptr_t)this_thread );
 
-	yield( ((unsigned)rand48()) % 10 );
+	yield( random( 10 ) );
 
 	if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) {
@@ -58,5 +58,5 @@
 	a.last_thread = b.last_thread = this_thread;
 
-	yield( ((unsigned)rand48()) % 10 );
+	yield( random( 10 ) );
 }
 
@@ -70,5 +70,5 @@
 //------------------------------------------------------------------------------
 void signal_op( global_data_t & mutex a, global_data_t & mutex b ) {
-	yield( ((unsigned)rand48()) % 10 );
+	yield( random( 10 ) );
 
 	[a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread;
@@ -83,5 +83,5 @@
 		}
 
-		yield( ((unsigned)rand48()) % 10 );
+		yield( random( 10 ) );
 
 		if(a.last_thread != next || b.last_thread != next) {
@@ -118,5 +118,5 @@
 
 int main(int argc, char* argv[]) {
-	rand48seed( time( NULL ) );
+	random_seed( time( NULL ) );
 	done = false;
 	processor p;
Index: src/tests/sched-int-disjoint.c
===================================================================
--- src/tests/sched-int-disjoint.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-int-disjoint.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -88,5 +88,5 @@
 	signal( &cond, a, data );
 
-	yield( (unsigned)rand48() % 10 );
+	yield( random( 10 ) );
 
 	//This is technically a mutual exclusion violation but the mutex monitor protects us
@@ -109,5 +109,5 @@
 // Main loop
 int main(int argc, char* argv[]) {
-	rand48seed( time( NULL ) );
+	random_seed( time( NULL ) );
 	all_done = false;
 	processor p;
Index: src/tests/sched-int-wait.c
===================================================================
--- src/tests/sched-int-wait.c	(revision c59bde69432528e27b27482abf00c0d2c98f6949)
+++ src/tests/sched-int-wait.c	(revision 6c7b1e798248e92edeafe38f86060a72a69e4070)
@@ -62,5 +62,5 @@
 
 	while( waiter_left != 0 ) {
-		unsigned action = (unsigned)rand48() % 4;
+	    unsigned action = random( 4 );
 		switch( action ) {
 			case 0:
@@ -127,5 +127,5 @@
 // Main
 int main(int argc, char* argv[]) {
-	rand48seed( time( NULL ) );
+	random_seed( time( NULL ) );
 	waiter_left = 4;
 	processor p[2];
