From owner-freebsd-emulation@freebsd.org Thu Sep 15 12:07:02 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 89AD6BDA0B7 for ; Thu, 15 Sep 2016 12:07:02 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 491A0635 for ; Thu, 15 Sep 2016 12:07:01 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u8FC6mY9002810 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Sep 2016 12:06:50 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u8FC6lQn013661 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Sep 2016 15:06:47 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.2/Submit) id u8FC6lBZ013660; Thu, 15 Sep 2016 15:06:47 +0300 (MSK) (envelope-from dchagin) Date: Thu, 15 Sep 2016 15:06:46 +0300 From: Chagin Dmitry To: Erik Cederstrand Cc: freebsd-emulation@freebsd.org Subject: Re: ioctl Message-ID: <20160915120646.GA13631@chd.heemeyer.club> References: <1B155F49-2C87-49A0-B08A-17849C86CC48@cederstrand.dk> <24CD6063-ED64-4509-8714-16EC21D67AB9@cederstrand.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24CD6063-ED64-4509-8714-16EC21D67AB9@cederstrand.dk> User-Agent: Mutt/1.6.1 (2016-04-27) 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 12:07:02 -0000 On Thu, Sep 15, 2016 at 01:37:22PM +0200, Erik Cederstrand wrote: > > > Den 15. sep. 2016 kl. 10.40 skrev Erik Cederstrand : > > > > Hi folks, > > > > 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". > > > > Now, whenever I run sqlplus, I get this message in /var/log/messages: > > > > kernel: linux: pid 92000 (sqlplus): ioctl fd=3, cmd=0x1268 ('',104) is not implemented > > > > 0x1268 is BLKSSZGET according to linux_ioctl.h. > > > > 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. > > > > I think the message comes from this code: https://github.com/freebsd/freebsd/blob/master/sys/compat/linux/linux_ioctl.c#L3606 > > > > 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 = 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); > looks ok to me, thanx