delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/01/08/16:05:50

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=YsFKN3gErRy2WtNk6O7ZxBtR8e5/x5mWjGZRSG8frdyok9AnBlyOA
hVqPNKBZy1ET0+L6ekOc5Yn/5zh722skdI01dyXN0cKGSaF1gPulTgoniYg/zFhi
/YdbkIpsLbfNCVW50Rhw8dD+tA+UfAvBPbgxBPv+DVGHuEoe+VAsMI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=/EoxZ25y69n5txDSFFZI3Z700kw=; b=n1fsU0JKataimHRe3/KwPszl+tj5
Vn+DK2/+B3pwRITWxMdMH779QJ4J/7NKjp/fTZmcQ6nJcmfA3Ym51n71/bR2ruHB
kVqTsQOkwEcgR70irGdYof0XKYCEMqwVoIH87jkJHwFIkcqjapHo82Q58oT5mHcK
PMapFPLBkHGIXgc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-100.4 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=reading, face
X-HELO: mout.kundenserver.de
Date: Tue, 8 Jan 2019 22:05:34 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Bash heredoc on FD 3
Message-ID: <20190108210534.GI593@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20190107190313 DOT GD593 AT calimero DOT vinschen DOT de> <5c33ec76 DOT 1c69fb81 DOT 10fee DOT 7eef AT mx DOT google DOT com> <20190108112705 DOT GF593 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20190108112705.GF593@calimero.vinschen.de>
User-Agent: Mutt/1.10.1 (2018-07-13)

--47eKBCiAZYFK5l32
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Jan  8 12:27, Corinna Vinschen wrote:
> On Jan  7 16:19, Steven Penny wrote:
> > On Mon, 7 Jan 2019 20:03:13, Corinna Vinschen wrote:
> > > I can't reproduce this with my latest code.  It works fine for me
> > > every time, independently of POSIXLY_CORRECT.
> > >=20
> > > I uploaded new snapshots to https://cygwin.com/snapshots/ with all
> > > the latest changes.  Please try again.
> >=20
> > I retested with cygwin1-20190107.dll.xz. My results below. Note that "s=
uccess"
> > means that with Bash, the script runs without error, regardless of
> > "POSIXLY_CORRECT" variable as you said. "failure" is to mean that with =
Bash,
> > running with "POSIXLY_CORRECT" produces this error:
> >=20
> >    awk: error: can't open source file `/dev/fd/3' for reading (Permissi=
on
> >    denied)
> >=20
> > Windows 10: success
> > Windows 8.1: failure
> > Windows 7: failure
> > [...]
>=20
> I could reproduce this on W8.1.  After some debugging it turned out that
> this is, in fact, not related to POSIXLY_CORRECT at all.
>=20
> POSIXLY_CORRECT only changes the way the file is used in gawk.  If
> POSIXLY_CORRECT isn't set, it just uses the incoming file descriptor 3
> due to some code handling the path "/dev/fd/<descriptor>" differently.
> This works fine under all circumstances because it does not trigger my
> new code for /proc/<pid>/fd/<descriptor> at all.
>=20
> However, as soon as POSIXLY_CORRECT is set, my new code is triggered and
> falls flat on its face on pre-W10 systems (serves me right for
> developing and testing on W10 only).  The reason is that file delete
> semantics have changed on W10.  On pre-W10, reopening a file by handle
> (equivalent to the Win32 API call ReOpenFile) does not work on files for
> which the delete dispostion has been set.  This works fine on W10,
> though.
>=20
> Back to the drawing board.  I have an idea or two how to workaround this
> shortcoming of pre-W10 systems.
>=20
> Just FTR, I really like what MSFT changes in W10 under the hood.  I'm
> especially happy that the changes for WSL are exposed to the Windows
> subsystem, too, so we can profit from them as well.  Personally I'm
> not looking back to pre-W10 systems at all.

I added some changes to make this work in older systems as well.
I uploaded new snapshots to //cygwin.com/snapshots/

Please try.


Thanks,
Corinna

--=20
Corinna Vinschen
Cygwin Maintainer

--47eKBCiAZYFK5l32
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlw1EJ4ACgkQ9TYGna5E
T6ALDxAAkhEJGfTHmc3V3u9EU5mlRR+/+sNOw6GR7XIxbFTWJMJQ3CYBmdCNY6nM
o8L63L7AF6zD/Ku2BsIBkB/Wnseg4zFhXNkm54gui2T5/5FWTiMvm9hN1wJTgyBA
lTDl5LGsvBRCK4jCa/QEZQOB1GI4TTqEWkQwyFqhbRBZKMaEo7eWtGMe+b+Yft3M
VUohiLEK0Xj7DanGQ7SNnWE2CJp4oRmz5K43uRDPs61KKLuB6K+yZkFoJD+kBlWO
DJbU5XEiOxyJCohbyVLbdKT8XlcNU7Q4zIKQ9KIpRB2jkyL2TjmdkiHgEHmIjHxI
pBBmrhXkZcRl8PgtvYSf6xf7+3ZpSvXLxvNvCGnsX0D6Kg+mxCrnAzqz9kL5dbyZ
NcLXnDX8tOQxbKNxhRoPULaVo312xu2LsvGwlEtLVJI7ArkLjLesGU5IbUZQ2ZFy
xAnF+xIEtuRqfFYVFXOVzP/5Lwc9fBdo3S3lWnLUlZrl5t2+9WOeRE94MEt4twB1
EnFiZOC1FqQ6qX1ZYwgMJMS1jXm+SzWrAtz8PW4Dsqadyngr2J1Sf8446HampdKp
SL2+V9jkR4qeVoAkpVLbnjqLAIAdFnbeJOTV8lkyAJXxfbgKga0T40cBJbHBdGcV
ICAGo2PpYA4120V9NUr8u2Qqm8CcIn3+UYJvmkR4FRMgkfTCCkk=
=IL8o
-----END PGP SIGNATURE-----

--47eKBCiAZYFK5l32--

- Raw text -


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