[LTP] [PATCH v8 1/4] Refactor ioctl02.c to use the new test API

Petr Vorel pvorel@suse.cz
Thu Oct 26 00:09:19 CEST 2023


Hi Marius,

> > -	if (ioctl(cfd, TCFLSH, 2) < 0) {
> > -		tst_resm(TINFO, "ioctl TCFLSH failed. : errno = %d", errno);
> > -		/* signal the parent so we don't hang the test */
> > -		kill(parentpid, SIGUSR1);
> > -		return -1;
> > -	}
> > +	SAFE_IOCTL(cfd, TCFLSH, 2);
> 2 is for flushing both Rx and Tx, right?
> Maybe we could use TCIOFLUSH, right? At least it's documented in
> include/uapi/asm-generic/termbits-common.h. TCIOFLUSH is in glibc, musl and
> uclibc-ng thus safe to use.

And, more importantly, TCIOFLUSH is mentioned in man ioctl_tty(2) and
termios(3). Using constant is kind of self explaining.

Kind regards,
Petr


More information about the ltp mailing list