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.
# if defined(SPARC) || defined(SPARC64)
# define LINUXSPARC
# endif
-# if defined(ALPHA)
-# define LINUX_64BIT
-# endif
# if defined(X86_64)
# define LINUX_X86_64
# endif
}
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;
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)
tprintf("NULL");
#ifdef LINUX
else if (tcp->u_rval > 0) {
-#ifdef LINUX_64BIT
+#ifdef ALPHA
if (bitness)
printrusage32(tcp, tcp->u_arg[3]);
else
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 */