zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#112424: zsh: zsh can't read from /proc
       [not found] <20010916091351.593.qmail@bzzrt.pooh.oi>
@ 2001-09-17 15:34 ` Clint Adams
  2001-09-17 16:39   ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2001-09-17 15:34 UTC (permalink / raw)
  To: zsh-workers; +Cc: Wessel Dankers, 112424-forwarded

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug#112424: zsh: zsh can't read from /proc
  2001-09-17 15:34 ` Bug#112424: zsh: zsh can't read from /proc Clint Adams
@ 2001-09-17 16:39   ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2001-09-17 16:39 UTC (permalink / raw)
  To: Clint Adams, zsh-workers; +Cc: Wessel Dankers, 112424-forwarded

On Sep 17, 11:34am, Clint Adams wrote:
} Subject: Re: Bug#112424: zsh: zsh can't read from /proc
}
} Do we want to special-case this?
} 
} > zsh seems to have trouble reading from /proc special files.
} > 
} > The problem is that zsh reads files one byte at a time.

Hrm.  There's always

    read -u0 -k 128 HOST </proc/sys/kernel/hostname

but that has the drawback of returning a nonzero $?.

In any case, it appears that bash and bash2 have the same behavior when
reading from that file, so I'd say this is not our bug to fix.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-17 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20010916091351.593.qmail@bzzrt.pooh.oi>
2001-09-17 15:34 ` Bug#112424: zsh: zsh can't read from /proc Clint Adams
2001-09-17 16:39   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).