From 703a7166aef74ba9503257e74e6df37bc7405e57 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 13 Dec 2015 01:12:55 +0000 Subject: [PATCH] tests/restart_syscall: add a workaround for old arm kernels As arm kernels used to overwrite ARM_r0 with -EINTR after ERESTART_RESTARTBLOCK, update regexp to workaround this. * tests/restart_syscall.c (main) [__arm__]: Add 0xfffffffc as a valid alternative value for the first argument of restarted nanosleep syscall. --- tests/restart_syscall.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/restart_syscall.c b/tests/restart_syscall.c index 9de8625f..3989a84e 100644 --- a/tests/restart_syscall.c +++ b/tests/restart_syscall.c @@ -64,8 +64,15 @@ main(void) (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, (intmax_t) rem.tv_sec, (intmax_t) rem.tv_nsec); puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---"); - printf("(nanosleep\\(\\{%jd, %jd\\}, %p|restart_syscall\\(<\\.\\.\\." +#ifdef __arm__ +/* old kernels used to overwrite ARM_r0 with -EINTR */ +# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|" +#else +# define ALTERNATIVE_NANOSLEEP_REQ "" +#endif + printf("(nanosleep\\((%s\\{%jd, %jd\\}), %p|restart_syscall\\(<\\.\\.\\." " resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n", + ALTERNATIVE_NANOSLEEP_REQ, (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, &rem); puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); -- 2.40.0