zsh-workers
 help / color / mirror / code / Atom feed
* Zsh Not resetting stdin O_NONBLOCK on Solaris
@ 1996-09-09 18:15 Greg J. Badros
  1996-09-12 13:08 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Greg J. Badros @ 1996-09-09 18:15 UTC (permalink / raw)
  To: zsh-workers


Using zsh-3.0.0 on Solaris, if I start a program that sets non-blocking
input on stdin (using fcntl with O_NONBLOCK), and I then exit that program
using SIGINT (Ctrl-C), zsh doesn't seem to reset stdin back to blocking
input for future programs that the shell runs (though zle works fine).
cat reports

cat: input error on standard input: Resource temporarily unavailable

I can get around this problem with a simple C program to reset stdin
to blocking mode (turns off the O_NONBLOCK bit flag with fcntl). Is this a
bug?  Has this been fixed by any patches that are around?
Thanks
Greg


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

* Re: Zsh Not resetting stdin O_NONBLOCK on Solaris
  1996-09-09 18:15 Zsh Not resetting stdin O_NONBLOCK on Solaris Greg J. Badros
@ 1996-09-12 13:08 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1996-09-12 13:08 UTC (permalink / raw)
  To: Zsh hackers list, Greg J. Badros

"Greg J. Badros" wrote:
> Using zsh-3.0.0 on Solaris, if I start a program that sets non-blocking
> input on stdin (using fcntl with O_NONBLOCK), and I then exit that program
> using SIGINT (Ctrl-C), zsh doesn't seem to reset stdin back to blocking
> input for future programs that the shell runs (though zle works fine).

It's not clear to me this is a bug.  Zle now doesn't use stdin, it
sets up its own fd from the terminal, so it doesn't really care what's
happened to stdin.  A quick poll reveals that ksh resets O_NONBLOCK
(interactively anyway), sh, csh and bash don't (and sh and csh react
badly if it is set), with tcsh it seems to depend on the version (6.04
bombed badly, 6.05 reset it).  This is not specific to Solaris,
although some of the results may be.

On the other hand, if you try `read line' with O_NONBLOCK set you come
unstuck because that does use stdin.  Then again, maybe you could have
set non-blocking input deliberately, which after all gives just the
effect you would expect?  It's still not clear that it's the shell's
business to tidy this up, or if it should, under what circumstances
that should be.

Sorry, that's not very helpful.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


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

end of thread, other threads:[~1996-09-12 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-09 18:15 Zsh Not resetting stdin O_NONBLOCK on Solaris Greg J. Badros
1996-09-12 13:08 ` Peter Stephenson

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).