From: dimm@vnet.ibm.com
Subject: Re: Cygwin ports as services under NT?
2 Dec 1996 05:39:44 -0800
Sender: daemon@cygnus.com
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <329D6E63.41C6.cygnus.gnu-win32@vnet.ibm.com>
References: <1.5.4.32.19961126162549.0062f7f0@vault.healthcare.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.02 (X11; I; AIX 1)
Original-To: gnu-win32@cygnus.com
Original-CC: "Dm. Makarov" <dimm@vnet.ibm.com>
Original-Sender: owner-gnu-win32@cygnus.com

> >> Anyone explored the possibilities of running cygwin programs as services
> >> under NT?
> >
> >I can't think of any reason why you wouldn't be able to do that. As long
> >as you can create structs with longs in them and callback functions, and
> >as long as you can call DLL functions, you should be fine.
> >-
> 
> Services must be multithreaded, so you need to be able to handle that.

I don't think it's really the point. There actually has to be only one thread
besides the process' main thread, the one that is produced by the call to
StartServiceCtrlDispatcher (Service_Table);
It's true that it's convenient to make a service multithreaded, at least to be
able easily pause and resume it, but there's no such a requirement at all.

I just don't see how one using cygwin32 gcc can build an application that uses
Win32 SDK API. Say you need to use winsvc.h #include file for the data structures
like SERVICE_TABLE_ENTRY to be defined and there it starts -- gcc gives a lot
of stuff like "in the file included from service.c: winsvc.h: ..."

The solution is maybe to compile separately the code for the service itself by gcc
and all the stuff you need to `decorate' the application as an NT service by MS VC++
and then link it together (I don't know whether it's possible or not)

Regards,
Dmitri Makarov.
dimm@vnet.ibm.com
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
