« Return to Thread: linux syscall modify_ldt() returning wrong errno

Re: linux syscall modify_ldt() returning wrong errno

by John Baldwin :: Rate this Message:

Reply to Author | View in Thread

On Thursday 25 June 2009 6:25:31 pm Alexander Best wrote:
> hi there,
>
> i'm currently playing a bit with the linux test project (ltp). it seems the
> linux syscall modify_ldt() isn't implemented correctly. the following code
> should set errno to ENOSYS, but instead EINVAL is being returned:

It looks like this should fix it:

--- //depot/vendor/freebsd/src/sys/i386/linux/linux_machdep.c 2009/02/18 16:15:14
+++ //depot/user/jhb/acpipci/i386/linux/linux_machdep.c 2009/06/26 14:32:55
@@ -866,9 +866,6 @@
  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 @@
  error = i386_set_ldt(td, &ldt, &desc);
  break;
  default:
- error = EINVAL;
+ error = ENOSYS;
  break;
  }
 

--
John Baldwin
_______________________________________________
freebsd-hackers@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..."

 « Return to Thread: linux syscall modify_ldt() returning wrong errno