X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=lib%2Frand.h;h=6b9e13c03acd77895d1fbe32e2dd88de10cbfa26;hb=068420271828b3b2426ffc3ccf64404cb9d340fb;hp=363e7b6d9651d5970c9b7b8592f61a9bc0a0962b;hpb=7e744013dca36be3840c45d13f4ae09947282bea;p=fio.git diff --git a/lib/rand.h b/lib/rand.h index 363e7b6d..6b9e13c0 100644 --- a/lib/rand.h +++ b/lib/rand.h @@ -1,12 +1,12 @@ #ifndef FIO_RAND_H #define FIO_RAND_H +#define FRAND_MAX (-1U) + struct frand_state { unsigned int s1, s2, s3; }; -extern struct frand_state __fio_rand_state; - static inline unsigned int __rand(struct frand_state *state) { #define TAUSWORTHE(s,a,b,c,d) ((s&c)<>b) @@ -19,5 +19,8 @@ static inline unsigned int __rand(struct frand_state *state) } extern void init_rand(struct frand_state *); +extern void init_rand_seed(struct frand_state *, unsigned int seed); +extern void __fill_random_buf(void *buf, unsigned int len, unsigned long seed); +extern unsigned long fill_random_buf(struct frand_state *, void *buf, unsigned int len); #endif