Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

experimental Solaris 10 porting

  • Loading branch information...
commit c50d9bf42843e7e3ba826ee01ab334238fb6476e 1 parent 3d4dc92
FURUHASHI Sadayuki frsyuki authored
14 configure.in
View
@@ -1,5 +1,7 @@
AC_INIT(src/logic/boot.h)
AC_CONFIG_AUX_DIR(ac)
+AC_CANONICAL_TARGET
+
AM_INIT_AUTOMAKE(kumofs, 0.3.2)
AC_CONFIG_HEADER(config.h)
@@ -181,6 +183,18 @@ AC_CHECK_LIB(tokyocabinet,tchdbget,,
AC_MSG_ERROR([Can't find tokyocabinet library.
--with-tokyocabinet=DIR option may be needed.]))
+case "$target_os" in
+solaris*)
+ AC_CHECK_LIB(socket,accept,,
+ AC_MSG_ERROR([Can't find libsocket.]))
+ AC_CHECK_LIB(nsl,inet_ntop,,
+ AC_MSG_ERROR([Can't find libnsl.]))
+ AC_CHECK_LIB(sendfile,sendfile,,
+ AC_MSG_ERROR([Can't find libsendfile.]))
+ CXXFLAGS="$CXXFLAGS -D_REENTRANT"
+ CFLAGS="$CFLAGS -D_REENTRANT"
+ ;;
+esac
AC_MSG_CHECKING([storage type])
AC_MSG_RESULT($storage_type)
6 src/kazuhiki/kazuhiki.cc
View
@@ -26,10 +26,12 @@
#include <map>
#include <arpa/inet.h>
#include <netdb.h>
-#include <ifaddrs.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
+#if 0
+#include <ifaddrs.h>
+#endif
namespace kazuhiki {
@@ -582,6 +584,7 @@ acceptable listenable(sockaddr_in6* dst, unsigned short d_port)
} // namespace type
+#if 0
namespace convert {
static int netif_addr_impl(const char* ifname, unsigned short port, void* dst, int family)
@@ -628,6 +631,7 @@ int netif_addr(const char* ifname, unsigned short port, sockaddr_in6* dst)
}
} // namespace convert
+#endif
} // namespace kazuhiki
2  src/kazuhiki/kazuhiki.h
View
@@ -180,6 +180,7 @@ extern std::auto_ptr<parser> s_parser;
namespace convert {
+#if 0
// convert network interface name to IPv4 address
int netif_addr4(sockaddr_in* dst, const char* ifname, unsigned short port);
@@ -188,6 +189,7 @@ int netif_addr6(sockaddr_in6* dst, const char* ifname, unsigned short port);
// convert network interface name to IPv4 address or IPv6 address
int netif_addr(sockaddr_in6* dst, const char* ifname, unsigned short port);
+#endif
template <typename T>
bool numeric(T* dst, const char* str)
4 src/logic/server/mod_replace_stream.cc
View
@@ -24,7 +24,7 @@
#include <fcntl.h>
#include <algorithm>
-#ifdef __linux__
+#if defined(__linux__) || defined(__sun__)
#include <sys/sendfile.h>
#endif
@@ -270,7 +270,7 @@ void mod_replace_stream_t::stream_accumulator::send(int sock)
m_mmap_stream->flush();
size_t size = m_mmap_stream->size();
//m_mmap_stream.reset(NULL); // FIXME needed?
-#if defined(__linux__)
+#if defined(__linux__) || defined(__sun__)
while(size > 0) {
ssize_t rl = ::sendfile(sock, m_fd.get(), NULL, size);
if(rl <= 0) { throw mp::system_error(errno, "offer send error"); }
6 src/mpsrc/wavy_edge.h
View
@@ -17,10 +17,10 @@
# define MP_WAVY_EDGE kqueue
# elif defined(__FreeBSD__) || defined(__NetBSD__)
# define MP_WAVY_EDGE kqueue
-# elif defined(__SunOS__) // FIXME Solaris 10
-# define MP_WAVY_EDGE kqueue
+# elif defined(__sun__)
+# define MP_WAVY_EDGE eventport
# else
-# define MP_WAVY_EDGE select
+# error this system is not supported.
# endif
# endif
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.