Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2023-11-13 21:37:56 +0300
committerCorinna Vinschen <corinna@vinschen.de>2023-11-13 21:50:15 +0300
commite9c4a281e56518a5c62a727068fda02a364d3a52 (patch)
tree6ac1af8925e29625dbf98c29b2529d4ac1c97e26 /winsup
parent06e463223b95ea409543bf945a0eec6249ecaf25 (diff)
Cygwin: random: drop unused function srandomdev()
Also drop includes only required for srandomdev(). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/random.cc45
1 files changed, 0 insertions, 45 deletions
diff --git a/winsup/cygwin/random.cc b/winsup/cygwin/random.cc
index 3c8682e9a..51f5a6e96 100644
--- a/winsup/cygwin/random.cc
+++ b/winsup/cygwin/random.cc
@@ -44,11 +44,7 @@ static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/lib/libc/stdlib/random.c,v 1.25 2007/01/09 00:28:10 imp Exp $");
-#include <sys/time.h> /* for srandomdev() */
-#include <fcntl.h> /* for srandomdev() */
#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h> /* for srandomdev() */
/*
* random.c:
@@ -298,47 +294,6 @@ srandom(unsigned x)
}
/*
- * srandomdev:
- *
- * Many programs choose the seed value in a totally predictable manner.
- * This often causes problems. We seed the generator using the much more
- * secure random(4) interface. Note that this particular seeding
- * procedure can generate states which are impossible to reproduce by
- * calling srandom() with any value, since the succeeding terms in the
- * state buffer are no longer derived from the LC algorithm applied to
- * a fixed seed.
- */
-void
-srandomdev()
-{
- size_t len;
-
- if (rand_type == TYPE_0)
- len = sizeof state[0];
- else
- len = rand_deg * sizeof state[0];
-
- if (getentropy ((void *) state, len)) {
- struct timeval tv;
- unsigned long junk;
-
- gettimeofday(&tv, NULL);
- /* Avoid a compiler warning when we really want to get at the
- junk in an uninitialized variable. */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
- srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec ^ junk);
-#pragma GCC diagnostic pop
- return;
- }
-
- if (rand_type != TYPE_0) {
- fptr = &state[rand_sep];
- rptr = &state[0];
- }
-}
-
-/*
* initstate:
*
* Initialize the state information in the given array of n bytes for future