Remove special socket_wrapper code.
[samba.git] / lib / replace / system / network.h
index 6add99c0db7cfc13b08e7d21eaa127f2e700d160..273cb716cf4b339be5fd0d7932389b3f855e582c 100644 (file)
@@ -31,6 +31,8 @@
 #error "AC_LIBREPLACE_NETWORK_CHECKS missing in configure"
 #endif
 
+#include <unistd.h>
+
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -195,6 +197,20 @@ int rep_socketpair(int d, int type, int protocol, int sv[2]);
 #endif
 #endif
 
+/*
+ * Some of the functions in source3/lib/util_sock.c use AI_ADDRCONFIG. On QNX
+ * 6.3.0, this macro is defined but, if it's used, getaddrinfo will fail. This
+ * prevents smbd from opening any sockets.
+ *
+ * If I undefine AI_ADDRCONFIG on such systems and define it to be 0,
+ * this works around the issue.
+ */
+#ifdef __QNX__
+#include <sys/neutrino.h>
+#if _NTO_VERSION == 630
+#undef AI_ADDRCONFIG
+#endif
+#endif
 #ifndef AI_ADDRCONFIG
 /*
  * logic copied from AI_NUMERICHOST
@@ -293,12 +309,12 @@ typedef unsigned short int sa_family_t;
 #define sockaddr_storage sockaddr_in6
 #define ss_family sin6_family
 #define HAVE_SS_FAMILY 1
-#else
+#else /*HAVE_STRUCT_SOCKADDR_IN6*/
 #define sockaddr_storage sockaddr_in
 #define ss_family sin_family
 #define HAVE_SS_FAMILY 1
-#endif
-#endif
+#endif /*HAVE_STRUCT_SOCKADDR_IN6*/
+#endif /*HAVE_STRUCT_SOCKADDR_STORAGE*/
 
 #ifndef HAVE_SS_FAMILY
 #ifdef HAVE___SS_FAMILY
@@ -307,6 +323,20 @@ typedef unsigned short int sa_family_t;
 #endif
 #endif
 
+#ifndef IOV_MAX
+# ifdef UIO_MAXIOV
+#  define IOV_MAX UIO_MAXIOV
+# else
+#  ifdef __sgi
+    /*
+     * IRIX 6.5 has sysconf(_SC_IOV_MAX)
+     * which might return 512 or bigger
+     */
+#   define IOV_MAX 512
+#  endif
+# endif
+#endif
+
 #ifndef HAVE_STRUCT_ADDRINFO
 #define HAVE_STRUCT_ADDRINFO
 struct addrinfo {
@@ -330,13 +360,11 @@ struct addrinfo {
 #define ifr_netmask ifr_addr
 #endif
 
-#ifdef SOCKET_WRAPPER
-#ifndef SOCKET_WRAPPER_DISABLE
-#ifndef SOCKET_WRAPPER_NOT_REPLACE
-#define SOCKET_WRAPPER_REPLACE
-#endif /* SOCKET_WRAPPER_NOT_REPLACE */
-#include "../socket_wrapper/socket_wrapper.h"
-#endif /* SOCKET_WRAPPER_DISABLE */
-#endif /* SOCKET_WRAPPER */
+/* Some old Linux systems have broken header files */
+#ifdef HAVE_IPV6
+#ifdef HAVE_LINUX_IPV6_V6ONLY_26
+#define IPV6_V6ONLY 26
+#endif /* HAVE_LINUX_IPV6_V6ONLY_26 */
+#endif /* HAVE_IPV6 */
 
 #endif