Make sk_sort tolearate a NULL argument.
[openssl.git] / e_os.h
diff --git a/e_os.h b/e_os.h
index 95590a7cb2606be26e16638446e30de983ddae2c..e23e254454bb4c6bd1440e79b2c3beb095b3d4b9 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -77,9 +77,15 @@ extern "C" {
 #endif
 
 #ifndef DEVRANDOM
-/* set this to your 'random' device if you have one.
- * My default, we will try to read this file */
-#define DEVRANDOM "/dev/urandom"
+/* set this to a comma-separated list of 'random' device files to try out.
+ * My default, we will try to read at least one of these files */
+#define DEVRANDOM "/dev/urandom","/dev/random","/dev/srandom"
+#endif
+#ifndef DEVRANDOM_EGD
+/* set this to a comma-seperated list of 'egd' sockets to try out. These
+ * sockets will be tried in the order listed in case accessing the device files
+ * listed in DEVRANDOM did not return enough entropy. */
+#define DEVRANDOM_EGD "/etc/entropy","/var/run/egd-pool"
 #endif
 
 #if defined(__MWERKS__) && defined(macintosh)
@@ -245,6 +251,8 @@ extern "C" {
 #    define RFILE              ".rnd"
 #    define LIST_SEPARATOR_CHAR ','
 #    define NUL_DEV            "NLA0:"
+  /* We don't have any well-defined random devices on VMS, yet... */
+#    undef DEVRANDOM
   /* We need to do this since VMS has the following coding on status codes:
 
      Bits 0-2: status type: 0 = warning, 1 = success, 2 = error, 3 = info ...
@@ -275,6 +283,9 @@ extern "C" {
 #    define NO_SYS_PARAM_H
 #  else
      /* !defined VMS */
+#    ifdef MPE
+#      define NO_SYS_PARAM_H
+#    endif
 #    ifdef OPENSSL_UNISTD
 #      include OPENSSL_UNISTD
 #    else
@@ -283,12 +294,16 @@ extern "C" {
 #    ifndef NO_SYS_TYPES_H
 #      include <sys/types.h>
 #    endif
-#    ifdef NeXT
+#    if defined(NeXT) || defined(NEWS4)
 #      define pid_t int /* pid_t is missing on NEXTSTEP/OPENSTEP
                          * (unless when compiling with -D_POSIX_SOURCE,
                          * which doesn't work for us) */
 #      define ssize_t int /* ditto */
 #    endif
+#    ifdef NEWS4 /* setvbuf is missing on mips-sony-bsd */
+#      define setvbuf(a, b, c, d) setbuffer((a), (b), (d))
+       typedef unsigned long clock_t;
+#    endif
 
 #    define OPENSSL_CONF       "openssl.cnf"
 #    define SSLEAY_CONF                OPENSSL_CONF
@@ -340,18 +355,22 @@ extern HINSTANCE _hInstance;
 #    ifndef NO_SYS_PARAM_H
 #      include <sys/param.h>
 #    endif
-#    include <sys/time.h> /* Needed under linux for FD_XXX */
+#    ifndef MPE
+#      include <sys/time.h> /* Needed under linux for FD_XXX */
+#    endif
 
 #    include <netdb.h>
 #    if defined(VMS) && !defined(__DECC)
 #      include <socket.h>
 #      include <in.h>
+#      include <inet.h>
 #    else
 #      include <sys/socket.h>
 #      ifdef FILIO_H
 #        include <sys/filio.h> /* Added for FIONBIO under unixware */
 #      endif
 #      include <netinet/in.h>
+#      include <arpa/inet.h>
 #    endif
 
 #    if defined(NeXT) || defined(_NEXT_SOURCE)
@@ -363,6 +382,10 @@ extern HINSTANCE _hInstance;
 #      include <sys/select.h>
 #    endif
 
+#    ifdef __QNX__
+#      include <sys/select.h>
+#    endif
+
 #    if defined(sun)
 #      include <sys/filio.h>
 #    else
@@ -404,7 +427,12 @@ extern HINSTANCE _hInstance;
 #endif
 
 #if defined(sun) && !defined(__svr4__) && !defined(__SVR4)
-#define memmove(s1,s2,b) bcopy((s2),(s1),(n))
+  /* bcopy can handle overlapping moves according to SunOS 4.1.4 manpage */
+# define memmove(s1,s2,n) bcopy((s2),(s1),(n))
+# define strtoul(s,e,b) ((unsigned long int)strtol((s),(e),(b)))
+extern char *sys_errlist[]; extern int sys_nerr;
+# define strerror(errnum) \
+       (((errnum)<0 || (errnum)>=sys_nerr) ? NULL : sys_errlist[errnum])
 #endif
 
 /***********************************************/
@@ -430,19 +458,6 @@ extern HINSTANCE _hInstance;
 #define IRIX_CC_BUG    /* CDS++ up to V2.0Bsomething suffered from the same bug.*/
 #endif
 
-#ifdef NO_MD2
-#define MD2_Init MD2Init
-#define MD2_Update MD2Update
-#define MD2_Final MD2Final
-#define MD2_DIGEST_LENGTH 16
-#endif
-#ifdef NO_MD5
-#define MD5_Init MD5Init 
-#define MD5_Update MD5Update
-#define MD5_Final MD5Final
-#define MD5_DIGEST_LENGTH 16
-#endif
-
 #ifdef  __cplusplus
 }
 #endif