This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Move arc4random Cygwin only code to Cygwin
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org, newlib-cvs at sourceware dot org
- Date: 21 Mar 2016 10:13:14 -0000
- Subject: [newlib-cygwin] Move arc4random Cygwin only code to Cygwin
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=08537d88f625658222ecc63ccf633ed4278b7b3b
commit 08537d88f625658222ecc63ccf633ed4278b7b3b
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Mon Mar 21 08:12:54 2016 +0100
Move arc4random Cygwin only code to Cygwin
Keep the Newlib arc4random.c identical to the OpenBSD upstream version.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>.
Diff:
---
newlib/libc/stdlib/arc4random.c | 15 ---------------
winsup/cygwin/Makefile.in | 1 +
winsup/cygwin/libc/arc4random_stir.c | 24 ++++++++++++++++++++++++
3 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/newlib/libc/stdlib/arc4random.c b/newlib/libc/stdlib/arc4random.c
index 0eeaa2c..75cdff3 100644
--- a/newlib/libc/stdlib/arc4random.c
+++ b/newlib/libc/stdlib/arc4random.c
@@ -193,18 +193,3 @@ arc4random_buf(void *buf, size_t n)
_rs_random_buf(buf, n);
_ARC4_UNLOCK();
}
-
-#ifdef __CYGWIN__
-/* Exported functions removed from OpenBSD in the meantime. Keep them,
- but make them non-functional. They don't return a value anyway. */
-void
-arc4random_stir(void)
-{
-}
-
-void
-arc4random_addrandom(u_char *dat, int datlen)
-{
-}
-
-#endif /* __CYGWIN__ */
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index c6131d1..6695488 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -155,6 +155,7 @@ MT_SAFE_OBJECTS:=
#
DLL_OFILES:= \
advapi32.o \
+ arc4random_stir.o \
assert.o \
autoload.o \
base64.o \
diff --git a/winsup/cygwin/libc/arc4random_stir.c b/winsup/cygwin/libc/arc4random_stir.c
new file mode 100644
index 0000000..1648130
--- /dev/null
+++ b/winsup/cygwin/libc/arc4random_stir.c
@@ -0,0 +1,24 @@
+/* libc/arc4random_stir.c
+
+ Copyright 2016 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#include <sys/types.h>
+
+/* Exported functions removed from OpenBSD in the meantime. Keep them,
+ but make them non-functional. They don't return a value anyway. */
+
+void
+arc4random_stir(void)
+{
+}
+
+void
+arc4random_addrandom(u_char *dat, int datlen)
+{
+}