diff options
author | bcook <> | 2014-07-19 15:29:25 +0000 |
---|---|---|
committer | bcook <> | 2014-07-19 15:29:25 +0000 |
commit | 9947ffe3bb61905cafffde065eede71cb613e5b2 (patch) | |
tree | e4fe1d0b41a0553abd3991c748a7c4ff9cc6b8b7 /src | |
parent | 4fc69ca9a67a87b95cea7c588f60bcdd09e3e14f (diff) | |
download | openbsd-9947ffe3bb61905cafffde065eede71cb613e5b2.tar.gz openbsd-9947ffe3bb61905cafffde065eede71cb613e5b2.tar.bz2 openbsd-9947ffe3bb61905cafffde065eede71cb613e5b2.zip |
Move _ARC4_ATFORK handlers from thread_private.h in portable.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/arc4random/arc4random_linux.h | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/arc4random/arc4random_osx.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/arc4random/arc4random_solaris.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto/arc4random_linux.h | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto/arc4random_osx.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto/arc4random_solaris.h | 4 |
6 files changed, 30 insertions, 6 deletions
diff --git a/src/lib/libcrypto/arc4random/arc4random_linux.h b/src/lib/libcrypto/arc4random/arc4random_linux.h index 29dad3b9ad..0da5a4a433 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.5 2014/07/19 14:34:38 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_linux.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -28,6 +28,14 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | |||
28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | 28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) |
29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) | 29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) |
30 | 30 | ||
31 | #ifdef __GLIBC__ | ||
32 | extern void *__dso_handle; | ||
33 | extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *); | ||
34 | #define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle) | ||
35 | #else | ||
36 | #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) | ||
37 | #endif | ||
38 | |||
31 | static volatile sig_atomic_t _rs_forked; | 39 | static volatile sig_atomic_t _rs_forked; |
32 | 40 | ||
33 | static inline void | 41 | static inline void |
diff --git a/src/lib/libcrypto/arc4random/arc4random_osx.h b/src/lib/libcrypto/arc4random/arc4random_osx.h index 55932bb823..aacbef9aae 100644 --- a/src/lib/libcrypto/arc4random/arc4random_osx.h +++ b/src/lib/libcrypto/arc4random/arc4random_osx.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random_osx.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_osx.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -28,6 +28,8 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | |||
28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | 28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) |
29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) | 29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) |
30 | 30 | ||
31 | #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) | ||
32 | |||
31 | static volatile sig_atomic_t _rs_forked; | 33 | static volatile sig_atomic_t _rs_forked; |
32 | 34 | ||
33 | static inline void | 35 | static inline void |
diff --git a/src/lib/libcrypto/arc4random/arc4random_solaris.h b/src/lib/libcrypto/arc4random/arc4random_solaris.h index e5ebbfb7e5..18b1bd54e0 100644 --- a/src/lib/libcrypto/arc4random/arc4random_solaris.h +++ b/src/lib/libcrypto/arc4random/arc4random_solaris.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random_solaris.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_solaris.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -28,6 +28,8 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | |||
28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | 28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) |
29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) | 29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) |
30 | 30 | ||
31 | #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) | ||
32 | |||
31 | static volatile sig_atomic_t _rs_forked; | 33 | static volatile sig_atomic_t _rs_forked; |
32 | 34 | ||
33 | static inline void | 35 | static inline void |
diff --git a/src/lib/libcrypto/crypto/arc4random_linux.h b/src/lib/libcrypto/crypto/arc4random_linux.h index 29dad3b9ad..0da5a4a433 100644 --- a/src/lib/libcrypto/crypto/arc4random_linux.h +++ b/src/lib/libcrypto/crypto/arc4random_linux.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random_linux.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_linux.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -28,6 +28,14 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | |||
28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | 28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) |
29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) | 29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) |
30 | 30 | ||
31 | #ifdef __GLIBC__ | ||
32 | extern void *__dso_handle; | ||
33 | extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *); | ||
34 | #define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle) | ||
35 | #else | ||
36 | #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) | ||
37 | #endif | ||
38 | |||
31 | static volatile sig_atomic_t _rs_forked; | 39 | static volatile sig_atomic_t _rs_forked; |
32 | 40 | ||
33 | static inline void | 41 | static inline void |
diff --git a/src/lib/libcrypto/crypto/arc4random_osx.h b/src/lib/libcrypto/crypto/arc4random_osx.h index 55932bb823..aacbef9aae 100644 --- a/src/lib/libcrypto/crypto/arc4random_osx.h +++ b/src/lib/libcrypto/crypto/arc4random_osx.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random_osx.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_osx.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -28,6 +28,8 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | |||
28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | 28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) |
29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) | 29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) |
30 | 30 | ||
31 | #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) | ||
32 | |||
31 | static volatile sig_atomic_t _rs_forked; | 33 | static volatile sig_atomic_t _rs_forked; |
32 | 34 | ||
33 | static inline void | 35 | static inline void |
diff --git a/src/lib/libcrypto/crypto/arc4random_solaris.h b/src/lib/libcrypto/crypto/arc4random_solaris.h index e5ebbfb7e5..18b1bd54e0 100644 --- a/src/lib/libcrypto/crypto/arc4random_solaris.h +++ b/src/lib/libcrypto/crypto/arc4random_solaris.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random_solaris.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_solaris.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -28,6 +28,8 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | |||
28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | 28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) |
29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) | 29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) |
30 | 30 | ||
31 | #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) | ||
32 | |||
31 | static volatile sig_atomic_t _rs_forked; | 33 | static volatile sig_atomic_t _rs_forked; |
32 | 34 | ||
33 | static inline void | 35 | static inline void |