diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java | |
parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
download | ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.zip |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java')
-rw-r--r-- | libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java b/libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java index 11dd2aa7b4b..e5257c1cf96 100644 --- a/libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java +++ b/libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java @@ -38,7 +38,6 @@ exception statement from your version. */ package gnu.java.nio; import java.io.IOException; -import java.nio.channels.spi.SelectorProvider; import gnu.classpath.Configuration; /** @@ -58,7 +57,24 @@ final class VMPipe System.loadLibrary ("javanio"); } } - - static native void init(PipeImpl self, SelectorProvider provider) - throws IOException; + + /** + * Create a pipe, consisting of a readable VMChannel and a writable + * VMChannel. The readable channel is returned is the first element + * of the array, and the writable in the second. + * + * @return A pair of VMChannels; the first readable, the second + * writable. + * @throws IOException If the pipe cannot be created. + */ + static VMChannel[] pipe() throws IOException + { + VMChannel[] pipe = new VMChannel[2]; + int[] fds = pipe0(); + pipe[0] = new VMChannel(fds[0]); + pipe[1] = new VMChannel(fds[1]); + return pipe; + } + + private static native int[] pipe0() throws IOException; } |