Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3FF244CA.6040108@zeroc.com> Date: Wed, 31 Dec 2003 13:38:50 +1000 From: Michi Henning Organization: ZeroC, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: SetConsoleCtrlHandler problem Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, it appears that Windows binaries won't run correctly under cygwin/bash if they use SetConsoleCtrlHandler(). I've attached a trivial program below. If you run this from a Windows console window, it prints "handler called" every time you hit Ctrl-C. When run from a cygwin bash window, the program exits after calling the handler with status 130. Shouldn't the same binary behave identically, regardless of whether I run it from cygwin/bash or a console window? I'd appreciate any help to get the Windows behavior for such binaries under cygwin. Thanks, Michi. #include #include static BOOL handler(DWORD sig) { std::cout << "handler called" << std::endl; return 1; } int main() { SetConsoleCtrlHandler((PHANDLER_ROUTINE)handler, true); for(;;) ; return 0; } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/