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 Message-ID: <3EE98396.2090801@schwingel.com> Date: Fri, 13 Jun 2003 09:56:06 +0200 From: Roland Schwingel User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: de, de-de, en-us, en MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: one byte reads in bash Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi... cygwin-owner AT cygwin DOT com wrote on 12.06.2003 19:05:35: > Just so that the list thread gets the info, I had a private reply from Dan > Vasaru, who referred me to his patch to bash here: > > http://sources.redhat.com/ml/cygwin/2002-09/msg00446.html > > I applied his patch to the current cygwin bash source (plus the three > wide-character compilation fixes for bash on current cygwin mentioned > elsewhere in the list archives) and the one-byte-read problem goes away. > (The patch turns off the bash cygwin-specific detection for a non-seekable > file handle and enables existing bash code to get the seeking-in-text-mode > stuff right). > > i.e. bash now reads script files in buffered chunks rather than > character-at-a-time. (note - I don't mean character-at-a-time buffered by > stdio, I mean char-at-a-time from the O/S). > > I originally noticed the problem with a network analyser, which also shows > the fix. For a 2.5Kbyte script, the patched bash does 2 reads (two network > reply/response data packets) versus the current cygwin bash which does > 2500 network read/reply packets. Note that cygwin strace suggests that the > problem also occurs for scripts on local disk, although it obviously has > less impact in that case. > > For my money, this is a great patch. I've not tested it for other ill > effects as yet, but the read issue is certainly resolved. The one byte read problem is IMHO really a pain in a well known part of everyones body... A former colleague of mine posted this obervation already here... (Unfortunately with a bad subject - Sorry for this - it wasn't ment that way - Cygwin is great!!!) http://sources.redhat.com/ml/cygwin/2001-07/msg01420.html Is it possible to apply the fix mentioned above once to the "regular" cygwin bash, so one does not always need to recompile bash on his own? Thanks Roland -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/