Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Sep 2016 15:06:46 +0300
From:      Chagin Dmitry <dchagin@freebsd.org>
To:        Erik Cederstrand <erik+lists@cederstrand.dk>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: ioctl
Message-ID:  <20160915120646.GA13631@chd.heemeyer.club>
In-Reply-To: <24CD6063-ED64-4509-8714-16EC21D67AB9@cederstrand.dk>
References:  <1B155F49-2C87-49A0-B08A-17849C86CC48@cederstrand.dk> <24CD6063-ED64-4509-8714-16EC21D67AB9@cederstrand.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 15, 2016 at 01:37:22PM +0200, Erik Cederstrand wrote:
> 
> > Den 15. sep. 2016 kl. 10.40 skrev Erik Cederstrand <erik@cederstrand.dk>:
> > 
> > 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(&sectorsize, (void *)args->arg,
>  		    sizeof(sectorsize)));
>  		break;
> +	case LINUX_BLKSSZGET:
> +		error = fo_ioctl(fp, DIOCGSECTORSIZE,
> +		    (caddr_t)&sectorsize, td->td_ucred, td);
> +		fdrop(fp, td);
> +		if (error)
> +			return (error);
> +		return (copyout(&sectorsize, (void *)args->arg,
> +		    sizeof(sectorsize)));
> +		break;
>  	}
>  	fdrop(fp, td);
>  	return (ENOIOCTL);
>

looks ok to me, thanx 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160915120646.GA13631>