blob: 3f9f33b48744886fa2c180fe743e0add28beaea8 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 862b807076d57f2f58ed9d572ddac8bb402774a2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 10 Jun 2017 01:01:10 -0700
4Subject: [PATCH 2/6] context APIs are not available on musl
5
6Upstream-Status: Pending
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 memcheck/tests/linux/stack_changes.c | 7 ++++++-
11 1 file changed, 6 insertions(+), 1 deletion(-)
12
13diff --git a/memcheck/tests/linux/stack_changes.c b/memcheck/tests/linux/stack_changes.c
14index a978fc2..ffb49c6 100644
15--- a/memcheck/tests/linux/stack_changes.c
16+++ b/memcheck/tests/linux/stack_changes.c
17@@ -10,6 +10,7 @@
18 // This test is checking the libc context calls (setcontext, etc.) and
19 // checks that Valgrind notices their stack changes properly.
20
21+#ifdef __GLIBC__
22 typedef struct ucontext mycontext;
23
24 mycontext ctx1, ctx2, oldc;
25@@ -51,9 +52,11 @@ int init_context(mycontext *uc)
26
27 return ret;
28 }
29+#endif
30
31 int main(int argc, char **argv)
32 {
33+#ifdef __GLIBC__
34 int c1 = init_context(&ctx1);
35 int c2 = init_context(&ctx2);
36
37@@ -66,6 +69,8 @@ int main(int argc, char **argv)
38 //free(ctx1.uc_stack.ss_sp);
39 VALGRIND_STACK_DEREGISTER(c2);
40 //free(ctx2.uc_stack.ss_sp);
41-
42+#else
43+ printf("libc context call APIs e.g. getcontext() are deprecated by posix\n");
44+#endif
45 return 0;
46 }
47--
482.13.1
49