aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-01-23 12:29:05 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2004-01-23 12:29:05 +0000
commit8fac50e006cada9c19b2099bc39e8f2578bf42da (patch)
tree5753c333517b9c1597130269afde3b5a8152cf62 /libjava
parent58cc47894986d201a9f1a40710d903309be7d066 (diff)
downloadgcc-8fac50e006cada9c19b2099bc39e8f2578bf42da.zip
gcc-8fac50e006cada9c19b2099bc39e8f2578bf42da.tar.gz
gcc-8fac50e006cada9c19b2099bc39e8f2578bf42da.tar.bz2
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. From-SVN: r76411
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/java/io/FileDescriptor.java57
2 files changed, 51 insertions, 13 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index cdede41..fe374fd 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,12 @@
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.
+
+2004-01-23 Michael Koch <konqueror@gmx.de>
+
* gnu/java/awt/doc-files/BitwiseXORComposite-1.png:
New file.
diff --git a/libjava/java/io/FileDescriptor.java b/libjava/java/io/FileDescriptor.java
index 52626e3..c7fd6ed 100644
--- a/libjava/java/io/FileDescriptor.java
+++ b/libjava/java/io/FileDescriptor.java
@@ -39,26 +39,51 @@ exception statement from your version. */
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();
+
static
- {
- init();
- }
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary("javaio");
+ }
+
+ init();
+ }
public native void sync () throws SyncFailedException;
public native boolean valid ();
@@ -77,9 +102,22 @@ public final class FileDescriptor
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 @@ public final class FileDescriptor
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;
}