This is the mail archive of the
mailing list for the Cygwin project.
Re: one byte reads in bash
- From: John Berthels <John dot Berthels at nexor dot co dot uk>
- To: cygwin at cygwin dot com
- Date: Thu, 12 Jun 2003 18:05:35 +0100 (BST)
- Subject: Re: one byte reads in bash
- References: <Pine.LNX.email@example.com> <20030612152054.GC19331@redhat.com>
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:
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
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.
[I'm not subscribed to the list and originally contacted the authors of a
previous thread on this subject directly. I'll not see any list replies
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html