diff options
author | Jeff Trawick <trawick@apache.org> | 2002-05-09 12:53:28 +0200 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2002-05-09 12:53:28 +0200 |
commit | c6512b2859b138829bda426b7f37dc275c8595ab (patch) | |
tree | 5ce166b3998ea02362ae6a5538c6c0ec94a3bd67 /modules/ssl/ssl_util.c | |
parent | Correct grammer. (diff) | |
download | apache2-c6512b2859b138829bda426b7f37dc275c8595ab.tar.xz apache2-c6512b2859b138829bda426b7f37dc275c8595ab.zip |
Fix a mod_ssl build problem on OS/390.
This is admittedly rather ugly code to come up with a unique 4-byte
identifier for the thread. Since our threads are pthreads and a pthread
maps 1:1 to a TCB, the address of the TCB is sufficient. Yes, every
TCB sees a different piece of real storage mapped to the first page,
so the code does make sense.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95016 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/ssl/ssl_util.c')
-rw-r--r-- | modules/ssl/ssl_util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/ssl/ssl_util.c b/modules/ssl/ssl_util.c index b01f18db41..2147473638 100644 --- a/modules/ssl/ssl_util.c +++ b/modules/ssl/ssl_util.c @@ -419,7 +419,20 @@ static void ssl_util_thr_lock(int mode, int type, static unsigned long ssl_util_thr_id(void) { + /* OpenSSL needs this to return an unsigned long. On OS/390, the pthread + * id is a structure twice that big. Use the TCB pointer instead as a + * unique unsigned long. + */ +#ifdef __MVS__ + struct PSA { + char unmapped[540]; + unsigned long PSATOLD; + } *psaptr = 0; + + return psaptr->PSATOLD; +#else return (unsigned long) apr_os_thread_current(); +#endif } static apr_status_t ssl_util_thread_cleanup(void *data) |