[LTP] [PATCH 1/3] ioctl01: Add default tty device

Li Wang liwang@redhat.com
Thu Feb 9 07:19:07 CET 2023


On Wed, Feb 8, 2023 at 10:13 PM Petr Vorel <pvorel@suse.cz> wrote:

> > Hi Li,
>
> > > > +#define        DEFAULT_TTY_DEVICE      "/dev/tty0"
>
> > > Hidden the device path parameter is a good idea.
>
> > > But maybe can we add a function to find available char devices instead
> > > of using the tty0 as default? In that function, we do the S_ISCHR()
> check
> > > and return the valid path of it. Then the rest test (e.g. ioctl02) can
> make
> > > use of it but not set the specified device as well. WDYT?
>
> > FYI I'm using S_ISCHR() in other patches, which check if device can be
> used.
> > Implementing search looks like a good idea. Are useful files any
> /dev/tty*
> > (including /dev/tty, /dev/ttyACM0, /dev/ttyS0) or should I avoid any file
> > or include other paths?
>
> I also wonder if we still want to keep -D parameter (i.e. allow tester to
> pass a
> file).
>

I think there is no necessary keep "-D" parameter since this ioctl01
is to check errno of ioctl(2) syscall, it might meaningless to specify a
different char device.


-- 
Regards,
Li Wang


More information about the ltp mailing list