OS.system under Windows: The never-ending story?

Sameh El-Ansary sameh at sics.se
Mon Sep 17 15:02:27 CEST 2001


Hi,
Currently I can respond to question number 2 only.

For the COMSPEC, we have checked Microsoft source code for system() and it
checked for the COMPSEC first,
if it did not find it it constructs the cmd.exe/command.com path. We took
the general case of constructing
the path ourselves, that was the rationale. I am attaching the source file
from:
"****\Microsoft Visual Studio\VC98\CRT\SRC" in case you do not have the
source for the MS stdlib implementation
installed.

I will try with Dragan right now to construct the case that made us
deliberately not to inherit stdin.

Regards,
=============================
Sameh El-Ansary
Researcher, Distributed Systems Lab.
Swedish Institute of Computer Science(SICS)
Box 1263, SE-164 29 Kista, Sweden
Phone : +46 8 633 1583
Mobile: +46 73 0452197
Fax   : +46 8 751 7230
http://www.sics.se/~sameh

> -----Original Message-----
> From: kornstae at amy.ps.uni-sb.de [mailto:kornstae at amy.ps.uni-sb.de]On
> Behalf Of Leif Kornstaedt
> Sent: Friday, September 14, 2001 3:33 PM
> To: hackers at mozart-oz.org
> Cc: dragan at sics.se; sameh at sics.se
> Subject: OS.system under Windows: The never-ending story?
>
>
> Dear Oz hackers,
>
> we have had to put up quite some struggle for the
> implementation of OS.system for Windows, as some of
> you may have noticed.  I still have some unanswered
> questions regarding our implementation.  Maybe
> somebody can give some answer to these.
>
> Just to give a little context:
>
> Under Windows 98, we use the `system' function
> provided by the Microsoft Visual C runtime (MSVCRT).
> This did not work under Windows NT 4 (the call never
> returned), so we wrote our own.
>
> Now the questions:
>
> 1. Under Windows 98, the `system' function does not
>    seem to work properly either, as Denys reports.
>    Apparently it works the first time, but when called
>    a second time with the same command, it fails with
>    `Bad command or file name'.  Should we provide our
>    own custom implementation for Windows 9x as well?
>
> 2. Why do we build a path to cmd.exe ourselves instead
>    of using COMSPEC?  I believe we should be using
>    COMSPEC, as this is how `system' is defined (it
>    uses the shell specified by the user).
>
> 3. Dragan and Sameh claim:
>    "We have to supply to the child process the STDOUT
>    and STDERR BUT NOT STDIN or else the parent process
>    will block it."
>
>    I'm not sure that this claim still holds since I have
>    reimplemented this thing - what I tested worked.
>    However, I do not have the test case with which Dragan
>    and Sameh observed the problem.  I suggest we now
>    inherit standard input (for details, look at the
>    code I bracketed with the OS_SYSTEM_INHERITS_STDIN
>    macro).  Does anybody object to this?  Dragan?  Sameh?
>
> Thanks for your comments,
> Leif.
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SYSTEM.C
Type: application/octet-stream
Size: 2335 bytes
Desc: not available
Url : http://lists.gforge.info.ucl.ac.be/pipermail/mozart-hackers/attachments/20010917/0e8ab15c/SYSTEM.obj


More information about the mozart-hackers mailing list