From owner-freebsd-emulation@FreeBSD.ORG Mon Nov 28 13:58:30 2005 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5A2316A41F for ; Mon, 28 Nov 2005 13:58:30 +0000 (GMT) (envelope-from jaro@proxy.coop-voz.sk) Received: from proxy.coop-voz.sk (ttxb58.ttx-net.sk [193.110.187.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 730AB43D46 for ; Mon, 28 Nov 2005 13:58:29 +0000 (GMT) (envelope-from jaro@proxy.coop-voz.sk) Received: from proxy.coop-voz.sk (localhost [127.0.0.1]) by nod32.coop (Postfix) with ESMTP id D0930B3DC5; Mon, 28 Nov 2005 14:58:26 +0100 (CET) X-Virus-Scanner: This message was checked by NOD32 Antivirus system NOD32 for Linux Mail Server. For more information on NOD32 Antivirus System, please, visit our website: http://www.nod32.com/. Received: by proxy.coop-voz.sk (Postfix, from userid 1050) id B2266B3DC3; Mon, 28 Nov 2005 14:58:26 +0100 (CET) Date: Mon, 28 Nov 2005 14:58:26 +0100 From: Jaroslav Drzik To: freebsd-emulation@freebsd.org Message-ID: <20051128135826.GA1068@linux.coop> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline User-Agent: Mutt/1.5.8i Subject: [PATCH] linux TCFLSH ioctl X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2005 13:58:31 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="linux-ioctl.patch" --- 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; } --/04w6evG8XlLl3ft--