[M3devel] NT386GNU status/fishing for guesses..
Jay
jayk123 at hotmail.com
Sat Feb 16 20:37:46 CET 2008
Ok, is this reasonable for all platforms? Otherwise I can push into Unix.m3.
===================================================================RCS file: /usr/cvs/cm3/m3-libs/libm3/src/os/POSIX/ProcessPosix.m3,vretrieving revision 1.6diff -u -r1.6 ProcessPosix.m3--- ProcessPosix.m3 29 Nov 2007 05:05:56 -0000 1.6+++ ProcessPosix.m3 16 Feb 2008 19:36:08 -0000@@ -266,6 +266,9 @@ (* Make file descriptor "fd" refer to file "h", or set "fd"'s close-on-exec flag if "h=NoFile". Return "TRUE" if succesful. *) BEGIN+ IF fd = h THEN+ RETURN TRUE;+ END; IF h # NoFileDescriptor THEN RETURN NOT Unix.dup2(h, fd) < 0 ELSIF Unix.fcntl(fd, Unix.F_SETFD, 1) >= 0 THEN
- Jay
From: jayk123 at hotmail.comTo: m3devel at elegosoft.comDate: Sat, 16 Feb 2008 19:30:01 +0000Subject: [M3devel] NT386GNU status/fishing for guesses..
PROCEDURE ExecChild( argx: ArrCStr; (* see "AllocArgs" for layout *) envp: Ctypes.char_star_star; wdstr: Ctypes.char_star; stdin, stdout, stderr: INTEGER) : INTEGER RAISES {} =(* Modify Unix state using "stdin", ..., and invoke execve using "argx" and "envp". Do not invoke scheduler, allocator, or exceptions. Return only if a fatal Unix error is encountered, in which case Cerrno.GetErrno() is set. *) VAR res := 0; t: Ctypes.char_star; BEGIN IF wdstr # NIL THEN IF Unix.chdir(wdstr) < 0 THEN RETURN -1; END END;(* IF NOT (SetFd(0, stdin) AND SetFd(1, stdout) AND SetFd(2, stderr)) THEN RETURN -1; END; FOR fd := 3 TO Unix.getdtablesize() - 1 DO EVAL Unix.close(fd) (* ignore errors *) END;*)Without those lines commented out, only ever one file gets compiled.The process create for the second cm3cg fails (but not for the first as).Nearby code uses 99 for the exit code. With these commented out, it proceeds to compile everything (at least in one directory). Some combinations of the one block vs. the other (I realize there's only four cominations total) go and compile everything but claim failure at the end. Different point is that subsequent runs of cm3 always recompile everything.Probably the timestamps are misunderstood. I need to check the stat structure. Any one have any wild guesses on the process create angle?I figured this out with strace.The SetFd calls lead to dup failing because 0 isn't open. The Cygwin code is all very gnarly.For example when you do vfork + exec, it seems to relaunch the current .executable first (with kernel32.dll CreateProcess) and then child executables -- running cm3cg+as on just one file takes six CreateProcess calls -- cm3, sh, cm3cg, cm3, sh, as. I wonder if "Services for Unix" would satisfy folks at least as well as Cygwin. It is a free (beer) download.. - Jay
Need to know the score, the latest news, or you need your Hotmail®-get your "fix". Check it out.
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080216/5171b48d/attachment-0002.html>
More information about the M3devel
mailing list