From: Dmitry V. Levin Date: Fri, 19 Feb 2016 03:33:49 +0000 (+0000) Subject: getrusage.test: fix build on x32 X-Git-Tag: v4.12~530 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2743efccce59e5b10cbebd462368879221a9f025;p=strace getrusage.test: fix build on x32 * tests/getrusage.c: Include (main): Print members of struct timeval using %ju format. --- diff --git a/tests/getrusage.c b/tests/getrusage.c index 99b4fa69..7fd98237 100644 --- a/tests/getrusage.c +++ b/tests/getrusage.c @@ -32,6 +32,7 @@ #ifdef __NR_getrusage # include +# include # include # include @@ -40,14 +41,16 @@ main(void) { struct rusage *const usage = tail_alloc(sizeof(struct rusage)); int rc = syscall(__NR_getrusage, RUSAGE_SELF, usage); - printf("getrusage(RUSAGE_SELF, {ru_utime={%lu, %lu}" - ", ru_stime={%lu, %lu}, ru_maxrss=%lu, ru_ixrss=%lu" + printf("getrusage(RUSAGE_SELF, {ru_utime={%ju, %ju}" + ", ru_stime={%ju, %ju}, ru_maxrss=%lu, ru_ixrss=%lu" ", ru_idrss=%lu, ru_isrss=%lu, ru_minflt=%lu" ", ru_majflt=%lu, ru_nswap=%lu, ru_inblock=%lu" ", ru_oublock=%lu, ru_msgsnd=%lu, ru_msgrcv=%lu" ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %d\n", - usage->ru_utime.tv_sec, usage->ru_utime.tv_usec, - usage->ru_stime.tv_sec, usage->ru_stime.tv_usec, + (uintmax_t) usage->ru_utime.tv_sec, + (uintmax_t) usage->ru_utime.tv_usec, + (uintmax_t) usage->ru_stime.tv_sec, + (uintmax_t) usage->ru_stime.tv_usec, usage->ru_maxrss, usage->ru_ixrss, usage->ru_idrss, usage->ru_isrss, usage->ru_minflt, usage->ru_majflt, usage->ru_nswap, usage->ru_inblock, usage->ru_oublock,