Back to index

lightning-sunbird  0.9+nobinonly
Functions
brng.c File Reference
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <assert.h>
#include <time.h>
#include "primpl.h"

Go to the source code of this file.

Functions

PRSize _PR_MD_GetRandomNoise (void *buf, PRSize size)

Function Documentation

PRSize _PR_MD_GetRandomNoise ( void buf,
PRSize  size 
)

Definition at line 52 of file brng.c.

{
    struct timeval tv;
    int n = 0;
    int s;

    GETTIMEOFDAY(&tv);

    if ( size >= 0 ) {
        s = _pr_CopyLowBits((char*)buf+n, size, &tv.tv_usec, sizeof(tv.tv_usec));
        size -= s;
        n += s;
    }
    if ( size >= 0 ) {
        s = _pr_CopyLowBits((char*)buf+n, size, &tv.tv_sec, sizeof(tv.tv_usec));
        size -= s;
        n += s;
    }

    return n;
} /* end _PR_MD_GetRandomNoise() */

Here is the call graph for this function: