]> granicus.if.org Git - strace/commitdiff
tests/restart_syscall: add a workaround for old arm kernels
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 13 Dec 2015 01:12:55 +0000 (01:12 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 13 Dec 2015 01:12:55 +0000 (01:12 +0000)
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

index 9de8625fb17f9c32850800fb481ee73995ffedb0..3989a84ecc5ef3bee84576167fc5b93e28cebcf6 100644 (file)
@@ -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 \\+\\+\\+");