Subject: Re: on tcsh and the abberant random exit...
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 08/15/2001 10:04:38
In article <20010813130316.A13420@noc.untraceable.net>,
Andrew Brown <atatat@atatdot.net> wrote:

>each of which ought to be handed back up to ttioctl() ultimately.  the
>problem is, it seems to me, that ERESTART is -1, which some things
>don't restart.  of course, being told to restart something and then
>returning ENOTTY isn't terribly useful, is it?  (it also seems weird
>to me that ERESTART is -1 which isn't terribly distinguishable from an
>error).
>
>i think that the return value of ENOTTY should be changed to EINTR.
>does anyone agree?  disagree?  care?  have comments?
>

I think that returning ENOTTY in a temporary failure condition due to
some unfortunate timing is bogus. ERESTART should be turned into EINTR,
otherwise there is no way for a userland program to know if it should
retry the call or fail (ENOTTY is a permanent failure in every other
OS).

I think that the way the code is structured is a bit contorted, taking
advantage of negative error codes (that sometimes are not even error
codes) to perform different actions.

christos