]> granicus.if.org Git - strace/commitdiff
* process.c (printwaitn): Add comment about wait4() pid expansion.
authorDenys Vlasenko <dvlasenk@redhat.com>
Mon, 26 Jan 2009 19:09:35 +0000 (19:09 +0000)
committerDenys Vlasenko <dvlasenk@redhat.com>
Mon, 26 Jan 2009 19:09:35 +0000 (19:09 +0000)
Use #ifdef ALPHA instead of LINUX_64BIT, it was misleading
(by implying "any 64-bit platform").
* defs.h: Remove now-unused LINUX_64BIT define.
* resource.c (sys_osf_getrusage): Fix indentation.

ChangeLog
defs.h
process.c
resource.c

index ef043410a8365dd34629aa77a1e04fbf28e747fc..e6caa1b09e0cf6ae84d83c33752dac60ee36d2e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 2009-01-26  Denys Vlasenko  <dvlasenk@redhat.com>
 
-       * process.c (internal_clone): fix fallout from tcb table expansion
+       * process.c (printwaitn): Add comment about wait4() pid expansion.
+       Use #ifdef ALPHA instead of LINUX_64BIT, it was misleading
+       (by implying "any 64-bit platform").
+       * defs.h: Remove now-unused LINUX_64BIT define.
+       * resource.c (sys_osf_getrusage): Fix indentation.
+
+2009-01-26  Denys Vlasenko  <dvlasenk@redhat.com>
+
+       * process.c (internal_clone): Fix fallout from tcb table expansion
        simplification. Due to overlooked else, I forgot to group
        fork_tcb(tcp) and alloctcb(pid) in a block.
 
diff --git a/defs.h b/defs.h
index ce9b12fc61a97a7a45a4613ab77f5f006ebbbded..3e2cd9a39ed7baa48e7d6d64c1a608e4f491e4a5 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -96,9 +96,6 @@
 #  if defined(SPARC) || defined(SPARC64)
 #     define LINUXSPARC
 #  endif
-#  if defined(ALPHA)
-#     define LINUX_64BIT
-#  endif
 #  if defined(X86_64)
 #     define LINUX_X86_64
 #  endif
index 1b356bd12d85fd04b8be78faf2844438a514c23d..23e44f6df7a8d86ae614f52c8aa043f0e9942b1a 100644 (file)
--- a/process.c
+++ b/process.c
@@ -1971,10 +1971,7 @@ int status;
 }
 
 static int
-printwaitn(tcp, n, bitness)
-struct tcb *tcp;
-int n;
-int bitness;
+printwaitn(struct tcb *tcp, int n, int bitness)
 {
        int status;
        int exited = 0;
@@ -1982,6 +1979,14 @@ int bitness;
        if (entering(tcp)) {
                /*
                 * Sign-extend a 32-bit value when that's what it is.
+                *
+                * NB: On Linux, kernel-side pid_t is typedef'ed to int
+                * on all arches; also, glibc-2.8 truncates wait3 and wait4
+                * pid argument to int on 64bit arches, producing,
+                * for example, wait4(4294967295, ...) instead of -1
+                * in strace.
+                * Therefore, maybe it makes sense to *unconditionally*
+                * widen int to long here...
                 */
                long pid = tcp->u_arg[0];
                if (personality_wordsize[current_personality] < sizeof pid)
@@ -2007,7 +2012,7 @@ int bitness;
                                tprintf("NULL");
 #ifdef LINUX
                        else if (tcp->u_rval > 0) {
-#ifdef LINUX_64BIT
+#ifdef ALPHA
                                if (bitness)
                                        printrusage32(tcp, tcp->u_arg[3]);
                                else
index f4839fc71c1b409deda7219db3407ebd49af26f7..7607a7e1d695662582b37e92a85c0ee71f665457 100644 (file)
@@ -357,13 +357,13 @@ int
 sys_osf_getrusage(tcp)
 struct tcb *tcp;
 {
-    if (entering(tcp)) {
-       printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
-       tprintf(", ");
-    }
-    else
-       printrusage32(tcp, tcp->u_arg[1]);
-    return 0;
+       if (entering(tcp)) {
+               printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
+               tprintf(", ");
+       }
+       else
+               printrusage32(tcp, tcp->u_arg[1]);
+       return 0;
 }
 #endif /* ALPHA */