From 2b67d7dee09852789d9ac7d8972ed6cdb2c18430 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 18 Jul 2014 15:57:41 -0700 Subject: Use upstream OpenBSD's arc4random. The getentropy_linux.c is lightly modified to build on Android, but we're now completely in sync with upstream OpenBSD's arc4random implementation. Change-Id: If32229fc28aba908035fb38703190d41ddcabc95 --- libc/upstream-openbsd/android/include/openbsd-compat.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libc/upstream-openbsd/android/include/openbsd-compat.h') diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h index 5827a82dd..34ad2c5c8 100644 --- a/libc/upstream-openbsd/android/include/openbsd-compat.h +++ b/libc/upstream-openbsd/android/include/openbsd-compat.h @@ -18,6 +18,7 @@ #define _BIONIC_OPENBSD_COMPAT_H_included #include +#include // For size_t. #define __USE_BSD @@ -36,6 +37,11 @@ /* OpenBSD has this, but we can't really implement it correctly on Linux. */ #define issetugid() 0 +#define explicit_bzero(p, s) memset(p, 0, s) + +/* We have OpenBSD's getentropy_linux.c, but we don't mention getentropy in any header. */ +__LIBC_HIDDEN__ extern int getentropy(void*, size_t); + /* LP32 NDK ctype.h contained references to these. */ __LIBC64_HIDDEN__ extern const short* _tolower_tab_; __LIBC64_HIDDEN__ extern const short* _toupper_tab_; -- cgit v1.2.3