httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Wan-Teh Chang)
Subject Re: inherited file descriptors on win32...
Date Sun, 10 May 1998 19:30:49 GMT

Paul Sutton wrote:

> By default, handles opened by Win32 API functions are normally not
> inheritable. So children won't get the events opened by OpenEvent or
> mutexes from CreateMutex. But the C runtime calls, such as fopen, default
> to returning inheritable handles, so yes the child will get them.
> Probably.
> Using CreateProcess instead of spawn* could prevent inheritence.

Just want to say that I would avoid using the spawn* functions from
MSVC's libc (run time library):
1.  It fails on Compaq PCs if your PATH contains nonexistent directories.
     Maybe this is Compaq's fault, but ...
2. I remember its command-line argument parsing does not conform to
   Microsoft's standard.  I was really surprised to discover this when I
   was trying to make our own Win32 port of GNU make to pass
   short shell scripts as command line arguments to MKS's Korn Shell.

    If you don't pass complicated command-line argumentw with lots
    of quoting and backslashes, then using spawn* should be fine.
    But maybe you do.  Also, problem 1 above really sucks.

I think NSPR's PR_CreateProcess on WIN32 is pretty good in
dealing with these problems.  It still has some kinks to iron out
(such as not automatically trying .bat, .cmd, .com as file extensions
of executable programs or DOS batch files), but it's not hard..


View raw message