From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58913 invoked by alias); 21 Feb 2020 01:01:27 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 58905 invoked by uid 89); 21 Feb 2020 01:01:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=upto, H*i:CAJZe6MBrUcn7Z, H*f:gJhwBh-x, H*i:gJhwBh-x X-HELO: conssluserg-06.nifty.com Received: from conssluserg-06.nifty.com (HELO conssluserg-06.nifty.com) (210.131.2.91) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Feb 2020 01:01:25 +0000 Received: from Express5800-S70 (ntsitm196171.sitm.nt.ngn.ppp.infoweb.ne.jp [125.0.207.171]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 01L11CsT015198 for ; Fri, 21 Feb 2020 10:01:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 01L11CsT015198 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1582246872; bh=USyOzX27x+67C2Nghzj3IEPCITSJ95bXV+0LIuj8JG0=; h=Date:From:To:Subject:In-Reply-To:References:From; b=or3G1Puw+hFTt99JHTa0tdLIE/FVZatk5Z5sfKzX7VdOzIdH7bDOXsmndqw7ZwyhK q4UuA4vk/Zb7g1c34EvXfYjeZGJiKt+wY4ps46qyqpqdPDJBjeTBx6lQcvwR27mNmg UDTG8miPgQpG/ShfaSu2nwv71zlBHKKiXwQZoI/AqxTBX/jB0bOQykXH92U13QeCIc 3gvLqOdQgfzxlGW+7eaujuMgkP+yGkqVK9p6i+5gPsGQ92um9BIkc3OSbQry3sBiIu /5z8gXG6OHnMm0JbBdzvqGQ+lku7Fov/JCLOAO11VpgwZwqrqwyGEfR3tOEfcAmXf7 UMd6RB5hQwJHQ== Date: Fri, 21 Feb 2020 01:01:00 -0000 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: Pipes bug when spawning non-cygwin processes Message-Id: <20200221100121.44625484e94eef069f9ff3d8@nifty.ne.jp> In-Reply-To: References: <20200131072536.da46ccf9cb52b1afdefa2a9a@nifty.ne.jp> <20200219044302.bd24ffa7af1f159c67583600@nifty.ne.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00179.txt.bz2 On Thu, 20 Feb 2020 14:33:27 -0500 Edward Lam wrote: > On Tue, Feb 18, 2020 at 2:43 PM Takashi Yano wrote: > > Could you please provide a simple test case? > > Here you go: > > // pipes.cpp > // > // Compile in a Visual Studio x64 Native Tools Command Prompt: > // cl pipes.cpp /link /subsystem:windows > // > // Run from inside a Cygwin shell, the produced pipes.exe > // > > #include > #include > > INT WinMain(HINSTANCE, HINSTANCE, PSTR, INT) > { > printf("This message used to show up in mintty cygwin v.2.11.2 shell! > or from ssh session\n"); > return 0; > } > // end of pipes.cpp Thanks for the test case. Indeed, this works upto cygwin 3.0.7, and does not work in cygwin 3.1.0 or later. However, I wonder what platform is your program for. This test case does not work also in native windows command prompt. Your test case works only in old cygwin pty. If you want to make a program which works in cygwin pty, you can use cygwin g++ like: g++ -mwindows pipes.cpp -o pipes The binary built by above command works in cygwin pty, but does not work in cygwin console (cygwin in command prompt) even with cygwin 3.0.7. If you want to make a program which works with windows console, you should change the code like: INT WinMain(HINSTANCE, HINSTANCE, PSTR, INT) { if (!AttachConsole(ATTACH_PARENT_PROCESS)) AllocConsole(); freopen("CONOUT$", "w", stdout); printf("This message used to show up in mintty cygwin v.2.11.2 shell! or from ssh session\n"); return 0; } -- Takashi Yano -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple