summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch')
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch40
1 files changed, 29 insertions, 11 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch b/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch
index c431669716..ac8f08ef5a 100644
--- a/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch
+++ b/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch
@@ -1,28 +1,40 @@
1From b66905b094e08a84c30bc135003c3611f65d53ec Mon Sep 17 00:00:00 2001 1From 89c5841bd148a7ae70c65f4a1ca5996b7f0cddfa Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 12 Feb 2020 22:22:17 -0800 3Date: Wed, 19 Feb 2020 22:52:04 -0800
4Subject: [PATCH] syscalls: Check for time64 unsafe syscalls before using them 4Subject: [PATCH] syscalls: Check for time64 unsafe syscalls before using them
5 5
6musl is using 64bit time_t now on 32bit architectures and these syscalls 6musl is using 64bit time_t now on 32bit architectures and these syscalls
7no longer exist, therefore its better to check for them being available 7no longer exist, therefore its better to check for them being available
8before using them 8before using them
9 9
10Upstream-Status: Submitted [https://patchwork.ozlabs.org/patch/1241258/]
11Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
12Reviewed-by: Petr Vorel <pvorel@suse.cz>
13Signed-off-by: Petr Vorel <pvorel@suse.cz>
14Upstream-Status: accepted as 5b57ae2913e2d2d167cbd3822784b4c4ba336812
12--- 15---
13 lib/tst_clocks.c | 9 +++++---- 16 lib/tst_clocks.c | 16 ++++++----------
14 testcases/kernel/syscalls/gettimeofday/gettimeofday01.c | 6 ++---- 17 .../syscalls/gettimeofday/gettimeofday01.c | 6 ++----
15 testcases/kernel/syscalls/gettimeofday/gettimeofday02.c | 8 +++----- 18 .../syscalls/gettimeofday/gettimeofday02.c | 8 +++-----
16 3 files changed, 10 insertions(+), 13 deletions(-) 19 3 files changed, 11 insertions(+), 19 deletions(-)
17 20
21diff --git a/lib/tst_clocks.c b/lib/tst_clocks.c
22index 5195da38f..fa2f1cb84 100644
18--- a/lib/tst_clocks.c 23--- a/lib/tst_clocks.c
19+++ b/lib/tst_clocks.c 24+++ b/lib/tst_clocks.c
20@@ -22,21 +22,22 @@ 25@@ -3,28 +3,24 @@
21 #define _GNU_SOURCE 26 * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz>
22 #include <unistd.h> 27 */
28
29-/*
30- * clock_gettime() and clock_getres() functions
31- */
32-
33-#define _GNU_SOURCE
34-#include <unistd.h>
23 #include <time.h> 35 #include <time.h>
24-#include <sys/syscall.h> 36-#include <sys/syscall.h>
25- 37
26+#define TST_NO_DEFAULT_MAIN 38+#define TST_NO_DEFAULT_MAIN
27+#include "tst_test.h" 39+#include "tst_test.h"
28 #include "tst_clocks.h" 40 #include "tst_clocks.h"
@@ -45,6 +57,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
45- return syscall(SYS_clock_settime, clk_id, ts); 57- return syscall(SYS_clock_settime, clk_id, ts);
46+ return tst_syscall(__NR_clock_settime, clk_id, ts); 58+ return tst_syscall(__NR_clock_settime, clk_id, ts);
47 } 59 }
60diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
61index 583d8f7b9..08ea1673a 100644
48--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c 62--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
49+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c 63+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
50@@ -38,10 +38,8 @@ 64@@ -38,10 +38,8 @@
@@ -68,6 +82,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
68 82
69 /* gettimeofday returns an int, so we need to turn the long 83 /* gettimeofday returns an int, so we need to turn the long
70 * TEST_RETURN into an int to test with */ 84 * TEST_RETURN into an int to test with */
85diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
86index 1d60f448e..5170ad2f7 100644
71--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c 87--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
72+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c 88+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
73@@ -16,14 +16,12 @@ 89@@ -16,14 +16,12 @@
@@ -102,3 +118,5 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
102 tst_res(TBROK | TERRNO, "gettimeofday() failed"); 118 tst_res(TBROK | TERRNO, "gettimeofday() failed");
103 return; 119 return;
104 } 120 }
121--
1222.25.1