From 12b7caa1dd2faf60b80c9332f9a8ddba08de6ef5 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 26 Jun 2009 19:39:33 +0000 Subject: Return ENOSYS instead of EINVAL for invalid function codes to match the behavior of Linux. Reported by: Alexander Best alexbestms of math.uni-muenster.de Approved by: re (kib) --- sys/i386/linux/linux_machdep.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sys/i386/linux/linux_machdep.c') diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 9d078af..cd3cf79 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -866,9 +866,6 @@ linux_modify_ldt(struct thread *td, struct linux_modify_ldt_args *uap) union descriptor desc; int size, written; - if (uap->ptr == NULL) - return (EINVAL); - switch (uap->func) { case 0x00: /* read_ldt */ ldt.start = 0; @@ -911,7 +908,7 @@ linux_modify_ldt(struct thread *td, struct linux_modify_ldt_args *uap) error = i386_set_ldt(td, &ldt, &desc); break; default: - error = EINVAL; + error = ENOSYS; break; } -- cgit v1.1