Commit Graph

25 Commits

Author SHA1 Message Date
Tom Tromey
8854e14c61 natFileChannelPosix.cc (mapImpl): Extend file, when writing, if it is too short.
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=205157
	* gnu/java/nio/channels/natFileChannelPosix.cc (mapImpl): Extend
	file, when writing, if it is too short.

From-SVN: r123447
2007-04-03 01:05:50 +00:00
David Daney
46ecc2bc5c re PR libgcj/31228 (Race condition between setting close-on-exec and Runtime.exec())
PR libgcj/31228
	* configure.ac: Add checks for getrlimit and sys/resource.h.
	* include/posix.h (_Jv_platform_close_on_exec): Remove.
	* include/config.h.in: Regenerate.
	* configure: Regenerate.
	* gnu/java/nio/channels/natFileChannelPosix.cc (open): Remove call to
	_Jv_platform_close_on_exec;
	* gnu/java/net/natPlainSocketImplPosix.cc (create): Likewise.
	(accept): Likewise.
	* gnu/java/net/natPlainDatagramSocketImplPosix.cc (create):Likewise.
	* java/lang/natPosixProcess.cc: Include sys/resource.h.
	(nativeSpawn): Close all file descriptors.  Don't set FD_CLOEXEC on
	pipes.

From-SVN: r123138
2007-03-23 00:06:41 +00:00
Michele Sandri
94468b1ceb 2007-01-28 Michele Sandri <gpointorama@gmail.com>
* gnu/java/nio/channels/natFileChannelWin32.cc
	(lock): Implemented.
	(unlock): Implemented.

From-SVN: r121265
2007-01-28 18:55:36 +00:00
Tom Tromey
97b8365caf Merged gcj-eclipse branch to trunk.
From-SVN: r120621
2007-01-09 19:58:05 +00:00
Tom Tromey
143145daa4 sources.am, [...]: Rebuilt.
* sources.am, Makefile.in: Rebuilt.
	* java/util/logging/LogManager.java: Removed.
	* java/util/logging/Logger.java (resetLogger): New method, from
	Classpath.
	* java/io/RandomAccessFile.java: Removed.
	* gnu/java/nio/channels/FileChannelImpl.java (create): New
	method.
	(FileChannelImpl): Now private.
	* java/io/FileInputStream.java: Removed.
	* java/io/FileOutputStream.java: Removed.
	* java/security/AccessControlContext.java: Removed.
	* java/lang/ThreadLocal.java: Removed.
	* java/lang/InheritableThreadLocal.java: Removed.
	* java/lang/Thread.java (locals): New field.
	(getThreadLocals): New method.
	* java/lang/natThread.cc (finish_): Clear 'locals'.

From-SVN: r113735
2006-05-13 02:16:22 +00:00
Tom Tromey
37e7dc121d natFileChannelPosix.cc (write): Properly handle EINTR.
* gnu/java/nio/channels/natFileChannelPosix.cc (write): Properly
	handle EINTR.

From-SVN: r113082
2006-04-19 17:01:53 +00:00
Kelley Cook
917b04f492 Update FSF address
From-SVN: r101453
2005-06-30 03:22:09 +00:00
Bryce McKinlay
2a2ea37674 re PR libgcj/21821 (MAXPATHLEN usage in libjava)
2005-05-30  Bryce McKinlay  <mckinlay@redhat.com>

	PR libgcj/21821
	* gnu/java/nio/channels/natFileChannelPosix.cc (open): Don't use
	MAXPATHLEN. Format exception message using a StringBuffer instead.

From-SVN: r100364
2005-05-30 17:02:38 +01:00
Andrew Overholt
f525d7a75f re PR libgcj/21372 (FileChannel.tryLock() return value incorrect)
2005-05-03  Andrew Overholt  <overholt@redhat.com>

	PR libgcj/21372:
	* gnu/java/nio/channels/FileChannelImpl.java: Return null if lock
	could not be acquired.
	* java/nio/channels/FileLock.java (toString): Re-implement to be
	in line with other implementations.

From-SVN: r99188
2005-05-03 22:38:17 +00:00
Dalibor Topic
b61ae8b261 2005-04-29 Dalibor Topic <robilad@kaffe.org>
* java/nio/channels/FileChannelImpl.java
	(FileChannelImpl(String, int)): Removed.
	(FileChannelImpl(File, int)): Added. Check if opened file is a
	directory.
	* java/io/FileInputStream.java(FileInputStream): Fixed javadocs.
	Call FileChannelImpl(File, int).
	* java/io/FileOutputStream.java (FileInputStream): Call
	FileChannelImpl(File, int).
	* java/io/RandomAccessFile.java (RandomAccessFile):
	Call FileChannelImpl(File, int). Switched constructors around.

From-SVN: r99011
2005-04-29 18:47:42 +00:00
Luca Barbieri
31f0451e7e re PR libgcj/21136 ([4.0 only] tryLock waits for the lock, and lock doesn't)
2005-04-26  Luca Barbieri  <luca.barbieri@gmail.com>

	PR libgcj/21136:
	* gnu/java/nio/channels/FileChannelImpl.java (tryLock): Pass
	'false' to native lock().
	(lock): Pass 'true' to native lock().

From-SVN: r98792
2005-04-26 21:49:23 +00:00
Andrew Haley
4fd24a7582 FileChannelImpl.java (smallTransferFrom): New.
2005-03-09  Andrew Haley  <aph@redhat.com>

        * gnu/java/nio/channels/FileChannelImpl.java (smallTransferFrom):
        New.
        (smallTransferTo): New.
        (transferFrom): Loop around smallTransferFrom, copying pageSize
        bytes each time.
        (transferTo): Likewise.

From-SVN: r96240
2005-03-10 15:29:15 +00:00
Ito Kazumitsu
7801fed43d FileChannelImpl.java (write(ByteBuffer)): Move the position of the source buffer forward.
2005-02-17  Ito Kazumitsu  <kaz@maczuka.gcd.org>

	* gnu/java/nio/channels/FileChannelImpl.java (write(ByteBuffer)):
	Move the position of the source buffer forward.

From-SVN: r95184
2005-02-17 19:51:25 +00:00
Casey Marshall
2941ddc40c FileLock.java (isValid): locks are valid if the channel is open.
2004-11-11  Casey Marshall  <csm@gnu.org>

	* gnu/java/nio/FileLock.java (isValid): locks are valid if the
	channel is open.
	* gnu/java/nio/channels/natFileChannelPosix.cc (lock): use
	'F_RDLCK' for shared locks, 'F_WRLCK' for exclusive locks.

From-SVN: r90538
2004-11-12 19:15:27 +00:00
Ulrich Weigand
b228bf7fd2 * gnu/java/nio/channels/natFileChannelPosix.cc
(FileChannelImpl::available): Call FIONREAD ioctl with 'int *'
	argument instead of 'long *'.

From-SVN: r89391
2004-10-21 18:21:00 +00:00
Michael Koch
baa61e09ef [multiple changes]
2004-07-17  Mark Wielaard  <mark@klomp.org>

	* gnu/java/nio/channels/FileChannelImpl.java (truncate): Only truncate
	when size is smaller.
	* java/io/RandomAccessFile.java (setLength): Use truncate for
	shrinking the file and seek plus write for expanding the file.

2004-07-17  Michael Koch  <konqueror@gmx.de>

	* gnu/java/nio/channels/natFileChannelPosix.cc
	(implTruncate): Always save current position. Only reposition file
	pointer to where we started if not beyond new lenght. Reposition file
	pointer to file length if it points beyond the end of file.

From-SVN: r84868
2004-07-17 13:46:02 +00:00
Michael Koch
2ccc5a9508 2004-07-17 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/channels/FileChannelImpl.java
	(finalize): Added javadoc.

From-SVN: r84858
2004-07-17 08:48:31 +00:00
Mark Wielaard
af62fd128a 2004-05-04 Mark Wielaard <mark@klomp.org>
* gnu/java/nio/channels/FileChannelImpl.java
	(finalize): New method.

From-SVN: r81469
2004-05-04 05:32:46 +00:00
Michael Koch
87939d70f8 2004-04-23 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/channels/FileChannelImpl.java
	(SET, CUR): Unused, removed.
	(read): Implement here directly.
	(implRead): Removed.
	(write): Implement here directly.
	(implWrite): Removed.

From-SVN: r81079
2004-04-23 06:56:34 +00:00
Michael Koch
0150fc2287 2004-04-20 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileLockImpl.java
	(static): Removed, not needed anymore.
	* gnu/java/nio/channels/FileChannelImpl.java
	(FileChannelImpl): Made final.
	(mode): Made private.
	(READ, WRITE, APPEND): Made public.
	(EXCL, SYNC, DSYNC): Likewise.
	(static): Load native JNI library, when needed.
	(length): Unused, removed.
	(available): Made public.
	(implPosition): Throws IOException.
	(seek): Likewise.
	(implTruncate): Likewise.
	(unlock): Likewise.
	(lock): Likewise.

From-SVN: r80891
2004-04-20 10:43:48 +00:00
Per Bothner
ab16524d62 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
2004-03-19 22:06:12 -08:00
Rainer Orth
acc63e4c3d natFileChannelPosix.cc (mapImpl): Cast MAP_FAILED to void *.
* gnu/java/nio/channels/natFileChannelPosix.cc (mapImpl): Cast
	MAP_FAILED to void *.

From-SVN: r79627
2004-03-18 17:23:53 +00:00
Andreas Tobler
406c98b264 natFileChannelPosix.cc: Implement munmap_adaptor and msync_adaptor for older POSIX_C_SOURCES specs.
2004-03-14  Andreas Tobler <a.tobler@schweiz.ch>

	* gnu/java/nio/channels/natFileChannelPosix.cc: Implement
	munmap_adaptor and msync_adaptor for older POSIX_C_SOURCES specs.
	(MappedByteBufferImpl::unmapImpl): Use munmap_adaptor.
	(MappedByteBufferImpl::forceImpl): Use msync_adptor.

From-SVN: r79462
2004-03-14 00:07:58 +01:00
Michael Koch
1a4f6839c0 natFileChannelEcos.cc: Totally reworked.
2004-03-11  Michael Koch  <konqueror@gmx.de>

	* gnu/java/nio/channels/natFileChannelEcos.cc: Totally reworked.
	This file was was just copied form java/io/natFileDescriptorEcos.cc
	and never changed to compile correctly.

From-SVN: r79320
2004-03-11 13:35:45 +00:00
Per Bothner
612e660987 FileChannelImpl.java: New class, renamed from java/nio/channels.
* gnu/java/nio/channels/FileChannelImpl.java:  New class, renamed
	from java/nio/channels.  Don't depend on FileDescriptor.
	(in, out, err):  New static fields.
	(mode):  New field.
	(SET, CUR, READ, WRITE, APPEND, EXCL, SYNC, DSYNC):  Moved constants
	from FileDescriptor.
	(by):  Removed MappedByteBuffer field.
	(map):  New working implementation.
	* gnu/java/nio/channels/natFileChannelPosix.cc:  New file, though
	some code "ported" from natFileDescriptoPosix.cc.
	* gnu/java/nio/channels/natFileChannelEcos.cc:  Likewise.
	* gnu/java/nio/channels/natFileChannelWin32.cc  Likewise.

From-SVN: r78659
2004-02-29 11:09:28 -08:00