/*************
* sleep.c -- provide unix style sleep function
*
*************/
#include <time.h>

int sleep(unsigned secs){
	long	start;
	long	check;
	long	finish;

	time((time_t*)&start);	/* GJM */
	finish = start + (long) secs;
#ifdef DEBUG
	printf ("sleep for %d secs, stop sleeping at %ld\n", secs, finish);
	time((time_t*)&check);	/* GJM */
	printf ("it is now %ld\n", check );
#endif
	for (;;) {
		time((time_t*)&check);	/* GJM */
		if (check > finish)
			break;
	}
	return (0);
}

/* I've put some casts in to pacify the very fussy Acorn compiler
 * -- GJM
 */
