From owner-freebsd-emulation@freebsd.org Thu Sep 15 11:37:27 2016 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B879BD919F for ; Thu, 15 Sep 2016 11:37:27 +0000 (UTC) (envelope-from erik+lists@cederstrand.dk) Received: from mailrelay3.public.one.com (mailrelay3.public.one.com [195.47.247.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2822EC for ; Thu, 15 Sep 2016 11:37:26 +0000 (UTC) (envelope-from erik+lists@cederstrand.dk) X-HalOne-Cookie: f02131f47dd50abf1534765b1baf8b24ace70c0b X-HalOne-ID: c4eab5df-7b38-11e6-a591-b8ca3afa9d73 Received: from [10.0.1.3] (unknown [217.157.7.215]) by smtpfilter1.public.one.com (Halon Mail Gateway) with ESMTPSA for ; Thu, 15 Sep 2016 11:37:23 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: ioctl From: Erik Cederstrand In-Reply-To: <1B155F49-2C87-49A0-B08A-17849C86CC48@cederstrand.dk> Date: Thu, 15 Sep 2016 13:37:22 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <24CD6063-ED64-4509-8714-16EC21D67AB9@cederstrand.dk> References: <1B155F49-2C87-49A0-B08A-17849C86CC48@cederstrand.dk> To: freebsd-emulation@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 15 Sep 2016 11:37:27 -0000 > Den 15. sep. 2016 kl. 10.40 skrev Erik Cederstrand = : >=20 > Hi folks, >=20 > I managed to get a 64-bit Oracle instantclient running under 64-bit = Linux so I can connect to an Oracle database using the Oracle client = "sqlplus". >=20 > Now, whenever I run sqlplus, I get this message in /var/log/messages: >=20 > kernel: linux: pid 92000 (sqlplus): ioctl fd=3D3, cmd=3D0x1268 = ('',104) is not implemented >=20 > 0x1268 is BLKSSZGET according to linux_ioctl.h. >=20 > The message is harmless as sqlplus seems to be working correctly, but = I would like to get rid of it and learn new things along the way. >=20 > I think the message comes from this code: = https://github.com/freebsd/freebsd/blob/master/sys/compat/linux/linux_ioct= l.c#L3606 >=20 > Apparently, the Linux compat code does not implement the ioctl() = system call at all. Is this a deliberate choice? Well, that was a pretty bad analysis. I found that the = linux_ioctl_disk() method handles disk ioctl's, but not BLKSSZGET, so = here's a patch (I still barely know what I'm doing): --- sys/compat/linux/linux_ioctl.c.orig 2016-09-15 13:09:59.747254000 = +0200 +++ sys/compat/linux/linux_ioctl.c 2016-09-15 13:15:59.382396000 = +0200 @@ -296,6 +296,15 @@ return (copyout(§orsize, (void *)args->arg, sizeof(sectorsize))); break; + case LINUX_BLKSSZGET: + error =3D fo_ioctl(fp, DIOCGSECTORSIZE, + (caddr_t)§orsize, td->td_ucred, td); + fdrop(fp, td); + if (error) + return (error); + return (copyout(§orsize, (void *)args->arg, + sizeof(sectorsize))); + break; } fdrop(fp, td); return (ENOIOCTL); ... and the messages are gone. Is this an acceptable approach? Erik=