From 91241944ea1834d220751590128d8475ca1ef84f Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sat, 6 Dec 1997 11:28:06 +0000 Subject: [PATCH] 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. --- sys/sys/errno.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/sys/errno.h b/sys/sys/errno.h index 78fb8caebaa2..3df8f96fe78e 100644 --- a/sys/sys/errno.h +++ b/sys/sys/errno.h @@ -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