<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><font size="-1">Hi,<br>
<br>
I tried the suggested patch, but was unsuccessful in running the
test. Here is my diff.<br>
<br>
diff --git a/lib/tst_clocks.c b/lib/tst_clocks.c<br>
index bc0bef273..7b465b1f6 100644<br>
--- a/lib/tst_clocks.c<br>
+++ b/lib/tst_clocks.c<br>
@@ -14,11 +14,11 @@<br>
<br>
typedef int (*mysyscall)(clockid_t clk_id, void *ts);<br>
<br>
-int syscall_supported_by_kernel(mysyscall func)<br>
+int syscall_supported_by_kernel(long sysnr)<br>
{<br>
int ret;<br>
<br>
- ret = func(0, NULL);<br>
+ ret = syscall(sysnr, 0, NULL);<br>
if (ret == -1 && errno == ENOSYS)<br>
return 0;<br>
<br>
@@ -32,13 +32,13 @@ int tst_clock_getres(clockid_t clk_id,
struct timespec *res)<br>
int ret;<br>
<br>
#if (__NR_clock_getres_time64 != __LTP__NR_INVALID_SYSCALL)<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_getres64)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_getres_time64)) {<br>
func = sys_clock_getres64;<br>
tts.type = TST_KERN_TIMESPEC;<br>
}<br>
#endif<br>
<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_getres)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_getres)) {<br>
func = sys_clock_getres;<br>
tts.type = TST_KERN_OLD_TIMESPEC;<br>
}<br>
@@ -62,13 +62,13 @@ int tst_clock_gettime(clockid_t clk_id,
struct timespec *ts)<br>
int ret;<br>
<br>
#if (__NR_clock_gettime64 != __LTP__NR_INVALID_SYSCALL)<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_gettime64)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_gettime64)) {<br>
func = sys_clock_gettime64;<br>
tts.type = TST_KERN_TIMESPEC;<br>
}<br>
#endif<br>
<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_gettime)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_gettime)) {<br>
func = sys_clock_gettime;<br>
tts.type = TST_KERN_OLD_TIMESPEC;<br>
}<br>
@@ -91,13 +91,13 @@ int tst_clock_settime(clockid_t clk_id,
struct timespec *ts)<br>
static mysyscall func;<br>
<br>
#if (__NR_clock_settime64 != __LTP__NR_INVALID_SYSCALL)<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_settime64)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_settime64)) {<br>
func = sys_clock_settime64;<br>
tts.type = TST_KERN_TIMESPEC;<br>
}<br>
#endif<br>
<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_settime)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_settime)) {<br>
func = sys_clock_settime;<br>
tts.type = TST_KERN_OLD_TIMESPEC;<br>
}<br>
<br>
<br>
$ ./runltp -s max_map_count<br>
...<br>
...<br>
Running tests.......<br>
<<<test_start>>><br>
tag=max_map_count stime=1594019344<br>
cmdline="max_map_count -i 10"<br>
contacts=""<br>
analysis=exit<br>
<<<test_output>>><br>
incrementing stop<br>
tst_test.c:1247: INFO: Timeout per run is 0h 05m 00s<br>
../include/tst_timer.h:214: CONF: syscall(403)
__NR_clock_gettime64 not supported<br>
<br>
Summary:<br>
passed 0<br>
failed 0<br>
skipped 1<br>
warnings 0<br>
<<<execution_status>>><br>
initiation_status="ok"<br>
duration=0 termination_type=exited termination_id=32 corefile=no<br>
cutime=0 cstime=0<br>
<<<test_end>>><br>
<br>
Is there anything I am missing here? Thanks in advance.<br>
<br>
Regards,<br>
Harish</font><br>
</p>
<div class="moz-cite-prefix">On 7/4/20 12:44 PM, Li Wang wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEemH2cN735haDmyqbNa_LwDgumFqAspYfJaKRpsOg0Rij9tEA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi Cyril,</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Jul 3, 2020 at 8:59
PM Cyril Hrubis <<a href="mailto:chrubis@suse.cz"
moz-do-not-send="true">chrubis@suse.cz</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">Hi!<br>
I guess that we need:<br>
</blockquote>
<div><br>
</div>
<div>
<div class="gmail_default" style="font-size:small">This
method works for me, plz could you correct some typos as
below.</div>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<br>
diff --git a/lib/tst_clocks.c b/lib/tst_clocks.c<br>
index bc0bef273..c0727a34c 100644<br>
--- a/lib/tst_clocks.c<br>
+++ b/lib/tst_clocks.c<br>
@@ -14,11 +14,11 @@<br>
<br>
typedef int (*mysyscall)(clockid_t clk_id, void *ts);<br>
<br>
-int syscall_supported_by_kernel(mysyscall func)<br>
+int syscall_supported_by_kernel(long sysnr)<br>
{<br>
int ret;<br>
<br>
- ret = func(0, NULL);<br>
+ ret = syscall(sysnr, func(0, NULL);<br>
</blockquote>
<div> </div>
<div><span class="gmail_default" style="font-size:small">This
line should be: ret = syscall(sysnr, 0, NULL);</span></div>
<div><span class="gmail_default" style="font-size:small"></span> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
if (ret == -1 && errno == ENOSYS)<br>
return 0;<br>
<br>
@@ -32,13 +32,13 @@ int tst_clock_getres(clockid_t clk_id,
struct timespec *res)<br>
int ret;<br>
<br>
#if (__NR_clock_getres_time64 != __LTP__NR_INVALID_SYSCALL)<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_getres64)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_getres64)) {</blockquote>
<div> </div>
<div><span class="gmail_default" style="font-size:small">if
(!func &&
syscall_supported_by_kernel(__NR_clock_getres_time64 )) {</span></div>
<div><span class="gmail_default" style="font-size:small"></span> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex"> </blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
func = sys_clock_getres64;<br>
tts.type = TST_KERN_TIMESPEC;<br>
}<br>
#endif<br>
<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_getres)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_getres)) {<br>
func = sys_clock_getres;<br>
tts.type = TST_KERN_OLD_TIMESPEC;<br>
}<br>
@@ -62,13 +62,13 @@ int tst_clock_gettime(clockid_t clk_id,
struct timespec *ts)<br>
int ret;<br>
<br>
#if (__NR_clock_gettime64 != __LTP__NR_INVALID_SYSCALL)<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_gettime64)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_gettime64)) {<br>
func = sys_clock_gettime64;<br>
tts.type = TST_KERN_TIMESPEC;<br>
}<br>
#endif<br>
<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_gettime)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_gettime)) {<br>
func = sys_clock_gettime;<br>
tts.type = TST_KERN_OLD_TIMESPEC;<br>
}<br>
@@ -91,13 +91,13 @@ int tst_clock_settime(clockid_t clk_id,
struct timespec *ts)<br>
static mysyscall func;<br>
<br>
#if (__NR_clock_settime64 != __LTP__NR_INVALID_SYSCALL)<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_settime64)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_settime64)) {<br>
func = sys_clock_settime64;<br>
tts.type = TST_KERN_TIMESPEC;<br>
}<br>
#endif<br>
<br>
- if (!func &&
syscall_supported_by_kernel(sys_clock_settime)) {<br>
+ if (!func &&
syscall_supported_by_kernel(__NR_clock_settime)) {<br>
func = sys_clock_settime;<br>
tts.type = TST_KERN_OLD_TIMESPEC;<br>
}<br>
<br>
-- <br>
Cyril Hrubis<br>
<a href="mailto:chrubis@suse.cz" target="_blank"
moz-do-not-send="true">chrubis@suse.cz</a><br>
<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>Regards,<br>
</div>
<div>Li Wang<br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</body>
</html>