diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2009-01-26 19:09:35 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2009-06-02 16:36:48 -0700 |
commit | c37bef500b938300913ffd34486cfca6ae003d8b (patch) | |
tree | d363eae04690ae65e6f6ba8e313012c832cff303 | |
parent | 330bf8716b42e4ab96678fe8aa679f0c2d2d9d18 (diff) | |
download | strace-c37bef500b938300913ffd34486cfca6ae003d8b.tar.gz |
* 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.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | defs.h | 3 | ||||
-rw-r--r-- | process.c | 15 | ||||
-rw-r--r-- | resource.c | 14 |
4 files changed, 26 insertions, 16 deletions
@@ -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. @@ -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 @@ -1968,10 +1968,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; @@ -1979,6 +1976,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) @@ -2004,7 +2009,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 diff --git a/resource.c b/resource.c index f4839fc71..7607a7e1d 100644 --- a/resource.c +++ b/resource.c @@ -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 */ |