diff -Nur strace-4.4.orig/desc.c strace-4.4/desc.c
--- strace-4.4.orig/desc.c Tue Mar 13 00:29:05 2001
+++ strace-4.4/desc.c Fri Oct 19 16:35:23 2001
-@@ -139,6 +139,11 @@
- #ifdef F_UNSHARE
- { F_UNSHARE, "F_UNSHARE" },
- #endif
-+#if defined(F_GETLK64) && F_GETLK64 != F_GETLK
-+ { F_GETLK64, "F_GETLK64" },
-+ { F_SETLK64, "F_SETLK64" },
-+ { F_SETLKW64, "F_SETLKW64" },
-+#endif
- { 0, NULL },
- };
-
-@@ -335,6 +340,12 @@
+@@ -335,6 +335,12 @@
default:
tprintf(", %#lx", tcp->u_arg[2]);
break;
{ 3, 0, sys_mincore, "mincore" }, /* 375 */
{ 3, 0, printargs, "pciconfig_iobase" }, /* 376 */
+ { 3, 0, sys_getdents64, "getdents64" }, /* 377 */
-diff -Nur strace-4.4.orig/linux/sparc/syscall.h strace-4.4/linux/sparc/syscall.h
---- strace-4.4.orig/linux/sparc/syscall.h Fri Oct 19 16:35:06 2001
-+++ strace-4.4/linux/sparc/syscall.h Fri Oct 19 16:35:23 2001
-@@ -87,7 +87,7 @@
- /* 2.2 file system */
- int sys_chdir(),sys_chroot();
- int sys_fchdir(),sys_fchroot();
--int sys_mkdir(),sys_rmdir(),sys_getdirentries(), sys_getdents(),sys_readdir();
-+int sys_mkdir(),sys_rmdir(),sys_getdirentries(), sys_getdents(),sys_getdents64(),sys_readdir();
- int sys_creat(),sys_open(),sys_mknod(),sys_unlink(),sys_stat(),sys_fstat(),sys_lstat();
- int sys_chown(),sys_fchown(),sys_chmod(),sys_fchmod(),sys_utimes();
- int sys_link(),sys_symlink(),sys_readlink(),sys_rename();
diff -Nur strace-4.4.orig/linux/sparc/syscallent.h strace-4.4/linux/sparc/syscallent.h
--- strace-4.4.orig/linux/sparc/syscallent.h Fri Oct 19 16:35:06 2001
+++ strace-4.4/linux/sparc/syscallent.h Fri Oct 19 16:37:21 2001
{ 4, 0, printargs, "getdirentries" }, /* 156 */
{ 2, TF, sys_statfs, "statfs" }, /* 157 */
{ 2, 0, sys_fstatfs, "fstatfs" }, /* 158 */
-diff -Nur strace-4.4.orig/linux/syscall.h strace-4.4/linux/syscall.h
---- strace-4.4.orig/linux/syscall.h Fri Oct 19 16:35:06 2001
-+++ strace-4.4/linux/syscall.h Fri Oct 19 16:35:23 2001
-@@ -69,7 +69,7 @@
- int sys_getpgid(), sys_fchdir(), sys_bdflush();
- int sys_sysfs(), sys_personality(), sys_afs_syscall();
- int sys_setfsuid(), sys_setfsgid(), sys_llseek();
--int sys_getdents(), sys_flock(), sys_msync();
-+int sys_getdents(), sys_getdents64(), sys_flock(), sys_msync();
- int sys_readv(), sys_writev(), sys_select();
- int sys_getsid(), sys_fdatasync(), sys_sysctl();
- int sys_mlock(), sys_munlock(), sys_mlockall(), sys_munlockall(), sys_madvise();
diff -Nur strace-4.4.orig/linux/syscallent.h strace-4.4/linux/syscallent.h
--- strace-4.4.orig/linux/syscallent.h Fri Oct 19 16:35:06 2001
+++ strace-4.4/linux/syscallent.h Fri Oct 19 16:36:24 2001
-diff -Nur strace-4.4.orig/file.c strace-4.4/file.c
---- strace-4.4.orig/file.c Tue Mar 27 14:17:17 2001
-+++ strace-4.4/file.c Fri Oct 19 15:28:02 2001
-@@ -1545,6 +1545,20 @@
- return 0;
- }
-
-+#ifdef linux
-+int
-+sys_pivot_root(tcp)
-+struct tcb *tcp;
-+{
-+ if (entering(tcp)) {
-+ printpath(tcp, tcp->u_arg[0]);
-+ tprintf(", ");
-+ printpath(tcp, tcp->u_arg[1]);
-+ }
-+ return 0;
-+}
-+#endif
-+
- int
- sys_link(tcp)
- struct tcb *tcp;
diff -Nur strace-4.4.orig/linux/alpha/syscallent.h strace-4.4/linux/alpha/syscallent.h
--- strace-4.4.orig/linux/alpha/syscallent.h Mon May 1 03:54:00 2000
+++ strace-4.4/linux/alpha/syscallent.h Fri Oct 19 15:28:02 2001
+ { 3, 0, sys_setresgid, "setresgid" }, /* 371 */
+ { 3, 0, sys_getresgid, "getresgid" }, /* 372 */
+ { 5, 0, printargs, "dipc" }, /* 373, not implemented */
-+ { 2, TF, sys_pivot_root, "pivot_root" }, /* 374 */
++ { 2, TF, sys_pivotroot, "pivot_root" }, /* 374 */
+ { 3, 0, sys_mincore, "mincore" }, /* 375 */
+ { 3, 0, printargs, "pciconfig_iobase" }, /* 376 */
diff -Nur strace-4.4.orig/linux/dummy.h strace-4.4/linux/dummy.h
+/* 32bit uids */
+int sys_getuid32(), sys_getgid32(), sys_geteuid32(), sys_getegid32();
+int sys_setreuid32(), sys_setregid32(), sys_getgroups32(), sys_setgroups32();
-+int sys_fchown(), sys_setresuid32(), sys_getresuid32(), sys_setresgid32();
-+int sys_getresgid32(), sys_chown(), sys_setuid32(), sys_setgid32();
++int sys_setresuid32(), sys_getresuid32(), sys_setresgid32();
++int sys_getresgid32(), sys_setuid32(), sys_setgid32();
+int sys_setfsuid32(), sys_setfsgid32();
+
/* 1.2 memory management */
diff -Nur strace-4.4.orig/linux/syscall.h strace-4.4/linux/syscall.h
--- strace-4.4.orig/linux/syscall.h Sun Apr 8 21:14:05 2001
+++ strace-4.4/linux/syscall.h Fri Oct 19 15:28:02 2001
-@@ -37,6 +37,7 @@
- int sys_unlink(), sys_execve(), sys_chdir(), sys_time(), sys_mknod();
- int sys_chmod(), sys_chown(), sys_break(), sys_oldstat();
- int sys_lseek(), sys_getpid(), sys_mount(), sys_umount(), sys_umount2();
-+int sys_pivot_root();
- int sys_setuid(), sys_getuid(), sys_stime(), sys_ptrace();
- int sys_alarm(), sys_oldfstat(), sys_pause(), sys_utime();
- int sys_stty(), sys_gtty(), sys_access(), sys_nice(), sys_ftime();
-@@ -84,6 +85,12 @@
+@@ -84,6 +84,12 @@
int sys_sendfile(), sys_old_mmap(), sys_stat64(), sys_lstat64(), sys_fstat64();
int sys_truncate64(), sys_ftruncate64(), sys_pivotroot();
+/* 32bit uids */
+int sys_getuid32(), sys_getgid32(), sys_geteuid32(), sys_getegid32();
+int sys_setreuid32(), sys_setregid32(), sys_getgroups32(), sys_setgroups32();
-+int sys_fchown(), sys_setresuid32(), sys_getresuid32(), sys_setresgid32();
-+int sys_getresgid32(), sys_chown(), sys_setuid32(), sys_setgid32();
++int sys_setresuid32(), sys_getresuid32(), sys_setresgid32();
++int sys_getresgid32(), sys_setuid32(), sys_setgid32();
+int sys_setfsuid32(), sys_setfsgid32();
/* sys_socketcall subcalls */
-@@ -171,6 +178,8 @@
- int osf_statfs(), osf_fstatfs();
- #endif
-
-+int sys_madvise(), sys_mincore();
-+
- #ifdef IA64
- int sys_getpmsg(), sys_putpmsg(); /* STREAMS stuff */
- #endif
diff -Nur strace-4.4.orig/process.c strace-4.4/process.c
--- strace-4.4.orig/process.c Fri Oct 19 15:27:34 2001
+++ strace-4.4/process.c Fri Oct 19 15:28:02 2001
int
sys_setpgrp(tcp)
struct tcb *tcp;
+--- strace-4.4.91/linux/syscallent.h.orig Tue Jan 14 20:02:35 2003
++++ strace-4.4.91/linux/syscallent.h Tue Jan 14 21:03:13 2003
+@@ -246,23 +246,23 @@
+ { 3, TF, sys_chown, "lchown32" }, /* 198 */
+ { 0, 0, sys_getuid, "getuid32" }, /* 199 */
+
+- { 0, 0, printargs, "getgid32" }, /* 200 */
+- { 0, 0, printargs, "geteuid32" }, /* 201 */
+- { 0, 0, printargs, "getegid32" }, /* 202 */
+- { 2, 0, printargs, "setreuid32" }, /* 203 */
+- { 2, 0, printargs, "setregid32" }, /* 204 */
+- { 2, 0, printargs, "getgroups32" }, /* 205 */
+- { 2, 0, printargs, "setgroups32" }, /* 206 */
+- { 3, 0, printargs, "fchown32" }, /* 207 */
+- { 3, 0, printargs, "setresuid32" }, /* 208 */
+- { 3, 0, printargs, "getresuid32" }, /* 209 */
+- { 3, 0, printargs, "setresgid32" }, /* 210 */
+- { 3, 0, printargs, "getresgid32" }, /* 211 */
+- { 3, TF, printargs, "chown32" }, /* 212 */
+- { 1, 0, printargs, "setuid32" }, /* 213 */
+- { 1, 0, printargs, "setgid32" }, /* 214 */
+- { 1, 0, printargs, "setfsuid32" }, /* 215 */
+- { 1, 0, printargs, "setfsgid32" }, /* 216 */
++ { 0, 0, sys_getgid32, "getgid32" }, /* 200 */
++ { 0, 0, sys_geteuid32, "geteuid32" }, /* 201 */
++ { 0, 0, sys_getegid32, "getegid32" }, /* 202 */
++ { 2, 0, sys_setreuid32, "setreuid32" }, /* 203 */
++ { 2, 0, sys_setregid32, "setregid32" }, /* 204 */
++ { 2, 0, sys_getgroups32, "getgroups32" }, /* 205 */
++ { 2, 0, sys_setgroups32, "setgroups32" }, /* 206 */
++ { 3, 0, sys_fchown, "fchown32" }, /* 207 */
++ { 3, 0, sys_setresuid32, "setresuid32" }, /* 208 */
++ { 3, 0, sys_getresuid32, "getresuid32" }, /* 209 */
++ { 3, 0, sys_setresgid32, "setresgid32" }, /* 210 */
++ { 3, 0, sys_getresgid32, "getresgid32" }, /* 211 */
++ { 3, TF, sys_chown, "chown32" }, /* 212 */
++ { 1, 0, sys_setuid32, "setuid32" }, /* 213 */
++ { 1, 0, sys_setgid32, "setgid32" }, /* 214 */
++ { 1, 0, sys_setfsuid32, "setfsuid32" }, /* 215 */
++ { 1, 0, sys_setfsgid32, "setfsgid32" }, /* 216 */
+ { 2, TF, sys_pivotroot, "pivot_root" }, /* 217 */
+ { 3, 0, printargs, "mincore" }, /* 218 */
+ { 3, 0, sys_madvise, "madvise" }, /* 219 */
+++ /dev/null
-diff -durN strace-4.4.orig/strace.c strace-4.4/strace.c
---- strace-4.4.orig/strace.c Fri Aug 3 13:43:35 2001
-+++ strace-4.4/strace.c Thu Jul 4 10:41:55 2002
-@@ -993,58 +993,110 @@
- #ifdef LINUX
- /*
- * Linux wrongly insists the child be stopped
-- * before detaching. Arghh. We go through hoops
-- * to make a clean break of things.
-+ * before detaching. This creates numerous headaches
-+ * as the process we are tracing may be running.
-+ *
-+ * First try to simply detach from the process; if it was
-+ * already stopped, this will succeed and we're done.
-+ *
-+ * Otherwise stop the process by sending it a SIGSTOP
-+ * signal.
-+ *
-+ * Once the process is stopped we have to make sure it
-+ * received the SIGSTOP (it may have received a SIGTRAP or
-+ * other signal). If it did not receive the SIGSTOP,
-+ * restart the process and try again.
-+ *
-+ * Once stopped with a SIGSTOP, we can detach from the
-+ * process via PTRACE_DETACH.
-+ *
- */
--#if defined(SPARC)
--#undef PTRACE_DETACH
--#define PTRACE_DETACH PTRACE_SUNDETACH
--#endif
-+
- if ((error = ptrace(PTRACE_DETACH, tcp->pid, (char *) 1, sig)) == 0) {
- /* On a clear day, you can see forever. */
-- }
-- else if (errno != ESRCH) {
-- /* Shouldn't happen. */
-- perror("detach: ptrace(PTRACE_DETACH, ...)");
-- }
-- else if (kill(tcp->pid, 0) < 0) {
-- if (errno != ESRCH)
-- perror("detach: checking sanity");
-- }
-- else if (kill(tcp->pid, SIGSTOP) < 0) {
-- if (errno != ESRCH)
-- perror("detach: stopping child");
-- }
-- else {
-+ } else {
-+
- for (;;) {
-- if (waitpid(tcp->pid, &status, 0) < 0) {
-- if (errno != ECHILD)
-+ if (kill(tcp->pid, 0) < 0) {
-+ if (errno != ESRCH)
-+ perror("detach: checking sanity");
-+ }
-+ else if (kill(tcp->pid, SIGSTOP) < 0) {
-+ if (errno != ESRCH)
-+ perror("detach: stopping child");
-+ }
-+
-+ /*
-+ * At this point the child should be stopped. Try to
-+ * wait on it so we can get its stop status. Use WNOHANG
-+ * to avoid this wait hanging.
-+ */
-+ if (waitpid (tcp->pid, &status, (WUNTRACED | WNOHANG)) < 0) {
-+ if (errno != ECHILD) {
- perror("detach: waiting");
-- break;
-+ } else {
-+
-+ /*
-+ * Try again, this time with the __WCLONE
-+ * flag. Note we may get notifications
-+ * for other processes/threads!
-+ */
-+ errno = 0;
-+ while (1) {
-+ int x;
-+
-+ x = waitpid (-1, &status, __WCLONE);
-+ if (x == tcp->pid || x < 0 || errno != 0)
-+ break;
-+ }
-+ }
-+
-+ if (errno) {
-+ perror ("Unable to wait on inferior");
-+ return -1;
-+ }
- }
-+
-+ /*
-+ * At this point we have wait status for the
-+ * inferior. If it did not stop, then all
-+ * bets are off.
-+ */
- if (!WIFSTOPPED(status)) {
- /* Au revoir, mon ami. */
- break;
- }
-+
-+ /*
-+ * If the process/thread has stopped with a
-+ * SIGSTOP, then we can continue and detach
-+ * with PTRACE_DETACH.
-+ */
- if (WSTOPSIG(status) == SIGSTOP) {
- if ((error = ptrace(PTRACE_DETACH,
-- tcp->pid, (char *) 1, sig)) < 0) {
-+ tcp->pid, (char *) 1, sig)) < 0) {
- if (errno != ESRCH)
- perror("detach: ptrace(PTRACE_DETACH, ...)");
- /* I died trying. */
- }
- break;
- }
-+
-+ /*
-+ * The process/thread did not stop with a SIGSTOP,
-+ * so let it continue and try again to stop it with
-+ * a SIGSTOP.
-+ */
- if ((error = ptrace(PTRACE_CONT, tcp->pid, (char *) 1,
-- WSTOPSIG(status) == SIGTRAP ?
-- 0 : WSTOPSIG(status))) < 0) {
-+ WSTOPSIG(status) == SIGTRAP ?
-+ 0 : WSTOPSIG(status))) < 0) {
- if (errno != ESRCH)
- perror("detach: ptrace(PTRACE_CONT, ...)");
- break;
- }
- }
- }
--#endif /* LINUX */
-+#endif
-
- #if defined(SUNOS4)
- /* PTRACE_DETACH won't respect `sig' argument, so we post it here. */