From 3dddf602dd95863dab344486534874b4b561bd3d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 1 Jun 1999 14:08:57 +0000 Subject: See ChangeLog: Tue Jun 1 16:01:46 CEST 1999 Werner Koch --- cipher/rndlinux.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'cipher/rndlinux.c') diff --git a/cipher/rndlinux.c b/cipher/rndlinux.c index 8c591fbe8..78fee1567 100644 --- a/cipher/rndlinux.c +++ b/cipher/rndlinux.c @@ -33,6 +33,13 @@ #include #include #include +#if 0 + #ifdef HAVE_LINUX_RANDOM_H + #include + #include + #include + #endif +#endif #include "types.h" #include "util.h" #include "ttyio.h" @@ -48,6 +55,19 @@ static int open_device( const char *name, int minor ); static int gather_random( void (*add)(const void*, size_t, int), int requester, size_t length, int level ); +#if 0 +#ifdef HAVE_DEV_RANDOM_IOCTL +static ulong +get_entropy_count( int fd ) +{ + ulong count; + + if( ioctl( fd, RNDGETENTCNT, &count ) == -1 ) + g10_log_fatal("ioctl(RNDGETENTCNT) failed: %s\n", strerror(errno) ); + return count; +} +#endif +#endif /**************** * Used to open the Linux and xBSD /dev/random devices @@ -91,6 +111,11 @@ gather_random( void (*add)(const void*, size_t, int), int requester, fd = fd_urandom; } + #if 0 + #ifdef HAVE_DEV_RANDOM_IOCTL + g10_log_info("entropy count of %d is %lu\n", fd, get_entropy_count(fd) ); + #endif + #endif while( length ) { fd_set rfds; struct timeval tv; -- cgit v1.2.3