Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#112424: zsh: zsh can't read from /proc
- X-seq: zsh-workers 15832
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#112424: zsh: zsh can't read from /proc
- Date: Mon, 17 Sep 2001 11:34:50 -0400
- Cc: Wessel Dankers <wsl-deb@xxxxxxxxxxxx>, 112424-forwarded@xxxxxxxxxxxxxxx
- In-reply-to: <20010916091351.593.qmail@xxxxxxxxxxxxx>; from wsl-deb@xxxxxxxxxxxx on Sun, Sep 16, 2001 at 11:13:51AM +0200
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20010916091351.593.qmail@xxxxxxxxxxxxx>
Do we want to special-case this?
> zsh seems to have trouble reading from /proc special files.
> For example:
>
> bzzrt:/home/wsl% read HOST </proc/sys/kernel/hostname
> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author