This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] rtems crt0: Add stubs for arc4random.


From: Christian Mauderer <Christian.Mauderer@embedded-brains.de>

---
 newlib/libc/sys/rtems/crt0.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/newlib/libc/sys/rtems/crt0.c b/newlib/libc/sys/rtems/crt0.c
index 3bf7083..1a0a055 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
-- 
1.8.4.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]