aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/java/nio/channels
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2004-03-19 22:06:12 -0800
committerPer Bothner <bothner@gcc.gnu.org>2004-03-19 22:06:12 -0800
commitab16524d6248bc92df21a63a0b5f71ec8cea168f (patch)
treeb492db8b5d3c0209d315e66e056abc85685e5041 /libjava/gnu/java/nio/channels
parentd1a6adeb6743311f37affcce0a15df6f77a325a5 (diff)
downloadgcc-ab16524d6248bc92df21a63a0b5f71ec8cea168f.zip
gcc-ab16524d6248bc92df21a63a0b5f71ec8cea168f.tar.gz
gcc-ab16524d6248bc92df21a63a0b5f71ec8cea168f.tar.bz2
configure.in: FILE variable overrides FLATFORM when linking natFileChannelXXX.cc.
* configure.in: FILE variable overrides FLATFORM when linking natFileChannelXXX.cc. * gnu/java/nio/channels/natFileChannelEcos.cc (diag_write): Restored. (write): Call diag_write, as in old natFileDescriptorEcos.cc. From-SVN: r79731
Diffstat (limited to 'libjava/gnu/java/nio/channels')
-rw-r--r--libjava/gnu/java/nio/channels/natFileChannelEcos.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/libjava/gnu/java/nio/channels/natFileChannelEcos.cc b/libjava/gnu/java/nio/channels/natFileChannelEcos.cc
index 568d802..78575e7 100644
--- a/libjava/gnu/java/nio/channels/natFileChannelEcos.cc
+++ b/libjava/gnu/java/nio/channels/natFileChannelEcos.cc
@@ -26,20 +26,32 @@ details. */
#include <java/lang/NullPointerException.h>
#include <java/lang/String.h>
#include <java/io/FileNotFoundException.h>
-#include <java/nio/MappedByteBufferImpl.h>
+#include <gnu/java/nio/MappedByteBufferImpl.h>
#include <java/nio/channels/FileChannel.h>
#include <java/nio/channels/FileLock.h>
#include <gnu/java/nio/channels/FileChannelImpl.h>
using gnu::gcj::RawData;
using java::io::IOException;
-using java::nio::MappedByteBufferImpl;
+using gnu::java::nio::MappedByteBufferImpl;
using java::io::InterruptedIOException;
using java::io::FileNotFoundException;
using java::lang::ArrayIndexOutOfBoundsException;
using java::lang::NullPointerException;
using gnu::java::nio::channels::FileChannelImpl;
+extern "C" void diag_write_char (char c);
+
+static void
+diag_write (char *data, int len)
+{
+ while (len > 0)
+ {
+ diag_write_char (*data++);
+ len--;
+ }
+}
+
#define NO_FSYNC_MESSAGE "sync unsupported"
void
@@ -78,6 +90,8 @@ FileChannelImpl::open (jstring, jint)
void
FileChannelImpl::write (jint)
{
+ char d = (char) b;
+ ::diag_write (&d, 1);
}
void
@@ -87,6 +101,8 @@ FileChannelImpl::write (jbyteArray b, jint offset, jint len)
throw new NullPointerException;
if (offset < 0 || len < 0 || offset + len > JvGetArrayLength (b))
throw new ArrayIndexOutOfBoundsException;
+ char *bytes = (char *)elements (b) + offset;
+ ::diag_write (bytes, len);
}
void