Browse Source

Move _ARC4_ATFORK handlers from thread_private.h in portable.

OPENBSD_5_6
bcook 10 years ago
parent
commit
9b651cf7ae
6 changed files with 30 additions and 6 deletions
  1. +9
    -1
      src/lib/libcrypto/arc4random/arc4random_linux.h
  2. +3
    -1
      src/lib/libcrypto/arc4random/arc4random_osx.h
  3. +3
    -1
      src/lib/libcrypto/arc4random/arc4random_solaris.h
  4. +9
    -1
      src/lib/libcrypto/crypto/arc4random_linux.h
  5. +3
    -1
      src/lib/libcrypto/crypto/arc4random_osx.h
  6. +3
    -1
      src/lib/libcrypto/crypto/arc4random_solaris.h

+ 9
- 1
src/lib/libcrypto/arc4random/arc4random_linux.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_linux.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */
/* $OpenBSD: arc4random_linux.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -28,6 +28,14 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx)
#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
#ifdef __GLIBC__
extern void *__dso_handle;
extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *);
#define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle)
#else
#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
#endif
static volatile sig_atomic_t _rs_forked;
static inline void


+ 3
- 1
src/lib/libcrypto/arc4random/arc4random_osx.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_osx.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */
/* $OpenBSD: arc4random_osx.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -28,6 +28,8 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx)
#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
static volatile sig_atomic_t _rs_forked;
static inline void


+ 3
- 1
src/lib/libcrypto/arc4random/arc4random_solaris.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_solaris.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */
/* $OpenBSD: arc4random_solaris.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -28,6 +28,8 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx)
#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
static volatile sig_atomic_t _rs_forked;
static inline void


+ 9
- 1
src/lib/libcrypto/crypto/arc4random_linux.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_linux.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */
/* $OpenBSD: arc4random_linux.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -28,6 +28,14 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx)
#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
#ifdef __GLIBC__
extern void *__dso_handle;
extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *);
#define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle)
#else
#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
#endif
static volatile sig_atomic_t _rs_forked;
static inline void


+ 3
- 1
src/lib/libcrypto/crypto/arc4random_osx.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_osx.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */
/* $OpenBSD: arc4random_osx.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -28,6 +28,8 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx)
#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
static volatile sig_atomic_t _rs_forked;
static inline void


+ 3
- 1
src/lib/libcrypto/crypto/arc4random_solaris.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_solaris.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */
/* $OpenBSD: arc4random_solaris.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -28,6 +28,8 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx)
#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
static volatile sig_atomic_t _rs_forked;
static inline void


Loading…
Cancel
Save