diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-05-21 19:04:49 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-05-21 19:04:49 +0000 |
commit | 291d93b58b3426854d6e585aa2e17e1b49e6db91 (patch) | |
tree | 9d6b76945a8c5b86b80872f3e75f9cbeb6bd06a2 /winsup/cygwin/mktemp.cc | |
parent | 3e8d2576fdaf69955eb16225117bbe382f85a1d7 (diff) | |
download | newlib-291d93b58b3426854d6e585aa2e17e1b49e6db91.zip newlib-291d93b58b3426854d6e585aa2e17e1b49e6db91.tar.gz newlib-291d93b58b3426854d6e585aa2e17e1b49e6db91.tar.bz2 |
* Makefile.in (DLL_OFILES): Add arc4random.o.
* common.din: Export arc4random, arc4random_addrandom, arc4random_buf,
arc4random_stir and arc4random_uniform.
* mktemp.cc (arc4random): Remove static replacement function.
* posix.sgml (std-bsd): Add arc4random functions.
* include/cygwin/stdlib.h: Declare arc4random functions.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* libc/arc4random.cc: New file implementing arc4random functions taken
from FreeBSD.
Diffstat (limited to 'winsup/cygwin/mktemp.cc')
-rw-r--r-- | winsup/cygwin/mktemp.cc | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/winsup/cygwin/mktemp.cc b/winsup/cygwin/mktemp.cc index 831111d..4dc157d 100644 --- a/winsup/cygwin/mktemp.cc +++ b/winsup/cygwin/mktemp.cc @@ -11,7 +11,6 @@ See the copyright at the bottom of this file. */ #include <unistd.h> static int _gettemp(char *, int *, int, size_t, int); -static uint32_t arc4random (); static const char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -153,20 +152,6 @@ _gettemp(char *path, int *doopen, int domkdir, size_t suffixlen, int flags) /*NOTREACHED*/ } -static uint32_t -arc4random () -{ - union - { - uint32_t rand; - char buf[sizeof (int) / 8]; - } r; - int fd = open ("/dev/urandom", O_RDONLY); - read (fd, r.buf, 4); - close (fd); - return r.rand; -} - /* * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. |