]> git.proxmox.com Git - mirror_spl-debian.git/blame - include/spl-random.h
Minor nit, SOLARIS should be SPL
[mirror_spl-debian.git] / include / spl-random.h
CommitLineData
09b414e8 1#ifndef _SPL_RANDOM_H
2#define _SPL_RANDOM_H
f1ca4da6 3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
f1b59d26 8#include <linux/module.h>
f1ca4da6 9#include <linux/random.h>
10
11/* FIXME:
12 * Should add support for blocking in the future to
13 * ensure that proper entopy is collected. ZFS doesn't
14 * use it at the moment so this is good enough for now.
15 * Always will succeed by returning 0.
16 */
17static __inline__ int
18random_get_bytes(uint8_t *ptr, size_t len)
19{
20 BUG_ON(len < 0);
21 get_random_bytes((void *)ptr,(int)len);
22 return 0;
23}
24
25 /* Always will succeed by returning 0. */
26static __inline__ int
27random_get_pseudo_bytes(uint8_t *ptr, size_t len)
28{
29 BUG_ON(len < 0);
30 get_random_bytes((void *)ptr,(int)len);
31 return 0;
32}
33
34#ifdef __cplusplus
35}
36#endif
37
09b414e8 38#endif /* _SPL_RANDOM_H */