public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Prototype jni/Pipe.
@ 2008-05-22  1:54 cagney
  0 siblings, 0 replies; only message in thread
From: cagney @ 2008-05-22  1:54 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  6b1edf3fd6d721ae29fd96c54c70bde00920430c (commit)
      from  d32811fe5f691be4fe7d8491b5129811dbdcd931 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 6b1edf3fd6d721ae29fd96c54c70bde00920430c
Author: Andrew Cagney <cagney@redhat.com>
Date:   Wed May 21 21:52:29 2008 -0400

    Prototype jni/Pipe.

-----------------------------------------------------------------------

Summary of changes:
 frysk-sys/frysk/sys/ChangeLog    |    2 ++
 frysk-sys/frysk/sys/jni/Pipe.cxx |   27 ++++++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletions(-)

First 500 lines of diff:
diff --git a/frysk-sys/frysk/sys/ChangeLog b/frysk-sys/frysk/sys/ChangeLog
index c2a024d..2f3a67b 100644
--- a/frysk-sys/frysk/sys/ChangeLog
+++ b/frysk-sys/frysk/sys/ChangeLog
@@ -1,5 +1,7 @@
 2008-05-21  Andrew Cagney  <cagney@redhat.com>
 
+	* jni/Pipe.cxx: Implement.
+
 	* Environ.java (putEnvironment(String[])): Change parameter from
 	Object[] to String[].
 	* jni/Environ.cxx: Implement.
diff --git a/frysk-sys/frysk/sys/jni/Pipe.cxx b/frysk-sys/frysk/sys/jni/Pipe.cxx
index b358932..4b94701 100644
--- a/frysk-sys/frysk/sys/jni/Pipe.cxx
+++ b/frysk-sys/frysk/sys/jni/Pipe.cxx
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2008, Red Hat Inc.
+// Copyright 2007, 2008 Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -37,4 +37,29 @@
 // version and license this file solely under the GPL without
 // exception.
 
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+
 #include "jni.hxx"
+
+#include "jnixx/exceptions.hxx"
+
+using namespace java::lang;
+using namespace frysk::sys;
+
+jnixx::array<FileDescriptor>
+Pipe::pipe(jnixx::env env) {
+  const int nfds = 2;
+  int filedes[nfds];
+  if (::pipe (filedes) < 0) {
+    errnoException(env, errno, "pipe");
+  }
+  // printf ("pipe [%d, %d]\n", filedes[0], filedes[1]);
+  jnixx::array<FileDescriptor> fds
+    = jnixx::array<FileDescriptor>::NewObjectArray(env, nfds);
+  for (int i = 0; i < nfds; i++) {
+    fds.SetObjectArrayElement(env, i, FileDescriptor::New(env, filedes[i]));
+  }
+  return fds;
+}


hooks/post-receive
--
frysk system monitor/debugger


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-22  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-22  1:54 [SCM] master: Prototype jni/Pipe cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).