summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2016-05-09 12:36:29 -0400
committerJeff Johnston <jjohnstn@redhat.com>2016-05-09 12:37:27 -0400
commit36e32df9f8cf993c084199ddb20a8af41d3ff4b5 (patch)
treea7f563a7311d78fcafdae10bbcc110afffa292e4
parentba72ae0f932866916348687656d3879dcac8125a (diff)
downloadcygnal-36e32df9f8cf993c084199ddb20a8af41d3ff4b5.tar.gz
cygnal-36e32df9f8cf993c084199ddb20a8af41d3ff4b5.tar.bz2
cygnal-36e32df9f8cf993c084199ddb20a8af41d3ff4b5.zip
Allow autoconf link-time tests to detect arc4random for RTEMS.
-rw-r--r--newlib/libc/sys/rtems/crt0.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/newlib/libc/sys/rtems/crt0.c b/newlib/libc/sys/rtems/crt0.c
index 3bf70832c..1a0a055c6 100644
--- a/newlib/libc/sys/rtems/crt0.c
+++ b/newlib/libc/sys/rtems/crt0.c
@@ -16,6 +16,7 @@
#include <time.h> /* struct timespec */
#include <unistd.h> /* isatty */
#include <sys/lock.h> /* _Mutex_recursive_Control */
+#include <machine/_arc4random.h>
#include <machine/_libatomic.h>
void rtems_provides_crt0( void ) {} /* dummy symbol so file always has one */
@@ -66,6 +67,10 @@ RTEMS_STUB(void, _Libatomic_Protect_end(void *ptr, __uint32_t isr_level), { });
RTEMS_STUB(void, _Libatomic_Lock_n(void *ptr, __size_t n), { });
RTEMS_STUB(void, _Libatomic_Unlock_n(void *ptr, __size_t n), { });
+/* Stubs for routines for arc4random (from <unistd.h> and <machine/_arc4random.h> */
+RTEMS_STUB(int, getentropy(void *ptr, __size_t n), { });
+RTEMS_STUB(void, _arc4random_getentropy_fail(void), { });
+
#if defined(__GNUC__)
/*
* stubs for libstdc++ rtems-threads support functions from gcc/gthr-rtems.h