This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.io.FileDescriptor
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Fri, 23 Jan 2004 13:33:47 +0100
- Subject: FYI: Patch: java.io.FileDescriptor
Hi list,
I just commited the attached patch to merge java.io.FileDescriptor more with
classpath.
Michael
2004-01-23 Michael Koch <konqueror@gmx.de>
* java/io/FileDescriptor.java
(in, out, err): Added javadoc.
(static): Merged loading code.
(fd, position): Moved around.
Index: java/io/FileDescriptor.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/FileDescriptor.java,v
retrieving revision 1.14
diff -u -b -B -r1.14 FileDescriptor.java
--- java/io/FileDescriptor.java 23 Jan 2004 11:45:54 -0000 1.14
+++ java/io/FileDescriptor.java 23 Jan 2004 12:28:37 -0000
@@ -39,19 +39,38 @@
package java.io;
+import gnu.classpath.Configuration;
+
/**
* This class represents an opaque file handle as a Java class. It should
* be used only to pass to other methods that expect an object of this
* type. No system specific information can be obtained from this object.
*
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey (tromey@cygnus.com)
* @date September 24, 1998
*/
public final class FileDescriptor
{
-
+ /**
+ * A <code>FileDescriptor</code> representing the system standard input
+ * stream. This will usually be accessed through the
+ * <code>System.in</code>variable.
+ */
public static final FileDescriptor in = null;
+
+ /**
+ * A <code>FileDescriptor</code> representing the system standard output
+ * stream. This will usually be accessed through the
+ * <code>System.out</code>variable.
+ */
public static final FileDescriptor out = null;
+
+ /**
+ * A <code>FileDescriptor</code> representing the system standard error
+ * stream. This will usually be accessed through the
+ * <code>System.err</code>variable.
+ */
public static final FileDescriptor err = null;
private static native void init();
@@ -55,8 +74,14 @@
public static final FileDescriptor err = null;
private static native void init();
+
static
{
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary("javaio");
+ }
+
init();
}
@@ -77,9 +102,22 @@
static final int SYNC = 16;
static final int DSYNC = 32;
+ /**
+ * This is the actual native file descriptor value
+ */
+ // System's notion of file descriptor. It might seem redundant to
+ // initialize this given that it is reassigned in the constructors.
+ // However, this is necessary because if open() throws an exception
+ // we want to make sure this has the value -1. This is the most
+ // efficient way to accomplish that.
+ private int fd = -1;
+
+ private long position = 0;
- // This constructor is specified to create an invalid descriptor.
- public FileDescriptor ()
+ /**
+ * This method is used to initialize an invalid FileDescriptor object.
+ */
+ public FileDescriptor()
{
}
@@ -124,12 +162,5 @@
fd = desc;
}
- // System's notion of file descriptor. It might seem redundant to
- // initialize this given that it is reassigned in the constructors.
- // However, this is necessary because if open() throws an exception
- // we want to make sure this has the value -1. This is the most
- // efficient way to accomplish that.
- private int fd = -1;
- private long position = 0;
}