Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ if test "x${COMPILE_JNI}" = xyes; then
AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))

AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([inet_pton],[nsl])
dnl Haiku has the socket functions and h_errno in libnetwork.
AC_SEARCH_LIBS([inet_pton],[nsl network])
AC_CHECK_LIB([socket], [gethostname])

AC_CHECK_FUNCS([ftruncate fsync select \
Expand Down
5 changes: 5 additions & 0 deletions native/jni/java-net/java_net_VMNetworkInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ exception statement from your version. */
#include <string.h>

#include <net/if.h>

/* Haiku does not define IFF_RUNNING. */
#ifndef IFF_RUNNING
#define IFF_RUNNING 0x40
#endif
#include <sys/ioctl.h>
/* Required on Solaris. */
#include <unistd.h>
Expand Down
7 changes: 6 additions & 1 deletion native/jni/native-lib/cpnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,12 @@ jint cpnet_getHostByName (JNIEnv *env, const char *hostname, cpnet_address ***ad
{
buf = (char *)JCL_malloc(env, buflen);

#ifdef HAVE_GETHOSTBYNAME_R
/* Use gethostbyname_r only if its declaration was found. Haiku has the
function in libnetwork but does not declare it. */
#if defined(HAVE_GETHOSTBYNAME_R) \
&& (defined(HAVE_FUNC_GETHOSTBYNAME_R_6) \
|| defined(HAVE_FUNC_GETHOSTBYNAME_R_5) \
|| defined(HAVE_FUNC_GETHOSTBYNAME_R_3))
# if defined(HAVE_FUNC_GETHOSTBYNAME_R_6)
ret = gethostbyname_r (hostname, &hret, buf, buflen, &result, &herr);
# elif defined(HAVE_FUNC_GETHOSTBYNAME_R_5)
Expand Down