aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/PosixProcess.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>1999-05-12 11:23:44 +0000
committerTom Tromey <tromey@gcc.gnu.org>1999-05-12 11:23:44 +0000
commit42962a480a755c0f72ff8de60a6de1fbfc85affd (patch)
treeabd228e8accc8f1b67bdf10c59963d3a1cc6047f /libjava/java/lang/PosixProcess.java
parent3b551e09f129c36d08e8c9635e1dab299e022fa3 (diff)
downloadgcc-42962a480a755c0f72ff8de60a6de1fbfc85affd.zip
gcc-42962a480a755c0f72ff8de60a6de1fbfc85affd.tar.gz
gcc-42962a480a755c0f72ff8de60a6de1fbfc85affd.tar.bz2
javaprims.h: Updated namespace declarations.
* include/javaprims.h: Updated namespace declarations. * classes.pl (scan): Uniquify class list. * Makefile.in, configure: Rebuilt. * Makefile.am (nat_source_files): Added natConcreteProcess.cc. (built_java_source_files): New macro. (nat_headers): Added built_java_source_files. (javao_files): Likewise. (EXTRA_libgcj_la_SOURCES): Likewise. (libgcj.zip): Create built class files. ($(built_java_source_files:.java=.class)): New target. (jv_convert_LDADD): Added -L$(here)/.libs. * configure.in: Create links for ConcreteProcess.java and natConcreteProcess.cc. * java/lang/Runtime.java (exec): Create a ConcreteProcess. * java/lang/natEcosProcess.cc: New file. * java/lang/EcosProcess.java: New file. * java/lang/PosixProcess.java: New file. * java/lang/natPosixProcess.cc: New file. From-SVN: r26901
Diffstat (limited to 'libjava/java/lang/PosixProcess.java')
-rw-r--r--libjava/java/lang/PosixProcess.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/libjava/java/lang/PosixProcess.java b/libjava/java/lang/PosixProcess.java
new file mode 100644
index 0000000..396287a
--- /dev/null
+++ b/libjava/java/lang/PosixProcess.java
@@ -0,0 +1,74 @@
+// PosixProcess.java - Subclass of Process for POSIX systems.
+
+/* Copyright (C) 1998, 1999 Cygnus Solutions
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+package java.lang;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date May 3, 1999
+ */
+
+// This is entirely internal to our implementation.
+
+// This file is copied to `ConcreteProcess.java' before compilation.
+// Hence the class name apparently does not match the file name.
+final class ConcreteProcess extends Process
+{
+ public native void destroy ();
+ public native int exitValue ();
+
+ public InputStream getErrorStream ()
+ {
+ return errorStream;
+ }
+
+ public InputStream getInputStream ()
+ {
+ return inputStream;
+ }
+
+ public OutputStream getOutputStream ()
+ {
+ return outputStream;
+ }
+
+ public native int waitFor () throws InterruptedException;
+
+ // This is used for actual initialization, as we can't write a
+ // native constructor.
+ public native void startProcess (String[] progarray, String[] envp)
+ throws IOException;
+
+ // This file is copied to `ConcreteProcess.java' before
+ // compilation. Hence the constructor name apparently does not
+ // match the file name.
+ public ConcreteProcess (String[] progarray, String[] envp) throws IOException
+ {
+ startProcess (progarray, envp);
+ }
+
+ // The process id. This is cast to a pid_t on the native side.
+ private long pid;
+
+ // True when child has exited.
+ private boolean hasExited;
+
+ // The exit status, if the child has exited.
+ private int status;
+
+ // The streams.
+ private InputStream errorStream;
+ private InputStream inputStream;
+ private OutputStream outputStream;
+}