From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65626 invoked by alias); 21 Feb 2020 01:08:08 -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 65596 invoked by uid 89); 21 Feb 2020 01:08:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: conssluserg-03.nifty.com Received: from conssluserg-03.nifty.com (HELO conssluserg-03.nifty.com) (210.131.2.82) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Feb 2020 01:08:04 +0000 Received: from Express5800-S70 (ntsitm196171.sitm.nt.ngn.ppp.infoweb.ne.jp [125.0.207.171]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 01L17nE5029739 for ; Fri, 21 Feb 2020 10:07:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 01L17nE5029739 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1582247270; bh=Q0slNQ9ekGt9R9soxKOvPt5pkmL+tG9PFD4FH23rKpE=; h=Date:From:To:Subject:In-Reply-To:References:From; b=fhj0D7mKkbDBLYzsMAOEmXHYAuKxIXBwCZL7bhEirl86F7+MJySgLLVZlYluPQro5 9sS3sqxzE5dPVTAp6zHVFWqoE70p7JAXeT3zihqXBaz9AphQ0TMG3pwX91kApQCq9r El2BJv7zbXlfByuC71k7AR0hUHRN7uxZFrW7eM0qRvgcz3oqOjhGDghMRcVtxXJRW9 NN0764s5KuD6jRdi9JeHUd69UzAkY0hCPBJhLmqyGoM6+BxrKde8hokB059gf9wysI ucNH4etDFqyxKd3lpVjejyfnW9lwxTjUKUz0SFMqQGj9eV/pglsLrM5RmdhzwhzzAX MDnOlfIcZ64Yw== Date: Fri, 21 Feb 2020 01:08:00 -0000 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: Pipes bug when spawning non-cygwin processes Message-Id: <20200221100759.6377af969a5f93217b488467@nifty.ne.jp> In-Reply-To: <20200221100121.44625484e94eef069f9ff3d8@nifty.ne.jp> References: <20200131072536.da46ccf9cb52b1afdefa2a9a@nifty.ne.jp> <20200219044302.bd24ffa7af1f159c67583600@nifty.ne.jp> <20200221100121.44625484e94eef069f9ff3d8@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/msg00180.txt.bz2 On Fri, 21 Feb 2020 10:01:21 +0900 Takashi Yano wrote: > 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; > } Or just compile with: cl pipes.cpp /link /subsystem:console -- 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