<sys/select.h> is included for AIX, when USE_SOCKETS is defined.
[openssl.git] / crypto / rand / rand_egd.c
index 38816f8e079bc3383378aa42150fab47fd7dfb88..abc3ac27d552c51a270fb60eed5601bd326e5b4e 100644 (file)
@@ -54,6 +54,7 @@
  *
  */
 
+#include <openssl/e_os2.h>
 #include <openssl/rand.h>
 
 /*
@@ -93,7 +94,7 @@
  *   RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
  */
 
-#if defined(WIN32) || defined(VMS) || defined(__VMS)
+#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(__DJGPP__)
 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
        {
        return(-1);
@@ -112,7 +113,18 @@ int RAND_egd_bytes(const char *path,int bytes)
 #include OPENSSL_UNISTD
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <sys/un.h>
+#ifndef NO_SYS_UN_H
+# ifdef OPENSSL_SYS_VSWORKS
+#   include <streams/un.h>
+# else
+#   include <sys/un.h>
+# endif
+#else
+struct sockaddr_un {
+       short   sun_family;             /* AF_UNIX */
+       char    sun_path[108];          /* path name (gag) */
+};
+#endif /* NO_SYS_UN_H */
 #include <string.h>
 #include <errno.h>