diff options
Diffstat (limited to 'src/lib/libcrypto/arc4random/arc4random_linux.h')
-rw-r--r-- | src/lib/libcrypto/arc4random/arc4random_linux.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/libcrypto/arc4random/arc4random_linux.h b/src/lib/libcrypto/arc4random/arc4random_linux.h index 0da5a4a433..7acba3f78e 100644 --- a/src/lib/libcrypto/arc4random/arc4random_linux.h +++ b/src/lib/libcrypto/arc4random/arc4random_linux.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random_linux.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_linux.h,v 1.7 2014/07/20 20:51:13 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -22,7 +22,10 @@ | |||
22 | * Stub functions for portability. | 22 | * Stub functions for portability. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <sys/mman.h> | ||
26 | |||
25 | #include <pthread.h> | 27 | #include <pthread.h> |
28 | #include <signal.h> | ||
26 | 29 | ||
27 | static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | 30 | static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; |
28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | 31 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) |
@@ -36,6 +39,12 @@ extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void | |||
36 | #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) | 39 | #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) |
37 | #endif | 40 | #endif |
38 | 41 | ||
42 | static inline void | ||
43 | _getentropy_fail(void) | ||
44 | { | ||
45 | raise(SIGKILL); | ||
46 | } | ||
47 | |||
39 | static volatile sig_atomic_t _rs_forked; | 48 | static volatile sig_atomic_t _rs_forked; |
40 | 49 | ||
41 | static inline void | 50 | static inline void |