[PATCH] selftests/powerpc: Fix: use ucontext_t instead of struct ucontext

Subsystems: kernel selftest framework, the rest

STALE3096d

2 messages, 2 authors, 2018-02-14 · open the first message on its own page

[PATCH] selftests/powerpc: Fix: use ucontext_t instead of struct ucontext

From: Harish <hidden>
Date: 2018-02-13 06:33:04

With glibc 2.26 'struct ucontext' is removed to improve POSIX
compliance, which breaks powerpc/alignment_handler selftest.
Fix the test by using ucontext_t. Tested on ppc, works with older
glibc versions as well.

Fixes the following:
alignment_handler.c: In function ‘sighandler’:
alignment_handler.c:68:5: error: dereferencing pointer to incomplete type ‘struct ucontext’
  ucp->uc_mcontext.gp_regs[PT_NIP] += 4;
     ^~

Signed-off-by: Harish <redacted>
---
 tools/testing/selftests/powerpc/alignment/alignment_handler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/powerpc/alignment/alignment_handler.c b/tools/testing/selftests/powerpc/alignment/alignment_handler.c
index 39fd362..0f2698f 100644
--- a/tools/testing/selftests/powerpc/alignment/alignment_handler.c
+++ b/tools/testing/selftests/powerpc/alignment/alignment_handler.c
@@ -57,7 +57,7 @@ volatile int gotsig;
 
 void sighandler(int sig, siginfo_t *info, void *ctx)
 {
-	struct ucontext *ucp = ctx;
+	ucontext_t *ucp = ctx;
 
 	if (!testing) {
 		signal(sig, SIG_DFL);
-- 
2.7.4

Re: selftests/powerpc: Fix: use ucontext_t instead of struct ucontext

From: Michael Ellerman <hidden>
Date: 2018-02-14 05:43:51

On Tue, 2018-02-13 at 06:32:55 UTC, Harish wrote:
With glibc 2.26 'struct ucontext' is removed to improve POSIX
compliance, which breaks powerpc/alignment_handler selftest.
Fix the test by using ucontext_t. Tested on ppc, works with older
glibc versions as well.

Fixes the following:
alignment_handler.c: In function ���sighandler���:
alignment_handler.c:68:5: error: dereferencing pointer to incomplete type ���struct ucontext���
  ucp->uc_mcontext.gp_regs[PT_NIP] += 4;
     ^~

Signed-off-by: Harish <redacted>
Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/ecdf06e1ea5376bba03c155751f686

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help