summaryrefslogtreecommitdiff
path: root/libjava/java/io/natFileDescriptorPosix.cc
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 09:13:31 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 09:13:31 +0000
commit8e2dc45759a8a549740954370f10c4973ee2aa52 (patch)
tree4f31beddee142afb687e3a3b376d800f72755434 /libjava/java/io/natFileDescriptorPosix.cc
parentd957c480ac27a47b83b7d3e7b6e5105cdcd18573 (diff)
downloadgcc-8e2dc45759a8a549740954370f10c4973ee2aa52.tar.gz
2003-05-13 Michael Koch <konqueror@gmx.de>
* java/io/FileDescriptor.java (SYNC): New constant. (DSYNC): Likewise. (getLength): Renamed from lenght() to match classpath's FileDescriptor.java. * java/io/RandomAccessFile.java (RandomAccessFile): Removed unneeded mode check, implemented mode "rws" and "rwd", merged documentation from classpath. (setLength): Reformatted. (length): Use new getLength() of FileDescriptor. * java/io/natFileDescriptorEcos.cc (getLength): Renamed from length(). * java/io/natFileDescriptorPosix.cc (open): Implemented support for SYNC and DSYNC. (seek): Use getLength() instead of length(). (getLength): Renamed from length(). * java/io/natFileDescriptorWin32.cc (getLength): Renamed from length(). (seek): Use getLength() instead of length(). (available): Likewise. * gnu/java/nio/natFileChannelImpl.cc (size): Use getLength() instead of length(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66755 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/io/natFileDescriptorPosix.cc')
-rw-r--r--libjava/java/io/natFileDescriptorPosix.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libjava/java/io/natFileDescriptorPosix.cc b/libjava/java/io/natFileDescriptorPosix.cc
index ad1dcc49c32..2ad2d9dce77 100644
--- a/libjava/java/io/natFileDescriptorPosix.cc
+++ b/libjava/java/io/natFileDescriptorPosix.cc
@@ -105,6 +105,12 @@ java::io::FileDescriptor::open (jstring path, jint jflags)
}
}
+ if ((jflags & SYNC))
+ flags |= O_SYNC;
+
+ if ((jflags & DSYNC))
+ flags |= O_DSYNC;
+
int fd = ::open (buf, flags, mode);
if (fd == -1 && errno == EMFILE)
{
@@ -233,7 +239,7 @@ java::io::FileDescriptor::seek (jlong pos, jint whence, jboolean eof_trunc)
if (eof_trunc)
{
- jlong len = length ();
+ jlong len = getLength ();
if (whence == SET)
{
if (pos > len)
@@ -258,7 +264,7 @@ java::io::FileDescriptor::seek (jlong pos, jint whence, jboolean eof_trunc)
}
jlong
-java::io::FileDescriptor::length (void)
+java::io::FileDescriptor::getLength (void)
{
struct stat sb;
if (::fstat (fd, &sb))