From 9e3db9cd59f37a5a591ac341833508b4ba6b4f8d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 16 Feb 1996 02:19:52 +0000 Subject: Thu Feb 15 13:57:08 1996 Roland McGrath * mach/Machrules: Use -include for $(*.ir). * hurd/hurd/ioctl.h (_HURD_HANDLE_IOCTLS): Mask off type bits in request values. * sysdeps/mach/hurd/ioctls.h (_IOC_NOTYPE): New macro. (_IOT_COUNT2): Field is 3 bits, not 2. * sysdeps/mach/hurd/ioctl.c: Ignore handler if it fails with ENOTTY. * hurd/hurdioctl.c (_hurd_lookup_ioctl_handler): Mask off type bits before looking up handler. (fioctl): Use __hurd_dfail. (fioctl, fioclex): Use ENOTTY for bogus request instead of EGRATUITOUS. Wed Feb 14 00:21:17 1996 David Mosberger-Tang * sysdeps/alpha/memchr.c (memchr): loop searching for matching character bailed out one too early; changed constant 6 to 7 to fix this. --- hurd/hurdioctl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'hurd/hurdioctl.c') diff --git a/hurd/hurdioctl.c b/hurd/hurdioctl.c index 30cce1c..bd91389 100644 --- a/hurd/hurdioctl.c +++ b/hurd/hurdioctl.c @@ -36,6 +36,10 @@ _hurd_lookup_ioctl_handler (int request) void *const *ptr; const struct ioctl_handler *h; + /* Mask off the type bits, so that we see requests in a single group as a + contiguous block of values. */ + request = _IOC_NOTYPE (request); + for (ptr = symbol_set_first_element (_hurd_ioctl_handler_lists); !symbol_set_end_p (_hurd_ioctl_handler_lists, ptr); ++ptr) @@ -62,7 +66,7 @@ fioctl (int fd, switch (request) { default: - err = EGRATUITOUS; + err = ENOTTY; break; case FIONREAD: @@ -97,7 +101,7 @@ fioctl (int fd, break; } - return err ? __hurd_fail (err) : 0; + return err ? __hurd_dfail (fd, err) : 0; } _HURD_HANDLE_IOCTLS (fioctl, FIOGETOWN, FIONREAD); @@ -112,7 +116,7 @@ fioclex (int fd, switch (request) { default: - return __hurd_fail (EGRATUITOUS); + return __hurd_fail (ENOTTY); case FIOCLEX: flag = FD_CLOEXEC; break; @@ -123,7 +127,7 @@ fioclex (int fd, return __fcntl (fd, F_SETFD, flag); } -_HURD_HANDLE_IOCTLS (fioclex, FIOCLEX, FIONCLEX); +_HURD_HANDLE_IOCTL (fioclex, FIOCLEX, FIONCLEX); #include #include -- cgit v1.1