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)
This commit is contained in:
John Baldwin 2009-06-26 19:39:33 +00:00
parent 5157862aa2
commit 7c020cbbe5

View File

@ -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;
}