diff options
Diffstat (limited to 'src/lib/libcrypto/arc4random/arc4random_linux.h')
| -rw-r--r-- | src/lib/libcrypto/arc4random/arc4random_linux.h | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/src/lib/libcrypto/arc4random/arc4random_linux.h b/src/lib/libcrypto/arc4random/arc4random_linux.h index 992ee6bb8e..29dad3b9ad 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.4 2014/07/19 13:02:28 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_linux.h,v 1.5 2014/07/19 14:34:38 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,6 +22,12 @@ | |||
| 22 | * Stub functions for portability. | 22 | * Stub functions for portability. | 
| 23 | */ | 23 | */ | 
| 24 | 24 | ||
| 25 | #include <pthread.h> | ||
| 26 | |||
| 27 | static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | ||
| 28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | ||
| 29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) | ||
| 30 | |||
| 25 | static volatile sig_atomic_t _rs_forked; | 31 | static volatile sig_atomic_t _rs_forked; | 
| 26 | 32 | ||
| 27 | static inline void | 33 | static inline void | 
