delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/03/20/23:59:47

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C77F3857C56
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1616299183;
bh=kC0dPKM6GudxaEWjkyqouVLPiQ7saVZPRs2rU31ER8w=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=s/LC6G8llogM66PHwLv3CRy66OrK2cujBAf7V8AlwaZ1q3xWEWYo73EPC99NYKoeU
ujEZ6uGt47Wwnjg7H2HLB2r2wnC1+l62iUtqz8bDpDm7Jpn4aP3kqmw6VXT4oF8/sG
m6hVwJ9+E+SigFhj7qRBwQf4mlozpRnjFsaXNTJY=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 849DD3858024
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 12L3x0CZ021760
X-Nifty-SrcIP: [118.243.84.61]
Date: Sun, 21 Mar 2021 12:59:09 +0900
To: cygwin AT cygwin DOT com
Subject: Re: stdin pipe rename in 3.2.0
Message-Id: <20210321125909.3c09b43e7899e0c1f9d43b8f@nifty.ne.jp>
In-Reply-To: <YFSgAJdS7uSp/NwM@calimero.vinschen.de>
References: <CAE6_+Uc6rfDPTpOpkLGjn5G9HS77qvHWcEpOOepmC962vbgMmw AT mail DOT gmail DOT com>
<20210319190807 DOT babb0c0312740f44e9119c17 AT nifty DOT ne DOT jp>
<20210319210546 DOT a1871ac954d695bceaeb079b AT nifty DOT ne DOT jp>
<YFSgAJdS7uSp/NwM AT calimero DOT vinschen DOT de>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, NICE_REPLY_A,
RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

On Fri, 19 Mar 2021 13:58:40 +0100
Corinna Vinschen wrote:
> > extern "C" long
> > _get_osfhandle (int fd)
> > {
> >   long res;
> > 
> >   cygheap_fdget cfd (fd);
> >   if (cfd >= 0)
> >     {
> >       if (fd == 1 || fd == 2)
> >         res = (long) cfd->get_output_handle_cyg ();
> >       else
> >         res = (long) cfd->get_handle_cyg ();
> >     }
> >   else
> >     res = -1;
> > 
> >   syscall_printf ("%R = get_osfhandle(%d)", res, fd);
> >   return res;
> > }
> > 
> > ?
> 
> Maybe.  You introduced the "_cyg" handles, so you should know ;)
> 
> On a more serious note, this is, of course, a compatibility
> problem.  While _get_osfhandle is called by a Cygwin application,
> nobody knows what dubious actions that application will perform
> on this handle.  In all likelyhood, it fetched the handle to call
> Windows functions.  And *if* it does, wouldn't it make more sense
> if the non-Cygwin handle is returned?

You are right. If get_output_handle_cyg() is returned, OPOST
processing and charset conversion does not work. Thanks!
As for input, get_handle_cyg() should be returned rather than
get_handle() because reading from get_handle() will fail because
master writes input to cygwin handle for cygwin process.

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019