summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2007-04-17 21:46:26 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2007-04-17 21:46:26 +0000
commit076618b7aea2fb31efb271621f5fa01c342ef3d3 (patch)
treebffaf9e76813967a8ae565678040e9186b2bd054 /native
parent96947f376e7c11b57f2a928e91fcd9f1071c9fd2 (diff)
downloadclasspath-076618b7aea2fb31efb271621f5fa01c342ef3d3.tar.gz
2007-04-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
* native/jni/java-net/local.c: Fix import of FIONREAD. * native/jni/java-nio/gnu_java_nio_VMChannel.c, * native/jni/native-lib/cpnet.c: Likewise.
Diffstat (limited to 'native')
-rw-r--r--native/jni/java-net/local.c9
-rw-r--r--native/jni/java-nio/gnu_java_nio_VMChannel.c9
-rw-r--r--native/jni/native-lib/cpnet.c9
3 files changed, 24 insertions, 3 deletions
diff --git a/native/jni/java-net/local.c b/native/jni/java-net/local.c
index c8ca91c2a..b7ec6f264 100644
--- a/native/jni/java-net/local.c
+++ b/native/jni/java-net/local.c
@@ -45,13 +45,20 @@ exception statement from your version. */
#include <unistd.h>
#include <string.h>
#include <errno.h>
-#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <stdio.h>
+#if defined(HAVE_SYS_IOCTL_H)
+#define BSD_COMP /* Get FIONREAD on Solaris2 */
+#include <sys/ioctl.h>
+#endif
+#if defined(HAVE_SYS_FILIO_H) /* Get FIONREAD on Solaris 2.5 */
+#include <sys/filio.h>
+#endif
+
#include "local.h"
const char *
diff --git a/native/jni/java-nio/gnu_java_nio_VMChannel.c b/native/jni/java-nio/gnu_java_nio_VMChannel.c
index 6ff4ece80..c8df841a1 100644
--- a/native/jni/java-nio/gnu_java_nio_VMChannel.c
+++ b/native/jni/java-nio/gnu_java_nio_VMChannel.c
@@ -43,7 +43,6 @@ exception statement from your version. */
#include <config-int.h>
#include <sys/types.h>
-#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -67,6 +66,14 @@ exception statement from your version. */
#include <fcntl.h>
#endif /* HAVE_FCNTL_H */
+#if defined(HAVE_SYS_IOCTL_H)
+#define BSD_COMP /* Get FIONREAD on Solaris2 */
+#include <sys/ioctl.h>
+#endif
+#if defined(HAVE_SYS_FILIO_H) /* Get FIONREAD on Solaris 2.5 */
+#include <sys/filio.h>
+#endif
+
#define CONNECT_EXCEPTION "java/net/ConnectException"
#define IO_EXCEPTION "java/io/IOException"
#define SOCKET_EXCEPTION "java/net/SocketException"
diff --git a/native/jni/native-lib/cpnet.c b/native/jni/native-lib/cpnet.c
index f4ff0f15a..22ce69e27 100644
--- a/native/jni/native-lib/cpnet.c
+++ b/native/jni/native-lib/cpnet.c
@@ -46,11 +46,18 @@ exception statement from your version. */
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
-#include <sys/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#include <arpa/inet.h>
+#if defined(HAVE_SYS_IOCTL_H)
+#define BSD_COMP /* Get FIONREAD on Solaris2 */
+#include <sys/ioctl.h>
+#endif
+#if defined(HAVE_SYS_FILIO_H) /* Get FIONREAD on Solaris 2.5 */
+#include <sys/filio.h>
+#endif
+
#include "cpnet.h"
#define SOCKET_DEFAULT_TIMEOUT -1 /* milliseconds */