Added a kernel-only error code ENOICTL. This will be returned from

low level ioctl routines instead of the magic number -1 so that
callers can distinguish it from ERESTART (which happens to be -1).
-1 meant that the ioctl was not handled at the called level.
ERESTART is normal when a sleeping ioctl is interrupted.  ERESTART
got converted to ENOTTY instead of restarting the ioctl.  Many
(most?) ioctls can not be restarted safely, but this is apparently
supposed to be handled by drivers converting ERESTART to EINTR.
I first saw this problem for TIOCDRAIN.  Justin saw if for disk
ioctls.

Added missing parentheses.
This commit is contained in:
Bruce Evans 1997-12-06 11:28:06 +00:00
parent 90a5affc0a
commit 91241944ea
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31575

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)errno.h 8.5 (Berkeley) 1/21/94
* $Id$
* $Id: errno.h,v 1.7 1997/02/22 09:45:10 peter Exp $
*/
#ifndef _SYS_ERRNO_H_
@ -170,8 +170,9 @@ extern int errno; /* global error number */
#ifdef KERNEL
/* pseudo-errors returned inside kernel to modify return to process */
#define ERESTART -1 /* restart syscall */
#define EJUSTRETURN -2 /* don't modify regs, just return */
#define ERESTART (-1) /* restart syscall */
#define EJUSTRETURN (-2) /* don't modify regs, just return */
#define ENOIOCTL (-3) /* ioctl not handled by this layer */
#endif
#endif