Subject: Re: Can't execute non-Cygwin applications after using socket().
From: "Paul G." <[email-masked]>
To: [email-masked]
Date: Sat, 4 Aug 2001 14:07:33 -0700

Hi folks,

	Not sure if the author of this is aware of the Win32api calls.  Nor am 
I sure which OS platform the author is using.  No matter, if the author 
is actually using Cygwin, then the author has access to the Win32api 
functions.
	Also, why not wait to make the socket() call until after the djgpp 
processes have been started (ie. put the socket() call within the djgpp 
apps).
	If, however, you are talking about A Unix socket(), then you will need 
to modify your djgpp to accomodate/facilitate a Unix socket interface 
or modify DJGPP source/executables to use a windows socket interface.

	The Unix Socket Interface and the Windows Socket Interface are two 
different things.  Doesn't matter that Win2k or WinXP are now assumed 
to be using Unix sockets.

On 4 Aug 2001, at 17:24, the Illustrious Edmund Horner wrote:

> Hello.
> 
> Background: I am using cygwin to develop a web-server like application.
> Part of this requires the ability to execute external commands in
> response to an HTTP request.  Thanks to what is probably an unrelated
> problem, I need to execute DJGPP-compiled executables, using the
> system() function.

	Why?  Are you talking about a djgpp system() function, a Cygwin/Unix-
like function or some other function?

	No matter, for Win32 based platforms, you use (Win9x/NT) 
CreateProcess() to launch any executables.  If you are using WinNT4 or 
better, you have the added ability to launch excecutables using the 
CreateProcessAsUser() Win32api function.

	These are both Win32api calls.  These particular Win32api calls could 
care less about the app in question as long as it is a windows 
executable (djgpp generates windows executables which may be launched 
from either Windows Explorer or command./cmd. executables).
	All the above mentioned operating systems (Win9x/NT4) care about is if 
the process they are launching is in fact a "valid Win32api 
executable".  I am assuming that your unmodified DJGPP executables are 
precompiled/pre-built using a Win32 based platform.

	Both of the functions mentioned above (CreateProcess() or 
CreateProcessAsUser() ) accomplish the same things, they just have 
different permission setting requirements.  Requirements which depend 
on the Windows platform in question (Win9x/NT4).

	In essence, CreateProcess() and CreateProcessAsUser() launch a new 
process and its' subsequent thread(s).  Again, the only requirement is 
that the function call noted has the proper syntax (in other words, is 
syntaxed properly).

	You can find out more about CreateProcess() and CreateProcessAsUser() 
from the msdn library.

[skip]

	Hope this helps.

	Paul G.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/