summaryrefslogtreecommitdiffstats
path: root/e_os.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2005-06-13 03:23:50 +0000
committerRichard Levitte <levitte@openssl.org>2005-06-13 03:23:50 +0000
commitb764ab9537458b37d247a4f7b6d6a5b9657ff6d6 (patch)
tree0c7b902e3f28e1286726f7373a6e9c04d9fa3d59 /e_os.h
parenta761b89d2feac31acb9acf01b4a5c6694c9064db (diff)
Netware patch submitted by Verdon Walker" <VWalker@novell.com> in PR
1107. He says: This is a followup to the NetWare patch that was applied to beta3. It does the following: - Fixes a problem in the CLib build with undefined symbols. - Adds the ability to use BSD sockets as the default for the OpenSSL socket BIO. NetWare supports 2 flavors of sockets and our Apache developers need BSD sockets as a configurable option when building OpenSSL. This adds that for them. - Updates to the INSTALL.NW file to explain new options. I have tried very hard to make sure all the changes are in NetWare specific files or guarded carefully to make sure they only impact NetWare builds. I have tested the Windows build to make sure it does not break that since we have made changes to mk1mf.pl. We are still working the gcc cross compile for NetWare issue and hope to have a patch for that before beta 6 is released.
Diffstat (limited to 'e_os.h')
-rw-r--r--e_os.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/e_os.h b/e_os.h
index 54982cee00..06e1fe2979 100644
--- a/e_os.h
+++ b/e_os.h
@@ -182,10 +182,18 @@ extern "C" {
#define readsocket(s,b,n) read((s),(b),(n))
#define writesocket(s,b,n) write((s),(char *)(b),(n))
#elif defined(OPENSSL_SYS_NETWARE)
+#if defined(NETWARE_BSDSOCK)
+#define get_last_socket_error() errno
+#define clear_socket_error() errno=0
+#define closesocket(s) close(s)
+#define readsocket(s,b,n) recv((s),(b),(n),0)
+#define writesocket(s,b,n) send((s),(b),(n),0)
+#else
#define get_last_socket_error() WSAGetLastError()
#define clear_socket_error() WSASetLastError(0)
#define readsocket(s,b,n) recv((s),(b),(n),0)
#define writesocket(s,b,n) send((s),(b),(n),0)
+#endif
#else
#define get_last_socket_error() errno
#define clear_socket_error() errno=0
@@ -436,9 +444,17 @@ extern HINSTANCE _hInstance;
# define SHUTDOWN2(fd) MacSocket_close(fd)
# elif defined(OPENSSL_SYS_NETWARE)
- /* NetWare uses the WinSock2 interfaces
+ /* NetWare uses the WinSock2 interfaces by default, but can be configured for BSD
*/
-# include <novsock2.h>
+# if defined(NETWARE_BSDSOCK)
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <sys/time.h>
+# include <sys/select.h>
+# define INVALID_SOCKET (int)(~0)
+# else
+# include <novsock2.h>
+# endif
# define SSLeay_Write(a,b,c) send((a),(b),(c),0)
# define SSLeay_Read(a,b,c) recv((a),(b),(c),0)
# define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); }