mem_sec.c: relax POSIX requirement.
authorAndy Polyakov <appro@openssl.org>
Sun, 25 Feb 2018 15:56:26 +0000 (16:56 +0100)
committerAndy Polyakov <appro@openssl.org>
Mon, 26 Feb 2018 16:50:52 +0000 (17:50 +0100)
Even though mlock(2) was standardized in POSIX.1-2001, vendors did
implement it prior that point.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5460)

crypto/mem_sec.c

index 4c010454955123c75ccfd465acf14f7d04936bbd..77bf165fbc555cbb85e155f56c2ccc709ad7d70a 100644 (file)
@@ -22,7 +22,9 @@
 
 /* e_os.h includes unistd.h, which defines _POSIX_VERSION */
 #if !defined(OPENSSL_NO_SECURE_MEMORY) && defined(OPENSSL_SYS_UNIX) \
-    && defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
+    && ( (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
+         || defined(__sun) || defined(__hpux) || defined(__sgi) \
+         || defined(__osf__) )
 # define IMPLEMENTED
 # include <stdlib.h>
 # include <assert.h>