Mercurial > dovecot > core-2.2
view src/lib/rand.h @ 19604:c996bc091c6b
master: Do not close stdout if going foreground
This lets one to use /dev/stdout for logging. Mainly
useful for testing purposes where we can generate
log output to stdout and use tee to write it to a
file for later examination.
author | Aki Tuomi <aki.tuomi@dovecot.fi> |
---|---|
date | Mon, 18 Jan 2016 15:50:23 +0200 |
parents | f9deece0002f |
children |
line wrap: on
line source
#ifndef RAND_H #define RAND_H /* Wrap srand() so that we can reproduce fuzzed tests */ /* If we have seeded the prng precisely once, and we remember what * value that was with, then we can reproduce any failing test cases * that depend on that randomness by forcing the seed value (e.g. * in a debugger, by putting a breakpoint on rand_set_seed()). */ /* Number of times we've been seeded */ int rand_get_seed_count(void); /* That last seed */ unsigned int rand_get_last_seed(void); /* Actually seed the prng (could add char* for name of function?) */ void rand_set_seed(unsigned int s); #endif