[PATCH] linux TCFLSH ioctl
Jaroslav Drzik
jaro at coop-voz.sk
Mon Nov 28 13:58:31 GMT 2005
Hi
In FreeBSD-6.0-RELEASE is a problem in linux emulation layer
with emulation of linux ioctl TCFLSH.
In Linux kernel parameter to ioctl is passed as value.
In FreeBSD kernel parameter is passed as reference to value.
The emulation layer was passing parameter to Freebsd ioctl through
value and thus was not working.
Attached patch is against 6.0-RELEASE
Jaro
-------------- next part --------------
--- compat/linux/linux_ioctl.c.orig Fri Sep 2 05:52:28 2005
+++ compat/linux/linux_ioctl.c Thu Nov 24 20:56:25 2005
@@ -806,22 +806,22 @@
}
case LINUX_TCFLSH: {
- args->cmd = TIOCFLUSH;
+ int val;
switch (args->arg) {
case LINUX_TCIFLUSH:
- args->arg = FREAD;
+ val = FREAD;
break;
case LINUX_TCOFLUSH:
- args->arg = FWRITE;
+ val = FWRITE;
break;
case LINUX_TCIOFLUSH:
- args->arg = FREAD | FWRITE;
+ val = FREAD | FWRITE;
break;
default:
fdrop(fp, td);
return (EINVAL);
}
- error = (ioctl(td, (struct ioctl_args *)args));
+ error = (fo_ioctl(fp,TIOCFLUSH,(caddr_t)&val,td->td_ucred,td));
break;
}
More information about the freebsd-emulation
mailing list