From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119475 invoked by alias); 22 Jan 2019 09:25:58 -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 119467 invoked by uid 89); 22 Jan 2019 09:25:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=opening, H*F:D*nl, Hx-spam-relays-external:sk:webmail, H*RU:sk:webmail X-HELO: lb1-smtp-cloud7.xs4all.net Received: from lb1-smtp-cloud7.xs4all.net (HELO lb1-smtp-cloud7.xs4all.net) (194.109.24.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Jan 2019 09:25:55 +0000 Received: from webmail.xs4all.nl ([IPv6:2001:888:0:22:194:109:20:199]) by smtp-cloud7.xs4all.net with ESMTPA id lsJdglg6SBDyIlsJdgTCs6; Tue, 22 Jan 2019 10:25:53 +0100 Received: from a83-162-234-136.adsl.xs4all.nl ([83.162.234.136]) by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Tue, 22 Jan 2019 10:25:53 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 22 Jan 2019 09:25:00 -0000 From: Houder To: cygwin@cygwin.com Subject: Re: /dev/fd/N not synonymous with file descriptor N; it is on Linux In-Reply-To: <20190122090633.GK2802@calimero.vinschen.de> References: <0f030e809f063f5a5e64ff7a7a0c3227@xs4all.nl> <20190106201950.GC4430@calimero.vinschen.de> <1c60402837d6510667357257b5e96e88@xs4all.nl> <20190122090633.GK2802@calimero.vinschen.de> Message-ID: <151898514e462bd76cda8a227d4baa16@xs4all.nl> X-Sender: houder@xs4all.nl User-Agent: XS4ALL Webmail X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00170.txt.bz2 On 2019-01-22 10:06, Corinna Vinschen wrote: > On Jan 22 09:57, Houder wrote: >> On 2019-01-22 09:50, Houder wrote: >> > On Sun, 6 Jan 2019 21:19:50, Corinna Vinschen wrote: >> > > This should work in the latest developer snapshot uploaded to >> > > https://cygwin.com/snapshots/ Please give it a try. >> > So, for the record only: >> >> and as another example, this STC succeeds on Linux ..., but fails on >> Cygwin. >> >> 64-@@ ./stca /dev/fd/0 <> > bla >> > EOF >> fd1 = 0 >> argv[1] = /dev/fd/0 >> fd2 = 3 >> id = writefd2, errno = 13, errstr = Permission denied >> 64-@@ > > Not sure what you're testing. This is the result for me on both, > Windows 8.1 and Windows 10 1809: Curious! It fails (for me) on W7 ... > Not sure what you're testing. STC inherits a "read-only" open file descriptor from bash. On Linux the file can be opened read-write (via procfs), because a new entry is created in the open file table. (opening the file read-write (via fdescfs) on FreeBSD would fail) For this reason the output does not show what has been entered via the here-doc. In short, I was merely testing the semantics of Linux. > )$ ./stca /dev/fd/0 < ? bla > ? EOF > fd1 = 0 > argv[1] = /dev/fd/0 > fd2 = 3 > buf = \ > Hello, world! > > > Corinna -- 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