view src/lib/randgen.h @ 9191:b340ecb24469 HEAD

Fix VPATH build of RQUOTA support. Some rpcgen derive #include "..." paths from the infile argument. This will be off for VPATH builds, as the generated rquota_xdr.c code will look in $(srcdir), but we'll generate the rquota.h file in $(builddir). Play safe and copy rquota.x to $(builddir) first. This fixes the build on openSUSE 11.1.
author Matthias Andree <>
date Tue, 07 Jul 2009 21:01:36 +0200
parents e4eb71ae8e96
line wrap: on
line source

#ifndef RANDGEN_H
#define RANDGEN_H

/* Fill given buffer with semi-strong randomness, usually from /dev/urandom. */
void random_fill(void *buf, size_t size);
/* Fill given buffer with weak randomness, ie. with rand(). This is better if
   no real randomness is required, as reading from /dev/urandom usually also
   consumes /dev/random entropy, which may disturb other processes. */
void random_fill_weak(void *buf, size_t size);

/* may be called multiple times */
void random_init(void);
void random_deinit(void);