diff options
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.patch | 122 |
1 files changed, 0 insertions, 122 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 deleted file mode 100644 index ac8f08ef5a..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | From 89c5841bd148a7ae70c65f4a1ca5996b7f0cddfa Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 19 Feb 2020 22:52:04 -0800 | ||
4 | Subject: [PATCH] syscalls: Check for time64 unsafe syscalls before using them | ||
5 | |||
6 | musl is using 64bit time_t now on 32bit architectures and these syscalls | ||
7 | no longer exist, therefore its better to check for them being available | ||
8 | before using them | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com> | ||
12 | Reviewed-by: Petr Vorel <pvorel@suse.cz> | ||
13 | Signed-off-by: Petr Vorel <pvorel@suse.cz> | ||
14 | Upstream-Status: accepted as 5b57ae2913e2d2d167cbd3822784b4c4ba336812 | ||
15 | --- | ||
16 | lib/tst_clocks.c | 16 ++++++---------- | ||
17 | .../syscalls/gettimeofday/gettimeofday01.c | 6 ++---- | ||
18 | .../syscalls/gettimeofday/gettimeofday02.c | 8 +++----- | ||
19 | 3 files changed, 11 insertions(+), 19 deletions(-) | ||
20 | |||
21 | diff --git a/lib/tst_clocks.c b/lib/tst_clocks.c | ||
22 | index 5195da38f..fa2f1cb84 100644 | ||
23 | --- a/lib/tst_clocks.c | ||
24 | +++ b/lib/tst_clocks.c | ||
25 | @@ -3,28 +3,24 @@ | ||
26 | * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz> | ||
27 | */ | ||
28 | |||
29 | -/* | ||
30 | - * clock_gettime() and clock_getres() functions | ||
31 | - */ | ||
32 | - | ||
33 | -#define _GNU_SOURCE | ||
34 | -#include <unistd.h> | ||
35 | #include <time.h> | ||
36 | -#include <sys/syscall.h> | ||
37 | |||
38 | +#define TST_NO_DEFAULT_MAIN | ||
39 | +#include "tst_test.h" | ||
40 | #include "tst_clocks.h" | ||
41 | +#include "lapi/syscalls.h" | ||
42 | |||
43 | int tst_clock_getres(clockid_t clk_id, struct timespec *res) | ||
44 | { | ||
45 | - return syscall(SYS_clock_getres, clk_id, res); | ||
46 | + return tst_syscall(__NR_clock_getres, clk_id, res); | ||
47 | } | ||
48 | |||
49 | int tst_clock_gettime(clockid_t clk_id, struct timespec *ts) | ||
50 | { | ||
51 | - return syscall(SYS_clock_gettime, clk_id, ts); | ||
52 | + return tst_syscall(__NR_clock_gettime, clk_id, ts); | ||
53 | } | ||
54 | |||
55 | int tst_clock_settime(clockid_t clk_id, struct timespec *ts) | ||
56 | { | ||
57 | - return syscall(SYS_clock_settime, clk_id, ts); | ||
58 | + return tst_syscall(__NR_clock_settime, clk_id, ts); | ||
59 | } | ||
60 | diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c | ||
61 | index 583d8f7b9..08ea1673a 100644 | ||
62 | --- a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c | ||
63 | +++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c | ||
64 | @@ -38,10 +38,8 @@ | ||
65 | #include <sys/time.h> | ||
66 | #include <errno.h> | ||
67 | #include "test.h" | ||
68 | -#include <sys/syscall.h> | ||
69 | #include <unistd.h> | ||
70 | - | ||
71 | -#define gettimeofday(a,b) syscall(__NR_gettimeofday,a,b) | ||
72 | +#include "lapi/syscalls.h" | ||
73 | |||
74 | char *TCID = "gettimeofday01"; | ||
75 | int TST_TOTAL = 1; | ||
76 | @@ -63,7 +61,7 @@ int main(int ac, char **av) | ||
77 | for (lc = 0; TEST_LOOPING(lc); lc++) { | ||
78 | tst_count = 0; | ||
79 | |||
80 | - TEST(gettimeofday((void *)-1, (void *)-1)); | ||
81 | + TEST(ltp_syscall(__NR_gettimeofday, (void *)-1, (void *)-1)); | ||
82 | |||
83 | /* gettimeofday returns an int, so we need to turn the long | ||
84 | * TEST_RETURN into an int to test with */ | ||
85 | diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c | ||
86 | index 1d60f448e..5170ad2f7 100644 | ||
87 | --- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c | ||
88 | +++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c | ||
89 | @@ -16,14 +16,12 @@ | ||
90 | #include <stdint.h> | ||
91 | #include <sys/time.h> | ||
92 | #include <stdlib.h> | ||
93 | -#include <sys/syscall.h> | ||
94 | #include <unistd.h> | ||
95 | #include <time.h> | ||
96 | #include <errno.h> | ||
97 | |||
98 | #include "tst_test.h" | ||
99 | - | ||
100 | -#define gettimeofday(a,b) syscall(__NR_gettimeofday,a,b) | ||
101 | +#include "lapi/syscalls.h" | ||
102 | |||
103 | static volatile sig_atomic_t done; | ||
104 | static char *str_rtime; | ||
105 | @@ -48,13 +46,13 @@ static void verify_gettimeofday(void) | ||
106 | |||
107 | alarm(rtime); | ||
108 | |||
109 | - if (gettimeofday(&tv1, NULL)) { | ||
110 | + if (tst_syscall(__NR_gettimeofday, &tv1, NULL)) { | ||
111 | tst_res(TBROK | TERRNO, "gettimeofday() failed"); | ||
112 | return; | ||
113 | } | ||
114 | |||
115 | while (!done) { | ||
116 | - if (gettimeofday(&tv2, NULL)) { | ||
117 | + if (tst_syscall(__NR_gettimeofday, &tv2, NULL)) { | ||
118 | tst_res(TBROK | TERRNO, "gettimeofday() failed"); | ||
119 | return; | ||
120 | } | ||
121 | -- | ||
122 | 2.25.1 | ||