On Tue, Nov 15, 2016 at 07:44:52PM +0900, Rin Okuyama wrote: > On 2016/11/15 19:26, Martin Husemann wrote: > >On Tue, Nov 15, 2016 at 07:23:09PM +0900, Rin Okuyama wrote: > >>This results in build failure for most ARM environments: > >> > >> http://releng.netbsd.org/builds/HEAD/201611140950Z/ > >> > >>I think that NTP stuff should be protected by "#ifdef NTP". > >>Can I commit the attached patch? > > > >Sounds good, but don't you need to add #include "opt_ntp.h" to > >netbsd32_ioctl.c ? > > Thank you so much! I added this. Otherwise, NTP kernel gets > broken this time...
There is a slight twist. If NTP isn't defined, the code will call the standard (64bit) ioctl handler with the assumption that the arg uses the same layout in 64bit and 32bit mode. If the ioctl handler is builtin, it won't understand the ioctl either and everything is fine. But if it is a loaded module, it might be compiled with different NTP option and so the wrong routine is called. Fortunately that's just theoretical because the module can't be loaded when compiled differently (because it references ntp_adjtime). But that is a different issue and might be solved in the future. So I suggest to make the compat32 code handle CLOCK_NTP_ADJTIME even when compiled with !NTP but just return ENOTTY. N.B. clockctlioctl returns EINVAL for unrecognized ioctl commands, it should also return ENOTTY. Greetings, -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."