All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/1] ioctl02.c: check for struct termio
Date: Wed, 29 Jan 2020 11:06:19 +0100	[thread overview]
Message-ID: <20200129100619.GC21699@rei.lan> (raw)
In-Reply-To: <20200128212725.22781-1-petr.vorel@gmail.com>

Hi!
>  configure.ac                              |  1 +
>  m4/ltp-termio.m4                          |  6 ++++++
>  testcases/kernel/syscalls/ioctl/ioctl01.c | 20 ++++++++++++--------
>  3 files changed, 19 insertions(+), 8 deletions(-)
>  create mode 100644 m4/ltp-termio.m4
> 
> diff --git a/configure.ac b/configure.ac
> index c7cdff1c4..b860bdacc 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -257,6 +257,7 @@ LTP_CHECK_SYSCALL_QUOTACTL
>  LTP_CHECK_SYSCALL_SIGNALFD
>  LTP_CHECK_SYSCALL_UTIMENSAT
>  LTP_CHECK_TASKSTATS
> +LTP_CHECK_TERMIO
>  LTP_CHECK_TIMERFD
>  test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
>  LTP_CHECK_TPACKET_V3
> diff --git a/m4/ltp-termio.m4 b/m4/ltp-termio.m4
> new file mode 100644
> index 000000000..e745df1d9
> --- /dev/null
> +++ b/m4/ltp-termio.m4
> @@ -0,0 +1,6 @@
> +dnl SPDX-License-Identifier: GPL-2.0-or-later
> +dnl Copyright (c) 2020 Petr Vorel <petr.vorel@gmail.com>
> +
> +AC_DEFUN([LTP_CHECK_TERMIO],[
> +AC_CHECK_TYPES([struct termio],,,[#include <sys/ioctl.h>])
> +])

What about we add a fallback defition of the structure into
lapi/termio.h instead of disabling the test?

That way we would be able to test the kernel even if the userspace
headers were missing...

#include "config.h"

#ifndef HAVE_STRUCT_TERMIO
struct termio {
...
}
#ifdef

Should be enough to be able to compile that test, right?

-- 
Cyril Hrubis
chrubis@suse.cz

      parent reply	other threads:[~2020-01-29 10:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-28 21:27 [LTP] [PATCH 1/1] ioctl02.c: check for struct termio Petr Vorel
2020-01-28 21:39 ` Petr Vorel
2020-01-29 10:01   ` Cyril Hrubis
2020-01-29 10:27     ` Petr Vorel
2020-01-29 10:06 ` Cyril Hrubis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200129100619.GC21699@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.