barebox/include/stdlib.h
Antony Pavlov 03c0e1511e stdlib.h: include missed types.h
We use 'u32' type in stdlib.h so we have to include types.h.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-07 08:23:08 +02:00

27 lines
439 B
C

#ifndef __STDLIB_H
#define __STDLIB_H
#include <types.h>
#define RAND_MAX 32767
/* return a pseudo-random integer in the range [0, RAND_MAX] */
unsigned int rand(void);
/* set the seed for rand () */
void srand(unsigned int seed);
/* fill a buffer with pseudo-random data */
void get_random_bytes(void *buf, int len);
static inline u32 random32(void)
{
u32 ret;
get_random_bytes(&ret, 4);
return ret;
}
#endif /* __STDLIB_H */