@deftypefun {int} {gnutls_rnd} (gnutls_rnd_level_t @var{level}, void * @var{data}, size_t @var{len}) @var{level}: a security level @var{data}: place to store random bytes @var{len}: The requested size This function will generate random data and store it to output buffer. The value of @code{level} should be one of @code{GNUTLS_RND_NONCE} , @code{GNUTLS_RND_RANDOM} and @code{GNUTLS_RND_KEY} . See the manual and @code{gnutls_rnd_level_t} for detailed information. This function is thread-safe and also fork-safe. @strong{Returns:} Zero on success, or a negative error code on error. @strong{Since:} 2.12.0 @end deftypefun