Subject: Re: terminal ioctl results when interrupted
To: None <>
From: Charles M. Hannum <>
List: current-users
Date: 07/02/1995 21:00:15
   comioctl() (sys/dev/isa/com.c v1.60, line 447) first tries the ldisc-specific
   ioctl and then ttioctl(), and only if both fail with an error < 0 it
   interprets the command itself, giving ENOTTY if it doesn't recognize the
   command either. At least ttioctl() contains a ttysleep(), which may be
   interrupted (e. g. timeout), resulting in ERESTART (?) == -1;
   undistinguishable from the -1 returned meaning "don't know how to handle that
   command". IMHO an interrupted ioctl shouldn't return ENOTTY; at least my old
   X server is very puzzled:

That's ... cute.

It looks like we need to make it use something other than -1 for
either ERESTART or the magic value that ttioctl() returns.  Changing
the latter would probably be useful in at least one other case
(namely, error reporting in the SCSI code).