public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: cagney@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Prototype jni/Pipe.
Date: Thu, 22 May 2008 01:54:00 -0000	[thread overview]
Message-ID: <20080522015423.21939.qmail@sourceware.org> (raw)

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


                 reply	other threads:[~2008-05-22  1:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080522015423.21939.qmail@sourceware.org \
    --to=cagney@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).