All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls: Fix issues around calling syscalls with old timespec
Date: Wed, 13 May 2020 13:33:18 +0200	[thread overview]
Message-ID: <20200513113318.GA25472@dell5510> (raw)
In-Reply-To: <437d6fd3926de4c801ae0edb2379c6afafcb34d4.1589190284.git.viresh.kumar@linaro.org>

Hi Viresh,

checking for __kernel_timespec, which defined in include/tst_timer.h should fix
it, but we might need some more elegant solution (have that depende

diff --git testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h
index 42e4c699c..c246f84bb 100644
--- testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h
+++ testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h
@@ -17,7 +17,7 @@
 #include <asm/posix_types.h>
 #include "lapi/timex.h"
 
-#ifndef __kernel_timex
+#ifndef __kernel_timespec
 #if defined(__x86_64__) && defined(__ILP32__)
 typedef long long __kernel_long_t;
 #else

> +++ b/testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h
> @@ -14,9 +14,54 @@
>  #include <pwd.h>
>  #include <sys/timex.h>
>  #include <sys/types.h>
> +#include <asm/posix_types.h>
>  #include "lapi/timex.h"

Thanks! On a first look LGTM.
Unfortunately, there is failure on Centos 6 (gcc 4):

https://travis-ci.org/github/pevik/ltp/jobs/686519604

/usr/src/ltp/testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h:24: error: redefinition of typedef '__kernel_long_t'
/usr/src/ltp/include/tst_timer.h:99: note: previous declaration of '__kernel_long_t' was here
/usr/src/ltp/testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h:27: error: redefinition of typedef '__kernel_old_time_t'
/usr/src/ltp/include/tst_timer.h:102: note: previous declaration of '__kernel_old_time_t' was here
make[4]: *** [clock_adjtime01] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from /usr/src/ltp/testcases/kernel/syscalls/clock_adjtime/clock_adjtime02.c:58:
/usr/src/ltp/testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h: At top level:
/usr/src/ltp/testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h:24: error: redefinition of typedef '__kernel_long_t'
/usr/src/ltp/include/tst_timer.h:99: note: previous declaration of '__kernel_long_t' was here
/usr/src/ltp/testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h:27: error: redefinition of typedef '__kernel_old_time_t'
/usr/src/ltp/include/tst_timer.h:102: note: previous declaration of '__kernel_old_time_t' was here
make[4]: *** [clock_adjtime02] Error 1
make[4]: Leaving directory `/usr/src/ltp-build/testcases/kernel/syscalls/clock_adjtime'

>  #ifndef __kernel_timex
> +#if defined(__x86_64__) && defined(__ILP32__)
> +typedef long long __kernel_long_t;
> +#else
> +typedef long __kernel_long_t;
> +#endif
> +
> +typedef __kernel_long_t	__kernel_old_time_t;

It's caused by this fallback definition ^, which is already in
include/tst_timer.h. Simple deleting it should fix the problem

Kind regards,
Petr

diff --git testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h
index 42e4c699c..9849d83e3 100644
--- testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h
+++ testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h
@@ -18,13 +18,6 @@
 #include "lapi/timex.h"
 
 #ifndef __kernel_timex
-#if defined(__x86_64__) && defined(__ILP32__)
-typedef long long __kernel_long_t;
-#else
-typedef long __kernel_long_t;
-#endif
-
-typedef __kernel_long_t	__kernel_old_time_t;
 
 struct __kernel_old_timeval {
 	__kernel_old_time_t	tv_sec;		/* seconds */

  reply	other threads:[~2020-05-13 11:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11  9:45 [LTP] [PATCH] syscalls: Fix issues around calling syscalls with old timespec Viresh Kumar
2020-05-13 11:33 ` Petr Vorel [this message]
2020-05-13 11:42   ` Viresh Kumar
2020-05-13 12:54     ` Petr Vorel
2020-05-14  5:38       ` Viresh Kumar

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=20200513113318.GA25472@dell5510 \
    --to=pvorel@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.