From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5842 invoked from network); 17 Sep 2001 15:35:31 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Sep 2001 15:35:31 -0000 Received: (qmail 29284 invoked by alias); 17 Sep 2001 15:35:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15832 Received: (qmail 29259 invoked from network); 17 Sep 2001 15:35:21 -0000 Date: Mon, 17 Sep 2001 11:34:50 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Cc: Wessel Dankers , 112424-forwarded@bugs.debian.org Subject: Re: Bug#112424: zsh: zsh can't read from /proc Message-ID: <20010917113450.A15463@dman.com> References: <20010916091351.593.qmail@bzzrt.pooh.oi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010916091351.593.qmail@bzzrt.pooh.oi>; from wsl-deb@fruit.eu.org on Sun, Sep 16, 2001 at 11:13:51AM +0200 Do we want to special-case this? > zsh seems to have trouble reading from /proc special files. > For example: > > bzzrt:/home/wsl% read HOST 1 b:/home/wsl% cat /proc/sys/kernel/hostname | read HOST > bzzrt:/home/wsl% > > After the first command, $HOST is set to "b" and the return code of > the command is 1 (my prompt is configured to show this). When using > cat everything is fine, and $HOST is once again set to the proper > host name ("bzzrt"). > > The problem is that zsh reads files one byte at a time. This is > perfectly legitimate of course, but Linux does not seem to support > that for /proc files. An acceptable workaround for Linux' poor > performance would be to fstat(stdin) and use a large read if stat > reports a zero file size (and the file is a plain file). > > Of course, the real location to fix this would be the Linux kernel.