summaryrefslogtreecommitdiff
path: root/e_os.h
diff options
context:
space:
mode:
authorRandall S. Becker <rsbecker@nexbridge.com>2020-09-06 16:37:47 -0500
committerRichard Levitte <levitte@openssl.org>2020-09-12 20:32:11 +0200
commit08073700cc50bcd0df5c0ee68c100e300a320d03 (patch)
tree33e0641543cc32390ba73c49901183de01fdb9db /e_os.h
parentf0c62c53286b3a79cc059354a6d3425b35bb1d50 (diff)
downloadopenssl-new-08073700cc50bcd0df5c0ee68c100e300a320d03.tar.gz
NonStop port updates for 3.0.0.
HPE NonStop Port Changes for 3.0.0 Includes unthreaded, PUT, and SPT for OSS. The port changes include wrapping where necessary for FLOSS and appropriate configuration changes to support that. Two tests are excluded as being inappropriate for the platform. The changes are: * Added /usr/local/include to nonstop-nsx_spt_floss to load floss.h * Added SPT Floss variant for NonStop * Wrapped FLOSS definitions in OPENSSL_TANDEM_FLOSS to allow selective enablement. * SPT build configuration for NonStop * Skip tests not relevant for NonStop * PUT configuration changes required for NonStop platforms * Configurations/50-nonstop.conf: updates for TNS/X platform. * FLOSS instrumentation for HPE NonStop TNS/X and TNS/E platforms. * Configurations/50-nonstop.conf: modifications for non-PUT TNS/E platform b * Fix use of DELAY in ssltestlib.c for HPNS. * Fixed commit merge issues and added floss to http_server.c CLA: Permission is granted by the author to the OpenSSL team to use these modifications. Fixes #5087. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12800)
Diffstat (limited to 'e_os.h')
-rw-r--r--e_os.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/e_os.h b/e_os.h
index c035568464..979be9b2b1 100644
--- a/e_os.h
+++ b/e_os.h
@@ -295,6 +295,64 @@ struct servent *getservbyname(const char *name, const char *proto);
# endif
/* end vxworks */
+/* ----------------------------- HP NonStop -------------------------------- */
+/* Required to support platform variant without getpid() and pid_t. */
+# ifdef __TANDEM
+# include <strings.h>
+# include <netdb.h>
+# define getservbyname(name,proto) getservbyname((char*)name,proto)
+# define gethostbyname(name) gethostbyname((char*)name)
+# define ioctlsocket(a,b,c) ioctl(a,b,c)
+# ifdef NO_GETPID
+inline int nssgetpid();
+# ifndef NSSGETPID_MACRO
+# define NSSGETPID_MACRO
+# include <cextdecs.h(PROCESSHANDLE_GETMINE_)>
+# include <cextdecs.h(PROCESSHANDLE_DECOMPOSE_)>
+ inline int nssgetpid()
+ {
+ short phandle[10]={0};
+ union pseudo_pid {
+ struct {
+ short cpu;
+ short pin;
+ } cpu_pin ;
+ int ppid;
+ } ppid = { 0 };
+ PROCESSHANDLE_GETMINE_(phandle);
+ PROCESSHANDLE_DECOMPOSE_(phandle, &ppid.cpu_pin.cpu, &ppid.cpu_pin.pin);
+ return ppid.ppid;
+ }
+# define getpid(a) nssgetpid(a)
+# endif /* NSSGETPID_MACRO */
+# endif /* NO_GETPID */
+/*# define setsockopt(a,b,c,d,f) setsockopt(a,b,c,(char*)d,f)*/
+/*# define getsockopt(a,b,c,d,f) getsockopt(a,b,c,(char*)d,f)*/
+/*# define connect(a,b,c) connect(a,(struct sockaddr *)b,c)*/
+/*# define bind(a,b,c) bind(a,(struct sockaddr *)b,c)*/
+/*# define sendto(a,b,c,d,e,f) sendto(a,(char*)b,c,d,(struct sockaddr *)e,f)*/
+# if defined(OPENSSL_THREADS) && !defined(_PUT_MODEL_)
+ /*
+ * HPNS SPT threads
+ */
+# define SPT_THREAD_SIGNAL 1
+# define SPT_THREAD_AWARE 1
+# include <spthread.h>
+# undef close
+# define close spt_close
+/*
+# define get_last_socket_error() errno
+# define clear_socket_error() errno=0
+# define ioctlsocket(a,b,c) ioctl(a,b,c)
+# define closesocket(s) close(s)
+# define readsocket(s,b,n) read((s),(char*)(b),(n))
+# define writesocket(s,b,n) write((s),(char*)(b),(n)
+*/
+# define accept(a,b,c) accept(a,(struct sockaddr *)b,c)
+# define recvfrom(a,b,c,d,e,f) recvfrom(a,b,(socklen_t)c,d,e,f)
+# endif
+# endif
+
# ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
# define CRYPTO_memcmp memcmp
# endif