]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix a mod_ssl build problem on OS/390.
authorJeff Trawick <trawick@apache.org>
Thu, 9 May 2002 10:53:28 +0000 (10:53 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 9 May 2002 10:53:28 +0000 (10:53 +0000)
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/modules/ssl@95016 13f79535-47bb-0310-9956-ffa450edef68

ssl_util.c

index b01f18db4188327efc01ca6c2c144ca28cf218d9..2147473638e67753d15acd26a13f958b08df2ab9 100644 (file)
@@ -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)