Messages in this thread Patch in this message | | | Subject | [patch] inotify: ioctl retval | From | Robert Love <> | Date | Mon, 04 Oct 2004 18:24:12 -0400 |
| |
John,
It is a shock--so you might want to sit down--but POSIX says that an ioctl must return ENOTTY when a valid fd is given a cmd that is not valid for that fd.
Even the man page confirms this.
Astonished,
Robert Love
A shock, but POSIX defines an invalid ioctl() cmd as returning -ENOTTY.
drivers/char/inotify.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
diff -urN linux-inotify/drivers/char/inotify.c linux/drivers/char/inotify.c --- linux-inotify/drivers/char/inotify.c 2004-10-04 14:56:17.000000000 -0400 +++ linux/drivers/char/inotify.c 2004-10-04 18:20:50.052997768 -0400 @@ -925,7 +925,7 @@ return -EFAULT; return 0; default: - return -EINVAL; + return -ENOTTY; } } | |