add simple srandom() and prototype

This commit is contained in:
Peter Wemm 1996-09-23 04:31:43 +00:00
parent 6f78ed368c
commit 840a0352e9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18474
2 changed files with 12 additions and 3 deletions

View File

@ -31,11 +31,20 @@
* SUCH DAMAGE.
*
* @(#)random.c 8.1 (Berkeley) 6/10/93
* $Id: random.c,v 1.2 1994/08/02 07:44:23 davidg Exp $
* $Id: random.c,v 1.3 1995/03/17 06:15:39 phk Exp $
*/
#include <sys/libkern.h>
static u_long randseed = 1;
void
srandom(seed)
u_long seed;
{
randseed = seed;
}
/*
* Pseudo-random number generator for randomizing the profiling clock,
* and whatever else we might use it for. The result is uniform on
@ -44,7 +53,6 @@
u_long
random()
{
static u_long randseed = 1;
register long x, hi, lo, t;
/*

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)libkern.h 8.1 (Berkeley) 6/10/93
* $Id: libkern.h,v 1.12 1996/08/01 20:31:45 wollman Exp $
* $Id: libkern.h,v 1.13 1996/08/31 16:52:44 bde Exp $
*/
#ifndef _SYS_LIBKERN_H_
@ -76,6 +76,7 @@ char *index __P((const char *, int));
char *rindex __P((const char *, int));
int scanc __P((u_int, const u_char *, const u_char *, int));
int skpc __P((int, int, char *));
void srandom __P((u_long));
char *strcat __P((char *, const char *));
int strcmp __P((const char *, const char *));
char *strcpy __P((char *, const char *));