diff options
author | Werner Koch <[email protected]> | 1999-06-01 14:08:57 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1999-06-01 14:08:57 +0000 |
commit | 3dddf602dd95863dab344486534874b4b561bd3d (patch) | |
tree | 322e4f944eb596a22af9fc4d98f2f000117672a7 /cipher/rndlinux.c | |
parent | See ChangeLog: Mon May 31 19:41:10 CEST 1999 Werner Koch (diff) | |
download | gnupg-3dddf602dd95863dab344486534874b4b561bd3d.tar.gz gnupg-3dddf602dd95863dab344486534874b4b561bd3d.zip |
See ChangeLog: Tue Jun 1 16:01:46 CEST 1999 Werner Koch
Diffstat (limited to 'cipher/rndlinux.c')
-rw-r--r-- | cipher/rndlinux.c | 25 |
1 files changed, 25 insertions, 0 deletions
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 <string.h> #include <unistd.h> #include <fcntl.h> +#if 0 + #ifdef HAVE_LINUX_RANDOM_H + #include <sys/ioctl.h> + #include <asm/types.h> + #include <linux/random.h> + #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; |