changeset 6222:07d967f75dba

[project @ 2007-01-03 20:15:15 by jwe]
author jwe
date Wed, 03 Jan 2007 20:15:16 +0000
parents 8e0f1eda266b
children a6cc01dd09f9
files scripts/sparse/normest.m src/ChangeLog src/toplev.cc
diffstat 3 files changed, 24 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/sparse/normest.m	Wed Jan 03 17:23:34 2007 +0000
+++ b/scripts/sparse/normest.m	Wed Jan 03 20:15:16 2007 +0000
@@ -1,5 +1,4 @@
-## Copyright (C) 2006 David Bateman
-## Copyright (C) 2006 Marco Caliari
+## Copyright (C) 2006 David Bateman and Marco Caliari
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -18,10 +17,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{n}, @var{c}] =} normest (@var{a}, @var{tol})
-##
-## Estimates the 2-norm of the matrix @var{a} using a power series
+## Estimate the 2-norm of the matrix @var{a} using a power series
 ## analysis. This is typically used for large matrices, where the cost
-## of calculating the @code{norm{@var{a})} is prohibitive and an approximation
+## of calculating the @code{norm (@var{a})} is prohibitive and an approximation
 ## to the 2-norm is acceptable.
 ##
 ## @var{tol} is the tolerance to which the 2-norm is calculated. By default
--- a/src/ChangeLog	Wed Jan 03 17:23:34 2007 +0000
+++ b/src/ChangeLog	Wed Jan 03 20:15:16 2007 +0000
@@ -1,3 +1,7 @@
+2007-01-03  Michael Goffioul  <michael.goffioul@swing.be>
+
+	* toplev.cc (Fsystem): Handle async calls on Windows systems.
+
 2007-01-03  David Bateman  <dbateman@free.fr>
 
 	* (OPERATORS/op-cm-scm.cc, OPERATORS/op-cm-sm.cc, 
--- a/src/toplev.cc	Wed Jan 03 17:23:34 2007 +0000
+++ b/src/toplev.cc	Wed Jan 03 20:15:16 2007 +0000
@@ -542,6 +542,7 @@
 	{
 	  if (type == et_async)
 	    {
+	      // FIXME -- maybe this should go in sysdep.cc?
 #ifdef HAVE_FORK
 	      pid_t pid = fork ();
 
@@ -559,6 +560,22 @@
 		}
 	      else
 		retval(0) = pid;
+#elif defined (__WIN32__)
+              STARTUPINFO si;
+              PROCESS_INFORMATION pi;
+              ZeroMemory (&si, sizeof (si));
+              ZeroMemory (&pi, sizeof (pi));
+	      OCTAVE_LOCAL_BUFFER (char, xcmd_str, cmd_str.length()+1);
+	      strcpy (xcmd_str, cmd_str.c_str ())
+
+              if (! CreateProcess (0, xcmd_str, 0, 0, FALSE, 0, 0, 0, &si, &pi))
+                error ("system: CreateProcess failed -- can't create child process");
+              else
+                {
+                  retval(0) = pi.dwProcessId;
+                  CloseHandle (pi.hProcess);
+                  CloseHandle (pi.hThread);
+                }
 #else
  	      error ("asynchronous system calls are not supported");
 #endif