]> granicus.if.org Git - strace/commitdiff
x86: fix required kernel version for GETREGSET
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 14 Feb 2013 23:24:19 +0000 (00:24 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 14 Feb 2013 23:24:19 +0000 (00:24 +0100)
* syscall.c (get_regs): [X86] Use GETREGSET only if kernel >= 2.6.35

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
syscall.c

index 7e5cff0cfc74f6277fe39568f25389218e44ff3d..433ee724ae15a6163d68a93fb1ff64b11837d6f4 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -914,8 +914,11 @@ void get_regs(pid_t pid)
 # elif defined(I386)
        get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, (long) &i386_regs);
 # elif defined(X86_64) || defined(X32)
-       /* PTRACE_GETREGSET was introduced around 2.6.25 */
-       if (os_release >= KERNEL_VERSION(2,6,30)) {
+       /*
+        * PTRACE_GETREGSET was introduced in 2.6.33.
+        * Let's be paranoid and require a bit later kernel.
+        */
+       if (os_release >= KERNEL_VERSION(2,6,35)) {
                /*x86_io.iov_base = &x86_regs_union; - already is */
                x86_io.iov_len = sizeof(x86_regs_union);
                get_regs_error = ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, (long) &x86_io);