From 1278dd68479f6363ca0756060eac93057a66bd2e Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 13 Dec 2005 15:32:52 +0000 Subject: [PATCH] In Linux, kernel parameters passed to ioctl are by value, while in FreeBSD they are passed by reference. Handle the difference within the linux_ioctl_termio on the LINUX_TCFLSH path. Submitted by: Jaroslav Drzik --- sys/compat/linux/linux_ioctl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 1a59f4bc3fa..44b5fa57f56 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -806,22 +806,22 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) } 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; }