Christopher Friedt | 7 Feb 16:05
Picon

integer fd filedescriptor / mapping special files

Hi list -

I've been using this patch for years to a) allow access to the integer
file descriptor in jni as in [1], and b) to use the FileChannel.map()
method to map special files under linux using jamvm / classpath-0.98
(e.g. /dev/fb0).

Thought I would submit it to the list for inclusion in any new releases.

Feedback from any people wanting to validate is welcome.

If I recall correctly, one shortcoming is that the returned mapped
byte buffer is not 'direct'. Getting a direct map would require some
manipulation of fields in an underlying byte[] somewhere. Obviously, a
direct-mapped byte buffer would be more ideal. I think that requires
using some kind of Unsafe class somewhere, and I stopped at that
point. I don't mind doing the legwork for a direct mapped byte buffer
too, to make it for inclusion in the next release.

C

[1] http://www.kfu.com/~nsayer/Java/jni-filedesc.html
diff --git a/gnu/java/nio/FileChannelImpl.java b/gnu/java/nio/FileChannelImpl.java
index d4a374b..06fa205 100644
--- a/gnu/java/nio/FileChannelImpl.java
+++ b/gnu/java/nio/FileChannelImpl.java
@@ -176,7 +176,7 @@ public final class FileChannelImpl extends FileChannel
    *
(Continue reading)

Picon
Favicon

FYI: Final PR classpath/42390 Fixes

The following two patches I committed fix the remaining issues reported
in PR42390:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42390

1.  https://lists.gnu.org/archive/html/commit-classpath/2012-02/msg00002.html
Add missing security calls in DatagramSocket.connect.
2.  https://lists.gnu.org/archive/html/commit-classpath/2012-02/msg00003.html
Access properties in a privileged block to avoid inappropriate SecurityExceptions being thrown.

ChangeLog:

2012-02-08  Andrew John Hughes  <ahughes <at> redhat.com>

	PR classpath/42390
	* java/nio/channels/spi/SelectorProvider.java:
	(provider()): Retrieve property value using
	PrivilegedAction.
	* java/security/KeyStore.java:
	(getDefaultType()): Likewise.

2012-02-06  Andrew John Hughes  <ahughes <at> redhat.com>

	PR classpath/42390
	* java/net/DatagramSocket.java:
	(connect(InetAddress,int)): Add missing security
	checks which OpenJDK performs and we don't.  It's
	possible to initialise a DatagramSocket with null
	so we should also ensure we are bound.

(Continue reading)

Picon
Favicon

Remaining Locale Updates for RH712013

As promised, I've committed the remaining fixes for the locale issues
first discovered in the libgcj Fedora bug, RH712013:

https://bugzilla.redhat.com/show_bug.cgi?id=712013

The following commits finish the job:

1.  https://lists.gnu.org/archive/html/commit-classpath/2012-02/msg00001.html
This alters the cp-tools localegen tool so that it no longer overwrites elements
with the same path within the XML tree.  As an example, in the Welsh locale
(cy.xml in CLDR 1.6.0) there are two paths dates.calendars.calendar.months.monthContext
which are differentiated by the attribute type using the values "format" and "stand-alone".
The default one to use should be "format" but the cp-tools parser has been parsing this
one and then overwriting it with the stand-alone one (which occurs second in the XML file)
as it doesn't check whether there is already a value for that path.  This patch changes
the parser to retain a list of the elements with that path, not just a single one.
The property generator then picks the appropriate one from that list.
2.  https://lists.gnu.org/archive/html/commit-classpath/2012-02/msg00000.html
This patch just updates the locale data in Classpath with the results of using the updated
generator on CLDR 1.6.0.
3.  https://lists.gnu.org/archive/html/commit-classpath/2012-02/msg00005.html
This simple patch just stops the property generator from adding a trailing separator to
ordered list content (months, weekdays, etc.).  There was a FIXME for this in the code already.
4.  https://lists.gnu.org/archive/html/commit-classpath/2012-02/msg00004.html
This is again the corresponding Classpath patch which updates the data and removes the hack
that drops the last character of the input data.

All four patches are attached.
--

-- 
Andrew :)
(Continue reading)

Picon
Favicon

FYI: GStreamer -Werror build fix

I've applied the attached simple fix to the GStreamer sources to
remove an unused variable so that it will build with -Werror.

2012-02-15  Andrew John Hughes  <ahughes <at> redhat.com>

	* native/jni/gstreamer-peer/gst_classpath_src.c,
	(gst_classpath_src_class_init(GstClasspathSrcClass)):
	Remove unused gstelement_class.

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07
Index: native/jni/gstreamer-peer/gst_classpath_src.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/gstreamer-peer/gst_classpath_src.c,v
retrieving revision 1.1
diff -u -u -r1.1 gst_classpath_src.c
--- native/jni/gstreamer-peer/gst_classpath_src.c	18 Aug 2007 15:23:14 -0000	1.1
+++ native/jni/gstreamer-peer/gst_classpath_src.c	21 Feb 2012 00:14:09 -0000
@@ -163,14 +163,12 @@
 gst_classpath_src_class_init (GstClasspathSrcClass *klass)
 {
   GObjectClass *gobject_class;
(Continue reading)


Gmane