diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-03-20 06:06:12 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-03-20 06:06:12 +0000 |
commit | 626bd0b8f11596688d7bdd3da24e7003e59cec99 (patch) | |
tree | b492db8b5d3c0209d315e66e056abc85685e5041 /libjava/gnu | |
parent | 3927afe00736d112235414ba26efbb13f2830057 (diff) | |
download | gcc-626bd0b8f11596688d7bdd3da24e7003e59cec99.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79731 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu')
-rw-r--r-- | libjava/gnu/java/nio/channels/natFileChannelEcos.cc | 20 |
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 568d802dfd1..78575e7e66a 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 |