From: dimm AT vnet DOT ibm DOT com Subject: Re: Cygwin ports as services under NT? 2 Dec 1996 05:39:44 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <329D6E63.41C6.cygnus.gnu-win32@vnet.ibm.com> References: <1 DOT 5 DOT 4 DOT 32 DOT 19961126162549 DOT 0062f7f0 AT vault DOT healthcare DOT 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 AT cygnus DOT com Original-CC: "Dm. Makarov" Original-Sender: owner-gnu-win32 AT cygnus DOT 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 AT vnet DOT ibm DOT com - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".