[LTP] [PATCH v2 2/2] ioctl: convert ioctl03 to new API

Cyril Hrubis chrubis@suse.cz
Wed Dec 20 11:27:48 CET 2017


Hi!
> > After this change the test fails with TBROK instead of TCONF when the
> > ioctl() fails.
> >
> > I suppose that the tun driver can be compiled out of the kernel and that
> > we should still handle this situation as TCONF rather than TBROK. The
> > question is what kind of errno we get in that case, I suppose that it
> > may be ENOTTY but that should be tested.
> 
> Do you mean that ioctl(netfd, TUNGETFEATURES, &features) may be failed
> with erron==ENOTTY while testing on a kernel without TUN driver
> loaded?

That was my expectation, but with ioctl() you cannot be really sure.

> I tried that with kernel-4.15-rc4 but get "No Such Device" error when
> open "/dev/net/tun" file. And the worth to say, /dev/net/tun is still
> exist after removing TUN module.

Ok, then we need to handle ENODEV as TCONF there and anything else as
TBROK.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list