summaryrefslogtreecommitdiff
path: root/src/network/core/os_abstraction.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/core/os_abstraction.h')
-rw-r--r--src/network/core/os_abstraction.h58
1 files changed, 16 insertions, 42 deletions
diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h
index 187e2584c..084f763c2 100644
--- a/src/network/core/os_abstraction.h
+++ b/src/network/core/os_abstraction.h
@@ -49,9 +49,7 @@ typedef unsigned long in_addr_t;
# define SOCKET int
# define INVALID_SOCKET -1
# define ioctlsocket ioctl
-# if !defined(BEOS_NET_SERVER)
-# define closesocket close
-# endif
+# define closesocket close
# define GET_LAST_ERROR() (errno)
/* Need this for FIONREAD on solaris */
# define BSD_COMP
@@ -59,37 +57,25 @@ typedef unsigned long in_addr_t;
/* Includes needed for UNIX-like systems */
# include <unistd.h>
# include <sys/ioctl.h>
-# if defined(__BEOS__) && defined(BEOS_NET_SERVER)
-# include <be/net/socket.h>
-# include <be/kernel/OS.h> /* snooze() */
-# include <be/net/netdb.h>
- typedef unsigned long in_addr_t;
-# define INADDR_NONE INADDR_BROADCAST
-# else
-# include <sys/socket.h>
-# include <netinet/in.h>
-# include <netinet/tcp.h>
-# include <arpa/inet.h>
-# include <net/if.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+# include <arpa/inet.h>
+# include <net/if.h>
/* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */
-# if !defined(__sgi__) && !defined(SUNOS) && !defined(__BEOS__) && !defined(__HAIKU__) && !defined(__INNOTEK_LIBC__) \
- && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
+# if !defined(__sgi__) && !defined(SUNOS) && !defined(__HAIKU__) && !defined(__INNOTEK_LIBC__) \
+ && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
/* If for any reason ifaddrs.h does not exist on your system, comment out
* the following two lines and an alternative way will be used to fetch
* the list of IPs from the system. */
-# include <ifaddrs.h>
-# define HAVE_GETIFADDRS
-# endif
-# if !defined(INADDR_NONE)
-# define INADDR_NONE 0xffffffff
-# endif
-# if defined(__BEOS__) && !defined(BEOS_NET_SERVER)
- /* needed on Zeta */
-# include <sys/sockio.h>
-# endif
-# endif /* BEOS_NET_SERVER */
-
-# if !defined(__BEOS__) && defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)
+# include <ifaddrs.h>
+# define HAVE_GETIFADDRS
+# endif
+# if !defined(INADDR_NONE)
+# define INADDR_NONE 0xffffffff
+# endif
+
+# if defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)
typedef uint32_t in_addr_t;
# endif
@@ -98,10 +84,6 @@ typedef unsigned long in_addr_t;
# include <netdb.h>
#endif /* UNIX */
-#ifdef __BEOS__
- typedef int socklen_t;
-#endif
-
#ifdef __HAIKU__
#define IPV6_V6ONLY 27
#endif
@@ -174,11 +156,7 @@ static inline bool SetNonBlocking(SOCKET d)
#else
int nonblocking = 1;
#endif
-#if (defined(__BEOS__) && defined(BEOS_NET_SERVER))
- return setsockopt(d, SOL_SOCKET, SO_NONBLOCK, &nonblocking, sizeof(nonblocking)) == 0;
-#else
return ioctlsocket(d, FIONBIO, &nonblocking) == 0;
-#endif
}
/**
@@ -189,13 +167,9 @@ static inline bool SetNonBlocking(SOCKET d)
static inline bool SetNoDelay(SOCKET d)
{
/* XXX should this be done at all? */
-#if !defined(BEOS_NET_SERVER) /* not implemented on BeOS net_server */
int b = 1;
/* The (const char*) cast is needed for windows */
return setsockopt(d, IPPROTO_TCP, TCP_NODELAY, (const char*)&b, sizeof(b)) == 0;
-#else
- return true;
-#endif
}
/* Make sure these structures have the size we expect them to be */