1 /* 2 * In the new syscall ABI, the system call number is in R3. 3 */ 4 if (upeek(tcp->pid, 4*(REG_REG0+3), &scno) < 0) 5 return -1; 6 7 if (scno < 0) { 8 /* Odd as it may seem, a glibc bug has been known to cause 9 glibc to issue bogus negative syscall numbers. So for 10 our purposes, make strace print what it *should* have been */ 11 long correct_scno = (scno & 0xff); 12 if (debug_flag) 13 fprintf(stderr, 14 "Detected glibc bug: bogus system call" 15 " number = %ld, correcting to %ld\n", 16 scno, 17 correct_scno); 18 scno = correct_scno; 19 } 20