]> granicus.if.org Git - strace/commitdiff
Optimize known_scno()
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 18 Feb 2011 23:19:47 +0000 (23:19 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 18 Feb 2011 23:19:47 +0000 (23:19 +0000)
* syscall.c (known_scno): Do not check for native_scno field on
platforms that support only one personality.

syscall.c

index dc82b2a2face6251349574ff8613bfdb64de1ad4..79d3b4a38765105da67779f7b5206ae501633db6 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -1326,13 +1326,14 @@ get_scno(struct tcb *tcp)
 
 
 long
-known_scno(tcp)
-struct tcb *tcp;
+known_scno(struct tcb *tcp)
 {
        long scno = tcp->scno;
+#if SUPPORTED_PERSONALITIES > 1
        if (scno >= 0 && scno < nsyscalls && sysent[scno].native_scno != 0)
                scno = sysent[scno].native_scno;
        else
+#endif
                scno += NR_SYSCALL_BASE;
        return scno;
 }