Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Originating-IP: [80.189.20.4] From: "John Vincent" To: cygwin AT cygwin DOT com Subject: Re: problem with "more" under cygwin-1.3.13-1 Date: Wed, 16 Oct 2002 03:28:17 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 16 Oct 2002 03:28:17.0771 (UTC) FILETIME=[119D03B0:01C274C4] Hi, Reading from 2 (standard error) is "a little iffy", but back in days of yore, when Unix was either BSD or version 7, it was quite common. The standard behaviour was to open fd 0 (input) with mode 0 (read), fd 1 (output) with mode 1 (write) and fd 2 (error) with mode 2 (read&write). The logic was that this saved a variable in the init process that started the login on the ttys. Memory was expensive back then ... Just a little history lesson for the interested .... /John VIncent. >From: Christopher Faylor >Reply-To: cygwin AT cygwin DOT com >To: cygwin AT cygwin DOT com >Subject: Re: problem with "more" under cygwin-1.3.13-1 >Date: Mon, 14 Oct 2002 22:30:56 -0400 > >On Mon, Oct 14, 2002 at 04:50:58PM -0400, Christopher Faylor wrote: > >On Mon, Oct 14, 2002 at 01:30:19PM -0700, Joshua Daniel Franklin wrote: > >>>* Jeff Johnston: > >>>>>"set | more" only the first page is shown, it does not display the > >>>>>"More" prompt, and the bash prompt appears at the bottom. > >>> > >>>>Try 1.3.13-2 if you haven't already. > >>> > >>>I'm used 13-2 and I can confirm Jeff's report. More seems to have > >>>broken. > >> > >>I ported 'more' mainly for people that have never heard of 'less' or > >>people with extremely small disk space looking to cut corners. I'll > >>take a look as soon as I can, but *please* anyone who can use 'less', > >>do so. > >> > >>BTW, does anyone have any additional details about the failure? > > > >I do. I managed to duplicate the problem by trying to run it on NT 4.0. > >The problem is that more assumes that it can read characters from fd 2 > >which seems a remarkably iffy assumption. It uses read(2, ...) to > >characters from the 'tty'. > > > >1.3.13 added code to invalidate reading on file descriptors that are > >open only for writing. Cygwin had been opening all of the standard > >descriptors "appropriately" so that fd 0 was opened only for reading, fd > >1 was opened for writing, ditto fd 2. > > > >So, I've changed the code in cygwin so that it opens all of the standard > >file descriptors in read/write mode initially. This seems to mimic >linux. > > > >A more, IMO, robust change for more would be to open /dev/tty for reading > >and use that for character input. > >The newest snapshot should fix this "problem". > >cgf >(who wonders why he even bothers to release snapshots since no one actually >tries them) > >-- >Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple >Bug reporting: http://cygwin.com/bugs.html >Documentation: http://cygwin.com/docs.html >FAQ: http://cygwin.com/faq/ _________________________________________________________________ Choose an Internet access plan right for you -- try MSN! http://resourcecenter.msn.com/access/plans/default.asp -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/