From: Jiri P. <jpa...@we...> - 2009-10-30 16:52:15
|
Hello, this is another chunk of compiler warning fixes in LTP tests, related to printf format strings. They have multiple causes: - most of them are caused by %d used for the TEST_RETURN variable (as in a previous patch) - off_t are cast to (int64_t) and PRId64 output specifier is used for them - other types are cast to (intmax_t) or (uintmax_t) and use the %jd or %ju (C99) output specifier. I've used this solution because it's generally correct, easy to use solution that is portable and (IMHO) more readable than using PRId64/PRIu64 and a cast (which you generally can't avoid). This way, there's only a cast. - in ioperm test, address should be declared as unsigned long (according to ioperm(2)) - other little fixes (foo vs. *foo, %S vs. %s, %0 vs. %o) Regards Jiri Palecek --- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl02.c | 6 +- testcases/kernel/syscalls/fcntl/fcntl03.c | 6 +- testcases/kernel/syscalls/fcntl/fcntl04.c | 6 +- testcases/kernel/syscalls/fcntl/fcntl05.c | 6 +- testcases/kernel/syscalls/fcntl/fcntl11.c | 7 +- testcases/kernel/syscalls/fcntl/fcntl14.c | 13 ++-- testcases/kernel/syscalls/fcntl/fcntl17.c | 8 ++- testcases/kernel/syscalls/fcntl/fcntl19.c | 7 +- testcases/kernel/syscalls/fcntl/fcntl20.c | 7 +- testcases/kernel/syscalls/fcntl/fcntl21.c | 7 +- testcases/kernel/syscalls/fcntl/fcntl22.c | 4 +- testcases/kernel/syscalls/fork/fork09.c | 2 +- testcases/kernel/syscalls/ftruncate/ftruncate01.c | 2 +- testcases/kernel/syscalls/ftruncate/ftruncate04.c | 6 +- .../kernel/syscalls/gettimeofday/gettimeofday02.c | 9 ++- testcases/kernel/syscalls/inotify/inotify02.c | 6 +- testcases/kernel/syscalls/ioperm/ioperm01.c | 6 +- testcases/kernel/syscalls/ipc/msgctl/msgctl02.c | 10 ++-- testcases/kernel/syscalls/ipc/msgctl/msgctl06.c | 6 +- testcases/kernel/syscalls/ipc/semctl/semctl07.c | 2 +- testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 4 +- testcases/kernel/syscalls/keyctl/keyctl01.c | 4 +- testcases/kernel/syscalls/llseek/llseek01.c | 7 +- testcases/kernel/syscalls/lseek/lseek01.c | 4 +- testcases/kernel/syscalls/lseek/lseek07.c | 5 +- testcases/kernel/syscalls/mkdir/mkdir08.c | 2 +- testcases/kernel/syscalls/mknod/mknod01.c | 2 +- testcases/kernel/syscalls/mknod/mknod06.c | 2 +- testcases/kernel/syscalls/mknod/mknod07.c | 2 +- testcases/kernel/syscalls/mknod/mknod09.c | 2 +- testcases/kernel/syscalls/mlockall/mlockall01.c | 7 +- testcases/kernel/syscalls/mlockall/mlockall02.c | 2 +- testcases/kernel/syscalls/mlockall/mlockall03.c | 2 +- .../syscalls/move_pages/move_pages_support.c | 2 +- testcases/kernel/syscalls/msync/msync03.c | 2 +- testcases/kernel/syscalls/msync/msync04.c | 2 +- testcases/kernel/syscalls/msync/msync05.c | 2 +- testcases/kernel/syscalls/munlock/munlock01.c | 12 ++-- testcases/kernel/syscalls/munlock/munlock02.c | 7 +- .../kernel/syscalls/munlockall/munlockall01.c | 8 +- testcases/kernel/syscalls/munmap/munmap03.c | 2 +- testcases/kernel/syscalls/nanosleep/nanosleep01.c | 5 +- testcases/kernel/syscalls/nanosleep/nanosleep02.c | 5 +- testcases/kernel/syscalls/nanosleep/nanosleep03.c | 2 +- testcases/kernel/syscalls/nanosleep/nanosleep04.c | 2 +- testcases/kernel/syscalls/newuname/newuname01.c | 2 +- testcases/kernel/syscalls/nice/nice04.c | 8 +- testcases/kernel/syscalls/nice/nice05.c | 2 +- testcases/kernel/syscalls/pathconf/pathconf01.c | 2 +- testcases/kernel/syscalls/pipe/pipe03.c | 8 +- testcases/kernel/syscalls/prctl/prctl01.c | 6 +- testcases/kernel/syscalls/prctl/prctl02.c | 6 +- testcases/kernel/syscalls/pread/pread01.c | 7 +- testcases/kernel/syscalls/pread/pread02.c | 2 +- testcases/kernel/syscalls/pread/pread03.c | 4 +- testcases/kernel/syscalls/pselect/pselect01.c | 7 +- testcases/kernel/syscalls/ptrace/ptrace03.c | 6 +- testcases/kernel/syscalls/pwrite/pwrite01.c | 21 +++--- testcases/kernel/syscalls/pwrite/pwrite02.c | 2 +- testcases/kernel/syscalls/pwrite/pwrite03.c | 2 +- testcases/kernel/syscalls/read/read01.c | 2 +- testcases/kernel/syscalls/read/read04.c | 2 +- testcases/kernel/syscalls/readlink/readlink01.c | 2 +- testcases/kernel/syscalls/readlink/readlink02.c | 2 +- testcases/kernel/syscalls/readlink/readlink03.c | 2 +- testcases/kernel/syscalls/readlink/readlink04.c | 2 +- .../syscalls/remap_file_pages/remap_file_pages01.c | 7 +- testcases/kernel/syscalls/rename/rename02.c | 2 +- testcases/kernel/syscalls/rmdir/rmdir04.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction01.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction03.c | 2 +- .../sched_get_priority_max01.c | 8 +-- .../sched_get_priority_max02.c | 6 +- .../sched_get_priority_min01.c | 8 +-- .../sched_get_priority_min02.c | 6 +- .../syscalls/sched_getparam/sched_getparam01.c | 4 +- .../syscalls/sched_getparam/sched_getparam02.c | 2 +- .../sched_rr_get_interval01.c | 7 +- .../sched_rr_get_interval02.c | 4 +- .../sched_rr_get_interval03.c | 6 +- .../syscalls/sched_setparam/sched_setparam01.c | 7 +- .../syscalls/sched_setparam/sched_setparam02.c | 7 +- .../syscalls/sched_setparam/sched_setparam03.c | 4 +- .../syscalls/sched_setparam/sched_setparam05.c | 6 +- testcases/kernel/syscalls/sendfile/sendfile02.c | 13 ++-- testcases/kernel/syscalls/sendfile/sendfile06.c | 11 ++-- testcases/kernel/syscalls/sendmsg/sendmsg01.c | 2 +- .../syscalls/set_robust_list/set_robust_list01.c | 10 ++-- .../syscalls/set_tid_address/set_tid_address01.c | 2 +- .../syscalls/setdomainname/setdomainname01.c | 2 +- testcases/kernel/syscalls/setfsgid/setfsgid01.c | 2 +- testcases/kernel/syscalls/setfsgid/setfsgid02.c | 4 +- testcases/kernel/syscalls/setfsgid/setfsgid03.c | 4 +- testcases/kernel/syscalls/setfsuid/setfsuid01.c | 2 +- testcases/kernel/syscalls/setfsuid/setfsuid02.c | 4 +- testcases/kernel/syscalls/setfsuid/setfsuid03.c | 4 +- testcases/kernel/syscalls/setgid/setgid01.c | 2 +- testcases/kernel/syscalls/setgroups/setgroups01.c | 2 +- testcases/kernel/syscalls/setgroups/setgroups03.c | 2 +- testcases/kernel/syscalls/setgroups/setgroups04.c | 4 +- .../kernel/syscalls/sethostname/sethostname01.c | 2 +- testcases/kernel/syscalls/setpgid/setpgid01.c | 2 +- testcases/kernel/syscalls/setpgrp/setpgrp01.c | 2 +- testcases/kernel/syscalls/setregid/setregid01.c | 10 ++-- testcases/kernel/syscalls/setregid/setregid02.c | 2 +- testcases/kernel/syscalls/setregid/setregid04.c | 4 +- testcases/kernel/syscalls/setreuid/setreuid01.c | 10 ++-- testcases/kernel/syscalls/setreuid/setreuid02.c | 4 +- .../kernel/syscalls/setsockopt/setsockopt01.c | 2 +- testcases/kernel/syscalls/setuid/setuid01.c | 2 +- testcases/kernel/syscalls/setuid/setuid02.c | 2 +- testcases/kernel/syscalls/sgetmask/sgetmask01.c | 6 +- .../kernel/syscalls/sigaltstack/sigaltstack02.c | 2 +- testcases/kernel/syscalls/signal/signal04.c | 4 +- .../kernel/syscalls/sigpending/sigpending02.c | 2 +- .../kernel/syscalls/sigsuspend/sigsuspend01.c | 6 +- .../kernel/syscalls/socketcall/socketcall01.c | 9 +-- .../kernel/syscalls/socketcall/socketcall03.c | 8 +- .../kernel/syscalls/socketcall/socketcall04.c | 8 +- testcases/kernel/syscalls/sockioctl/sockioctl01.c | 2 +- testcases/kernel/syscalls/splice/splice01.c | 2 +- testcases/kernel/syscalls/stat/stat03.c | 2 +- testcases/kernel/syscalls/stat/stat05.c | 2 +- testcases/kernel/syscalls/stat/stat06.c | 2 +- testcases/kernel/syscalls/statfs/statfs01.c | 2 +- testcases/kernel/syscalls/statfs/statfs03.c | 2 +- testcases/kernel/syscalls/statvfs/statvfs01.c | 15 ++-- testcases/kernel/syscalls/stime/stime02.c | 2 +- testcases/kernel/syscalls/symlink/symlink01.c | 29 ++++---- testcases/kernel/syscalls/sync/sync01.c | 2 +- testcases/kernel/syscalls/tee/tee01.c | 2 +- testcases/kernel/syscalls/time/time01.c | 2 +- testcases/kernel/syscalls/time/time02.c | 9 ++- testcases/kernel/syscalls/times/times03.c | 7 +- testcases/kernel/syscalls/truncate/truncate01.c | 5 +- testcases/kernel/syscalls/truncate/truncate03.c | 2 +- testcases/kernel/syscalls/truncate/truncate04.c | 4 +- testcases/kernel/syscalls/ulimit/ulimit01.c | 18 ++--- testcases/kernel/syscalls/umask/umask01.c | 2 +- testcases/kernel/syscalls/umask/umask03.c | 2 +- testcases/kernel/syscalls/uname/uname01.c | 2 +- testcases/kernel/syscalls/unlink/unlink05.c | 2 +- testcases/kernel/syscalls/unlink/unlink06.c | 4 +- testcases/kernel/syscalls/unlink/unlink07.c | 2 +- testcases/kernel/syscalls/unlink/unlink08.c | 4 +- testcases/kernel/syscalls/utime/utime06.c | 2 +- testcases/kernel/syscalls/vmsplice/vmsplice01.c | 2 +- testcases/kernel/syscalls/wait4/wait401.c | 4 +- testcases/kernel/syscalls/write/write01.c | 2 +- testcases/kernel/syscalls/writev/writev06.c | 6 +- .../kernel/timers/clock_settime/clock_settime03.c | 2 +- testcases/network/lib6/asapi_04.c | 12 ++-- testcases/network/lib6/asapi_05.c | 3 +- testcases/network/lib6/getaddrinfo_01.c | 68 ++++++++++---------- testcases/network/lib6/in6_02.c | 18 +++--- 157 files changed, 408 insertions(+), 412 deletions(-) diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c index 50ecdf4..baff476 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c @@ -352,8 +352,8 @@ func_stat() * that memory so the attaches equal N_ATTACH + stat_time (1). */ if (!fail && buf.shm_nattch != N_ATTACH + stat_time) { - tst_resm(TFAIL, "# of attaches is incorrect - %d", - buf.shm_nattch); + tst_resm(TFAIL, "# of attaches is incorrect - %lu", + (unsigned long)buf.shm_nattch); fail = 1; } diff --git a/testcases/kernel/syscalls/fcntl/fcntl02.c b/testcases/kernel/syscalls/fcntl/fcntl02.c index 83566cc..2ca1138 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl02.c +++ b/testcases/kernel/syscalls/fcntl/fcntl02.c @@ -181,9 +181,9 @@ int main(int ac, char **av) fname, TEST_RETURN); } if (close(TEST_RETURN) == -1) { - tst_resm(TWARN, - "close(%s) Failed, errno=%d : %s", - fname, errno, strerror(errno)); + tst_resm(TWARN | TERRNO, + "close(%s) Failed", + fname); } } diff --git a/testcases/kernel/syscalls/fcntl/fcntl03.c b/testcases/kernel/syscalls/fcntl/fcntl03.c index dd99bf4..d99fe52 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl03.c +++ b/testcases/kernel/syscalls/fcntl/fcntl03.c @@ -166,9 +166,9 @@ int main(int ac, char **av) /* check return code */ if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); - tst_resm(TFAIL, - "fcntl(%s, F_GETFD, 0) Failed, errno=%d : %s", - fname, TEST_ERRNO, strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, + "fcntl(%s, F_GETFD, 0) Failed", + fname); } else { /*************************************************************** diff --git a/testcases/kernel/syscalls/fcntl/fcntl04.c b/testcases/kernel/syscalls/fcntl/fcntl04.c index 65c8ed8..6db443c 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl04.c +++ b/testcases/kernel/syscalls/fcntl/fcntl04.c @@ -166,9 +166,9 @@ int main(int ac, char **av) /* check return code */ if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); - tst_resm(TFAIL, - "fcntl(%s, F_GETFL, 0) Failed, errno=%d : %s", - fname, TEST_ERRNO, strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, + "fcntl(%s, F_GETFL, 0) Failed", + fname); } else { /*************************************************************** diff --git a/testcases/kernel/syscalls/fcntl/fcntl05.c b/testcases/kernel/syscalls/fcntl/fcntl05.c index d7773f0..7e6dfa8 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl05.c +++ b/testcases/kernel/syscalls/fcntl/fcntl05.c @@ -168,9 +168,9 @@ int main(int ac, char **av) /* check return code */ if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); - tst_resm(TFAIL, - "fcntl(%s, F_GETLK, &flocks) Failed, errno=%d : %s", - fname, TEST_ERRNO, strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, + "fcntl(%s, F_GETLK, &flocks) Failed", + fname); } else { /*************************************************************** diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c index d9d1c27..503fac7 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl11.c +++ b/testcases/kernel/syscalls/fcntl/fcntl11.c @@ -43,6 +43,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> +#include <inttypes.h> #include "test.h" #include "usctest.h" @@ -194,13 +195,13 @@ compare_lock(struct flock *fl, short type, short whence, int start, int len, if (fl->l_start != start) { tst_resm(TFAIL, "region starts in wrong place, should be " - "%d is %d", start, fl->l_start); + "%d is %"PRId64, start, (int64_t)fl->l_start); fail = 1; } if (fl->l_len != len) { - tst_resm(TFAIL, "region length is wrong, should be %d is %d", - len, fl->l_len); + tst_resm(TFAIL, "region length is wrong, should be %d is %"PRId64, + len, (int64_t)fl->l_len); fail = 1; } diff --git a/testcases/kernel/syscalls/fcntl/fcntl14.c b/testcases/kernel/syscalls/fcntl/fcntl14.c index 7bdf9df..a076e35 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl14.c +++ b/testcases/kernel/syscalls/fcntl/fcntl14.c @@ -46,6 +46,7 @@ #include <signal.h> #include <errno.h> #include <sys/wait.h> +#include <inttypes.h> #include <usctest.h> #include <test.h> @@ -667,17 +668,17 @@ void dochild() if (flock.l_start != thiscase->c_start) { tst_resm(TFAIL, - "Test case %d, GETLK: start = %d, " - "should have remained %d", test + 1, - flock.l_start, thiscase->c_start); + "Test case %d, GETLK: start = %"PRId64", " + "should have remained %"PRId64, test + 1, + (int64_t)flock.l_start, (int64_t)thiscase->c_start); fail = 1; } if (flock.l_len != thiscase->c_len) { tst_resm(TFAIL, - "Test case %d, GETLK: len = %d, " - "should have remained %d", test + 1, - flock.l_len, thiscase->c_len); + "Test case %d, GETLK: len = %"PRId64", " + "should have remained %"PRId64, test + 1, + (int64_t)flock.l_len, (int64_t)thiscase->c_len); fail = 1; } diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c index 06a32ce..c170cac 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl17.c +++ b/testcases/kernel/syscalls/fcntl/fcntl17.c @@ -51,6 +51,8 @@ #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> +#include <inttypes.h> + #include "test.h" #include "usctest.h" @@ -301,13 +303,13 @@ int do_test(struct flock *lock, pid_t pid) if (fl.l_start != lock->l_start) { tst_resm(TFAIL, "region starts in wrong place, " - "should be %d is %d", lock->l_start, fl.l_start); + "should be %"PRId64" is %"PRId64, (int64_t)lock->l_start, (int64_t)fl.l_start); return 1; } if (fl.l_len != lock->l_len) { - tst_resm(TFAIL, "region length is wrong, should be %d is %d", - lock->l_len, fl.l_len); + tst_resm(TFAIL, "region length is wrong, should be %"PRId64" is %"PRId64, + (int64_t)lock->l_len, (int64_t)fl.l_len); return 1; } diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c index d89d990..d37a81d 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl19.c +++ b/testcases/kernel/syscalls/fcntl/fcntl19.c @@ -46,6 +46,7 @@ #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> +#include <inttypes.h> #include "test.h" #include "usctest.h" @@ -201,13 +202,13 @@ compare_lock(struct flock *fl, short type, short whence, int start, int len, if (fl->l_start != start) { tst_resm(TFAIL, "region starts in wrong place, should be" - "%d is %d", start, fl->l_start); + "%d is %"PRId64, start, (int64_t)fl->l_start); fail = 1; } if (fl->l_len != len) { - tst_resm(TFAIL, "region length is wrong, should be %d is %d", - len, fl->l_len); + tst_resm(TFAIL, "region length is wrong, should be %d is %"PRId64, + len, (int64_t)fl->l_len); fail = 1; } diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c index 60730bb..feb2a49 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl20.c +++ b/testcases/kernel/syscalls/fcntl/fcntl20.c @@ -43,6 +43,7 @@ #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> +#include <inttypes.h> #include "test.h" #include "usctest.h" @@ -196,13 +197,13 @@ compare_lock(struct flock *fl, short type, short whence, int start, int len, if (fl->l_start != start) { tst_resm(TFAIL, "region starts in wrong place, should be" - "%d is %d", start, fl->l_start); + "%d is %"PRId64, start, (int64_t)fl->l_start); fail = 1; } if (fl->l_len != len) { - tst_resm(TFAIL, "region length is wrong, should be %d is %d", - len, fl->l_len); + tst_resm(TFAIL, "region length is wrong, should be %d is %"PRId64, + len, (int64_t)fl->l_len); fail = 1; } diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c index f31e37b..f538068 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl21.c +++ b/testcases/kernel/syscalls/fcntl/fcntl21.c @@ -43,6 +43,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> +#include <inttypes.h> #include "test.h" #include "usctest.h" @@ -197,13 +198,13 @@ compare_lock(struct flock *fl, short type, short whence, int start, int len, if (fl->l_start != start) { tst_resm(TFAIL, "region starts in wrong place, should be" - "%d is %d", start, fl->l_start); + "%d is %"PRId64, start, (int64_t)fl->l_start); fail = 1; } if (fl->l_len != len) { - tst_resm(TFAIL, "region length is wrong, should be %d is %d", - len, fl->l_len); + tst_resm(TFAIL, "region length is wrong, should be %d is %"PRId64, + len, (int64_t)fl->l_len); fail = 1; } diff --git a/testcases/kernel/syscalls/fcntl/fcntl22.c b/testcases/kernel/syscalls/fcntl/fcntl22.c index 1f1958a..1e6df2d 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl22.c +++ b/testcases/kernel/syscalls/fcntl/fcntl22.c @@ -199,8 +199,8 @@ void setup() /* lock file */ if (fcntl(file, F_SETLK, &fl) < 0) { - tst_resm(TFAIL, "fcntl on file %s failed, errno =%d", - file, errno); + tst_resm(TFAIL|TERRNO, "fcntl on file %d failed", + file); } } diff --git a/testcases/kernel/syscalls/fork/fork09.c b/testcases/kernel/syscalls/fork/fork09.c index 828ca8c..1923002 100644 --- a/testcases/kernel/syscalls/fork/fork09.c +++ b/testcases/kernel/syscalls/fork/fork09.c @@ -100,7 +100,7 @@ int main(int ac, char **av) mypid = getpid(); - tst_resm(TINFO, "OPEN_MAX is %d", OPEN_MAX); + tst_resm(TINFO, "OPEN_MAX is %ld", OPEN_MAX); /* establish first free file */ sprintf(filname, "fork09.%d", mypid); diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate01.c b/testcases/kernel/syscalls/ftruncate/ftruncate01.c index 1f911a6..1be0202 100644 --- a/testcases/kernel/syscalls/ftruncate/ftruncate01.c +++ b/testcases/kernel/syscalls/ftruncate/ftruncate01.c @@ -147,7 +147,7 @@ int main(int ac, char **av) */ if (file_length != TRUNC_LEN) { tst_resm(TFAIL, "%s: Incorrect file size %"PRId64", " - "Expected %d", TESTFILE, file_length, + "Expected %d", TESTFILE, (int64_t)file_length, TRUNC_LEN); } else { tst_resm(TPASS, "Functionality of ftruncate() " diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate04.c b/testcases/kernel/syscalls/ftruncate/ftruncate04.c index 4785dd5..324a654 100644 --- a/testcases/kernel/syscalls/ftruncate/ftruncate04.c +++ b/testcases/kernel/syscalls/ftruncate/ftruncate04.c @@ -188,7 +188,7 @@ void doparent() if (sb.st_size != recstart + (RECLEN / 2)) { tst_resm(TFAIL, "unexpected ftruncate failure case 4"); tst_resm(TFAIL, "expected size of %d, got size of %"PRId64, - recstart + (RECLEN / 2), sb.st_size); + recstart + (RECLEN / 2), (int64_t)sb.st_size); local_flag = FAILED; cleanup(); } @@ -212,7 +212,7 @@ void doparent() if (sb.st_size != RECLEN) { tst_resm(TFAIL, "unexpected ftruncate failure case 5"); tst_resm(TFAIL, "expected size of %d, got size of %"PRId64, - RECLEN, sb.st_size); + RECLEN, (int64_t)sb.st_size); local_flag = FAILED; cleanup(); } @@ -231,7 +231,7 @@ void doparent() if (sb.st_size != (2 * len)) { tst_resm(TFAIL, "unexpected ftruncate failure case 6"); tst_resm(TFAIL, "expected size of %d, got size of %"PRId64, - (2 * len), sb.st_size); + (2 * len), (int64_t)sb.st_size); local_flag = FAILED; cleanup(); } diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c index 82b2d2b..a2533eb 100644 --- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c +++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c @@ -40,6 +40,7 @@ * */ +#include <stdint.h> #include <stdio.h> #include <sys/time.h> #include <signal.h> @@ -108,10 +109,10 @@ int main(int ac, char **av) if (tv2.tv_sec < tv1.tv_sec || (tv2.tv_sec == tv1.tv_sec && tv2.tv_usec < tv1.tv_usec)) { - tst_resm(TFAIL, - "Time is going backwards: old %d.%d vs new %d.%d!", - tv1.tv_sec, tv1.tv_usec, tv2.tv_sec, - tv2.tv_usec); + tst_resm(TFAIL, + "Time is going backwards: old %jd.%jd vs new %jd.%jd!", + (intmax_t)tv1.tv_sec, (intmax_t)tv1.tv_usec, (intmax_t)tv2.tv_sec, + (intmax_t)tv2.tv_usec); cleanup(); return 1; } diff --git a/testcases/kernel/syscalls/inotify/inotify02.c b/testcases/kernel/syscalls/inotify/inotify02.c index a22204c..5e252f7 100644 --- a/testcases/kernel/syscalls/inotify/inotify02.c +++ b/testcases/kernel/syscalls/inotify/inotify02.c @@ -179,9 +179,9 @@ int main(int ac, char **av) Tst_count++; if (getcwd(fname1, BUF_SIZE) == NULL) { - tst_brkm(TBROK, cleanup, - "getcwd(%x, %d) Failed, errno=%d : %s", fname1, - BUF_SIZE, errno, strerror(errno)); + tst_brkm(TBROK | TERRNO, cleanup, + "getcwd(%p, %d) Failed", fname1, + BUF_SIZE); } snprintf(fname2, BUF_SIZE, "%s.rename1", fname1); diff --git a/testcases/kernel/syscalls/ioperm/ioperm01.c b/testcases/kernel/syscalls/ioperm/ioperm01.c index 8d1b44c..81de993 100644 --- a/testcases/kernel/syscalls/ioperm/ioperm01.c +++ b/testcases/kernel/syscalls/ioperm/ioperm01.c @@ -74,7 +74,7 @@ char *TCID = "ioperm01"; /* Test program identifier. */ #include "test.h" #include "usctest.h" -int io_addr; /*kernel version dependant io start address */ +unsigned long io_addr; /*kernel version dependant io start address */ #define NUM_BYTES 3 /* number of bytes from start address */ #define TURN_ON 1 #define TURN_OFF 0 @@ -116,11 +116,11 @@ int main(int ac, char **av) if (TEST_RETURN == -1) { tst_resm(TFAIL, "ioperm() failed for port address " - "%ld, errno=%d : %s", io_addr, + "%lu, errno=%d : %s", io_addr, TEST_ERRNO, strerror(TEST_ERRNO)); } else { tst_resm(TPASS, "ioperm() passed for port " - "address %ld, returned %d", + "address %lu, returned %lu", io_addr, TEST_RETURN); } } /* End for TEST_LOOPING */ diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl07.c b/testcases/kernel/syscalls/ipc/semctl/semctl07.c index c83862a..60f5be1 100644 --- a/testcases/kernel/syscalls/ipc/semctl/semctl07.c +++ b/testcases/kernel/syscalls/ipc/semctl/semctl07.c @@ -97,7 +97,7 @@ char *argv[]; */ if (arg.buf->sem_nsems != nsems) { - tst_resm(TFAIL, "error: unexpected number of sems %d", + tst_resm(TFAIL, "error: unexpected number of sems %lu", arg.buf->sem_nsems); tst_exit(); } diff --git a/testcases/kernel/syscalls/keyctl/keyctl01.c b/testcases/kernel/syscalls/keyctl/keyctl01.c index 5f5d2b6..af02918 100644 --- a/testcases/kernel/syscalls/keyctl/keyctl01.c +++ b/testcases/kernel/syscalls/keyctl/keyctl01.c @@ -145,10 +145,10 @@ int main(int ac, char **av) { if(TEST_ERRNO == ENOKEY) //Check for correct error no. //if no matching key was found or an invalid key was specified. { - tst_resm(TPASS,"KEYCTL_REVOKE got expected errno:%ld",TEST_ERRNO); + tst_resm(TPASS|TTERRNO,"KEYCTL_REVOKE got expected errno"); cleanup(); }else{ - tst_resm(TFAIL,"KEYCTL_REVOKE got unexpected errno:%ld", TEST_ERRNO); + tst_resm(TFAIL|TTERRNO,"KEYCTL_REVOKE got unexpected errno"); cleanup(); tst_exit(); } diff --git a/testcases/kernel/syscalls/llseek/llseek01.c b/testcases/kernel/syscalls/llseek/llseek01.c index cc6b68c..ef8363a 100644 --- a/testcases/kernel/syscalls/llseek/llseek01.c +++ b/testcases/kernel/syscalls/llseek/llseek01.c @@ -80,6 +80,7 @@ #include <sys/resource.h> #include <sys/stat.h> #include <sys/types.h> +#include <inttypes.h> #include "test.h" #include "usctest.h" @@ -141,9 +142,9 @@ int main(int ac, char **av) * is equal to the specified offset value. */ if (TEST_RETURN != (loff_t) (80 * BUFSIZ)) { - tst_resm(TFAIL, "llseek() returned incorrect " - "value %d, expected %d", - offset, BUFSIZ); + tst_resm(TFAIL, "llseek() returned incorrect " + "value %"PRId64", expected %d", + (int64_t)offset, BUFSIZ); continue; } diff --git a/testcases/kernel/syscalls/lseek/lseek01.c b/testcases/kernel/syscalls/lseek/lseek01.c index b9880ec..7265236 100644 --- a/testcases/kernel/syscalls/lseek/lseek01.c +++ b/testcases/kernel/syscalls/lseek/lseek01.c @@ -177,7 +177,7 @@ int main(int ac, char **av) if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); tst_resm(TFAIL, - "lseek(%s, %ld, 0) Failed, errno=%d : %s", + "lseek(%s, %d, 0) Failed, errno=%d : %s", Fname, offset, TEST_ERRNO, strerror(TEST_ERRNO)); } else { @@ -188,7 +188,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "lseek(%s, %ld, %d) returned %d", + "lseek(%s, %d, %d) returned %ld", Fname, offset, Whence[ind], TEST_RETURN); } else diff --git a/testcases/kernel/syscalls/lseek/lseek07.c b/testcases/kernel/syscalls/lseek/lseek07.c index b43eb5f..998b031 100644 --- a/testcases/kernel/syscalls/lseek/lseek07.c +++ b/testcases/kernel/syscalls/lseek/lseek07.c @@ -75,6 +75,7 @@ #include <string.h> #include <sys/stat.h> #include <signal.h> +#include <inttypes.h> #include "test.h" #include "usctest.h" @@ -141,8 +142,8 @@ int main(int ac, char **av) */ if (TEST_RETURN != offset) { tst_resm(TFAIL, "lseek() returned " - "incorrect value %d, expected " - "%d", TEST_RETURN, offset); + "incorrect value %ld, expected " + "%"PRId64, TEST_RETURN, (int64_t)offset); continue; } /* diff --git a/testcases/kernel/syscalls/mkdir/mkdir08.c b/testcases/kernel/syscalls/mkdir/mkdir08.c index e4eb6cd..b6536bc 100644 --- a/testcases/kernel/syscalls/mkdir/mkdir08.c +++ b/testcases/kernel/syscalls/mkdir/mkdir08.c @@ -174,7 +174,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "mkdir(%s) returned %d", fname, + tst_resm(TPASS, "mkdir(%s) returned %ld", fname, TEST_RETURN); } if (rmdir(fname) == -1) { diff --git a/testcases/kernel/syscalls/mknod/mknod01.c b/testcases/kernel/syscalls/mknod/mknod01.c index 30a5149..33017d1 100644 --- a/testcases/kernel/syscalls/mknod/mknod01.c +++ b/testcases/kernel/syscalls/mknod/mknod01.c @@ -200,7 +200,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "mknod(%s, %#o, 0) returned %d", + "mknod(%s, %#o, 0) returned %ld", Path, tcases[i], TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/mknod/mknod06.c b/testcases/kernel/syscalls/mknod/mknod06.c index e267fd5..c6165da 100644 --- a/testcases/kernel/syscalls/mknod/mknod06.c +++ b/testcases/kernel/syscalls/mknod/mknod06.c @@ -181,7 +181,7 @@ int main(int ac, char **av) /* Check return code from mknod(2) */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "mknod() returned %d, expected " + tst_resm(TFAIL, "mknod() returned %ld, expected " "-1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); continue; diff --git a/testcases/kernel/syscalls/mknod/mknod07.c b/testcases/kernel/syscalls/mknod/mknod07.c index 724b6ac..29298b7 100644 --- a/testcases/kernel/syscalls/mknod/mknod07.c +++ b/testcases/kernel/syscalls/mknod/mknod07.c @@ -158,7 +158,7 @@ int main(int ac, char **av) /* Check return code from mknod(2) */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "mknod() returned %d, expected " + tst_resm(TFAIL, "mknod() returned %ld, expected " "-1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); continue; diff --git a/testcases/kernel/syscalls/mknod/mknod09.c b/testcases/kernel/syscalls/mknod/mknod09.c index aefde5b..1b58dc0 100644 --- a/testcases/kernel/syscalls/mknod/mknod09.c +++ b/testcases/kernel/syscalls/mknod/mknod09.c @@ -117,7 +117,7 @@ int main(int ac, char **av) /* Check return code from mknod(2) */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "mknod() returned %d," + tst_resm(TFAIL, "mknod() returned %ld," "expected -1, errno=%d", TEST_RETURN, exp_enos[0]); } else { diff --git a/testcases/kernel/syscalls/mlockall/mlockall01.c b/testcases/kernel/syscalls/mlockall/mlockall01.c index f797bd6..98fda9d 100644 --- a/testcases/kernel/syscalls/mlockall/mlockall01.c +++ b/testcases/kernel/syscalls/mlockall/mlockall01.c @@ -122,10 +122,9 @@ int main(int ac, char **av) if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); - tst_resm(TFAIL, "mlockall(%s) Failed with " - "return=%d, errno=%d : %s", - TC[i].fdesc, TEST_RETURN, TEST_ERRNO, - strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, "mlockall(%s) Failed with " + "return=%ld", + TC[i].fdesc, TEST_RETURN); } else { tst_resm(TPASS, "mlockall test passed for %s", TC[i].fdesc); diff --git a/testcases/kernel/syscalls/mlockall/mlockall02.c b/testcases/kernel/syscalls/mlockall/mlockall02.c index cc7184d..e0d48f0 100644 --- a/testcases/kernel/syscalls/mlockall/mlockall02.c +++ b/testcases/kernel/syscalls/mlockall/mlockall02.c @@ -156,7 +156,7 @@ int main(int ac, char **av) else tst_brkm(TFAIL, cleanup, "mlock() Failed, expected " - "return value=-1, got %d", + "return value=-1, got %ld", TEST_RETURN); } cleanup_test(i); diff --git a/testcases/kernel/syscalls/mlockall/mlockall03.c b/testcases/kernel/syscalls/mlockall/mlockall03.c index 4490ea4..69e717f 100644 --- a/testcases/kernel/syscalls/mlockall/mlockall03.c +++ b/testcases/kernel/syscalls/mlockall/mlockall03.c @@ -176,7 +176,7 @@ int main(int ac, char **av) } else { tst_brkm(TFAIL, cleanup, "mlockall() Failed, expected " - "return value=-1, got %d", + "return value=-1, got %ld", TEST_RETURN); } cleanup_test(i); diff --git a/testcases/kernel/syscalls/move_pages/move_pages_support.c b/testcases/kernel/syscalls/move_pages/move_pages_support.c index 05492d3..259049c 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages_support.c +++ b/testcases/kernel/syscalls/move_pages/move_pages_support.c @@ -189,7 +189,7 @@ verify_pages_on_nodes(void **pages, int *status, unsigned int num, int *nodes) for (i = 0; i < num; i++) { if (status[i] != nodes[i]) { tst_resm(TFAIL, "page %d on node %d, " - "expected on node %p", i, status[i], nodes[i]); + "expected on node %d", i, status[i], nodes[i]); return; } diff --git a/testcases/kernel/syscalls/msync/msync03.c b/testcases/kernel/syscalls/msync/msync03.c index 1583c4f..c9916e0 100644 --- a/testcases/kernel/syscalls/msync/msync03.c +++ b/testcases/kernel/syscalls/msync/msync03.c @@ -113,7 +113,7 @@ int main(int ac, char **av) /* Check for the return value of msync() */ if (TEST_RETURN != -1) { tst_resm(TFAIL, "msync() returns unexpected " - "value %d, expected:-1", TEST_RETURN); + "value %ld, expected:-1", TEST_RETURN); continue; } diff --git a/testcases/kernel/syscalls/msync/msync04.c b/testcases/kernel/syscalls/msync/msync04.c index 957c6e1..d624370 100644 --- a/testcases/kernel/syscalls/msync/msync04.c +++ b/testcases/kernel/syscalls/msync/msync04.c @@ -119,7 +119,7 @@ int main(int ac, char **av) /* Check for the return value of msync() */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "msync() returns unexpected value %d, " + tst_resm(TFAIL, "msync() returns unexpected value %ld, " "expected:-1", TEST_RETURN); continue; } diff --git a/testcases/kernel/syscalls/msync/msync05.c b/testcases/kernel/syscalls/msync/msync05.c index 1321ab8..f6a2056 100644 --- a/testcases/kernel/syscalls/msync/msync05.c +++ b/testcases/kernel/syscalls/msync/msync05.c @@ -112,7 +112,7 @@ int main(int ac, char **av) /* Check for the return value of msync() */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "msync() returns unexpected value %d, " + tst_resm(TFAIL, "msync() returns unexpected value %ld, " "expected:-1", TEST_RETURN); continue; } diff --git a/testcases/kernel/syscalls/munlock/munlock01.c b/testcases/kernel/syscalls/munlock/munlock01.c index 20cb013..b4b8ed5 100644 --- a/testcases/kernel/syscalls/munlock/munlock01.c +++ b/testcases/kernel/syscalls/munlock/munlock01.c @@ -122,11 +122,10 @@ int main(int ac, char **av) /* check return code */ if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); - tst_resm(TFAIL, "mlock(%p, %d) Failed with " - "return=%d, errno=%d : %s", + tst_resm(TFAIL|TTERRNO, "mlock(%p, %d) Failed with " + "return=%ld", TC[i].addr, TC[i].len, - TEST_RETURN, TEST_ERRNO, - strerror(TEST_ERRNO)); + TEST_RETURN); } else { tst_resm(TPASS, "test %d passed length = %d", i, TC[i].len); @@ -150,9 +149,8 @@ void setup1(int i) /* check return code */ if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); - tst_brkm(TFAIL, cleanup, "mlock(%p, %d) Failed with return=%d," - "errno=%d : %s", TC[i].addr, TC[i].len, TEST_RETURN, - TEST_ERRNO, strerror(TEST_ERRNO)); + tst_brkm(TFAIL|TTERRNO, cleanup, "mlock(%p, %d) Failed with return=%ld", + TC[i].addr, TC[i].len, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/munlock/munlock02.c b/testcases/kernel/syscalls/munlock/munlock02.c index 040ae05..b9c122c 100644 --- a/testcases/kernel/syscalls/munlock/munlock02.c +++ b/testcases/kernel/syscalls/munlock/munlock02.c @@ -142,7 +142,7 @@ int main(int ac, char **av) } else { tst_brkm(TFAIL, cleanup, "munlock() Failed, expected " - "return value=-1, got %d", + "return value=-1, got %ld", TEST_RETURN); } } @@ -177,9 +177,8 @@ void setup() /* check return code */ if (TEST_RETURN == -1) { - tst_brkm(TFAIL, cleanup, "mlock(%p, %d) Failed with return=%d," - "errno=%d : %s", address, TC[0].len, TEST_RETURN, - TEST_ERRNO, strerror(TEST_ERRNO)); + tst_brkm(TFAIL|TTERRNO, cleanup, "mlock(%p, %d) Failed with return=%ld", + address, TC[0].len, TEST_RETURN); } TC[0].addr = address; /* diff --git a/testcases/kernel/syscalls/munlockall/munlockall01.c b/testcases/kernel/syscalls/munlockall/munlockall01.c index ef7d481..36bb558 100644 --- a/testcases/kernel/syscalls/munlockall/munlockall01.c +++ b/testcases/kernel/syscalls/munlockall/munlockall01.c @@ -99,12 +99,12 @@ int main(int ac, char **av) /* check return code */ if (TEST_RETURN == -1) { - tst_resm(TFAIL, "munlockall() Failed with" - " return=%d, errno=%d : %s", - TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, "munlockall() Failed with" + " return=%ld", + TEST_RETURN); } else { tst_resm(TPASS, "munlockall() passed with" - " return=%d ", TEST_RETURN); + " return=%ld ", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/munmap/munmap03.c b/testcases/kernel/syscalls/munmap/munmap03.c index 5eb5ad1..fcdfbed 100644 --- a/testcases/kernel/syscalls/munmap/munmap03.c +++ b/testcases/kernel/syscalls/munmap/munmap03.c @@ -124,7 +124,7 @@ int main(int ac, char **av) /* Check for the return value of munmap() */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "munmap() returned %d, expected -1", + tst_resm(TFAIL, "munmap() returned %ld, expected -1", TEST_RETURN); continue; } diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep01.c b/testcases/kernel/syscalls/nanosleep/nanosleep01.c index 783fc43..60c1c54 100644 --- a/testcases/kernel/syscalls/nanosleep/nanosleep01.c +++ b/testcases/kernel/syscalls/nanosleep/nanosleep01.c @@ -69,6 +69,7 @@ #include <time.h> #include <sys/time.h> #include <sys/wait.h> +#include <stdint.h> #include "test.h" #include "usctest.h" @@ -158,8 +159,8 @@ int main(int ac, char **av) if (got_ms < want_ms) { retval = 1; tst_resm(TFAIL, "Child execution not " - "suspended for %d seconds. (Wanted %ld ms, got %ld ms)", - timereq.tv_sec, want_ms, + "suspended for %jd seconds. (Wanted %ld ms, got %ld ms)", + (intmax_t)timereq.tv_sec, want_ms, got_ms); } else { tst_resm(TPASS, "nanosleep " diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep02.c b/testcases/kernel/syscalls/nanosleep/nanosleep02.c index 8b7dbe9..5ff6a8a 100644 --- a/testcases/kernel/syscalls/nanosleep/nanosleep02.c +++ b/testcases/kernel/syscalls/nanosleep/nanosleep02.c @@ -74,6 +74,7 @@ #include <time.h> #include <wait.h> #include <sys/time.h> +#include <stdint.h> #include "test.h" #include "usctest.h" @@ -266,8 +267,8 @@ void do_child() "due to the limitation of the way it calculates the"); tst_resm(TWARN, "system call execution time."); tst_resm(TFAIL, "Child execution not " - "suspended for %d seconds %lu nanoseconds", - timereq.tv_sec, timereq.tv_nsec); + "suspended for %jd seconds %lu nanoseconds", + (intmax_t)timereq.tv_sec, timereq.tv_nsec); exit(1); } } else { diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep03.c b/testcases/kernel/syscalls/nanosleep/nanosleep03.c index 50e5ffd..12ea809 100644 --- a/testcases/kernel/syscalls/nanosleep/nanosleep03.c +++ b/testcases/kernel/syscalls/nanosleep/nanosleep03.c @@ -185,7 +185,7 @@ void do_child() exit(1); } } else { - tst_resm(TFAIL, "nanosleep() returns %d, " + tst_resm(TFAIL, "nanosleep() returns %ld, " "expected -1, errno:%d", TEST_RETURN, EINTR); exit(1); } diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep04.c b/testcases/kernel/syscalls/nanosleep/nanosleep04.c index 9b9fdd4..4fb3de2 100644 --- a/testcases/kernel/syscalls/nanosleep/nanosleep04.c +++ b/testcases/kernel/syscalls/nanosleep/nanosleep04.c @@ -135,7 +135,7 @@ int main(int ac, char **av) exit(1); } } else { - tst_resm(TFAIL, "nanosleep() returns %d, " + tst_resm(TFAIL, "nanosleep() returns %ld, " "expected -1, errno:%d", TEST_RETURN, EINVAL); exit(1); diff --git a/testcases/kernel/syscalls/newuname/newuname01.c b/testcases/kernel/syscalls/newuname/newuname01.c index d0a6c12..fbc6260 100644 --- a/testcases/kernel/syscalls/newuname/newuname01.c +++ b/testcases/kernel/syscalls/newuname/newuname01.c @@ -133,7 +133,7 @@ int main(int ac, char **av) { cleanup(); tst_exit(); }else { - tst_resm(TPASS, "newuname call succeed: return value = %d ",TEST_RETURN); + tst_resm(TPASS, "newuname call succeed: return value = %ld ",TEST_RETURN); TEST(strcmp(name.sysname,"Linux")); //Linux ? if(TEST_RETURN == 0){ tst_resm(TINFO,"This system is %s",name.sysname); diff --git a/testcases/kernel/syscalls/nice/nice04.c b/testcases/kernel/syscalls/nice/nice04.c index 2dca867..d2a4887 100644 --- a/testcases/kernel/syscalls/nice/nice04.c +++ b/testcases/kernel/syscalls/nice/nice04.c @@ -129,12 +129,12 @@ int main(int ac, char **av) /* check return code from nice(2) */ if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); - tst_resm(TPASS, "nice(2) returned %d for %s", + tst_resm(TPASS, "nice(2) returned %ld for %s", TEST_RETURN, test_desc); } else { - tst_resm(TFAIL, - "nice() returned %d for %s, errno:%d", - TEST_RETURN, test_desc, errno); + tst_resm(TFAIL|TTERRNO, + "nice() returned %ld for %s", + TEST_RETURN, test_desc); } } /* End of TEST CASE LOOPING. */ } /* End for TEST_LOOPING */ diff --git a/testcases/kernel/syscalls/nice/nice05.c b/testcases/kernel/syscalls/nice/nice05.c index 340205f..72ec4c9 100644 --- a/testcases/kernel/syscalls/nice/nice05.c +++ b/testcases/kernel/syscalls/nice/nice05.c @@ -170,7 +170,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "nice(%d) returned %d", val, + tst_resm(TPASS, "nice(%d) returned %ld", val, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/pathconf/pathconf01.c b/testcases/kernel/syscalls/pathconf/pathconf01.c index 7825e16..21a580e 100644 --- a/testcases/kernel/syscalls/pathconf/pathconf01.c +++ b/testcases/kernel/syscalls/pathconf/pathconf01.c @@ -209,7 +209,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "pathconf(%s, %s) returned %d", + "pathconf(%s, %s) returned %ld", path, args[i].define_tag, TEST_RETURN); } diff --git a/testcases/kernel/syscalls/pipe/pipe03.c b/testcases/kernel/syscalls/pipe/pipe03.c index c36bc41..6a42519 100644 --- a/testcases/kernel/syscalls/pipe/pipe03.c +++ b/testcases/kernel/syscalls/pipe/pipe03.c @@ -98,9 +98,9 @@ int main(int ac, char **av) tst_resm(TPASS, "expected failure writing to " "read end of pipe"); else - tst_resm(TFAIL, "success when writing to read " - "end of pipe ret=%d, errno=%d", - TEST_RETURN, TEST_ERRNO); + tst_resm(TFAIL|TTERRNO, "success when writing to read " + "end of pipe ret=%ld", + TEST_RETURN); TEST(safe_read(fildes[1], rbuf, 1)); if (TEST_RETURN == -1 && TEST_ERRNO == EBADF) @@ -108,7 +108,7 @@ int main(int ac, char **av) "write end of pipe"); else tst_resm(TFAIL, "success when reading from " - "write end of pipe ret=%d, " + "write end of pipe ret=%ld, " "errno=%d", TEST_RETURN, TEST_ERRNO); } cleanup(); diff --git a/testcases/kernel/syscalls/prctl/prctl01.c b/testcases/kernel/syscalls/prctl/prctl01.c index 355ed99..9892bb9 100644 --- a/testcases/kernel/syscalls/prctl/prctl01.c +++ b/testcases/kernel/syscalls/prctl/prctl01.c @@ -133,10 +133,8 @@ int main(int ac, char **av) if (TEST_RETURN == 0) { exit(0); } else { - tst_resm(TWARN, "prctl() returned %d" - " errno = %d : %s", - TEST_RETURN, TEST_ERRNO, - strerror(TEST_ERRNO)); + tst_resm(TWARN|TTERRNO, "prctl() returned %ld", + TEST_RETURN); exit(1); } diff --git a/testcases/kernel/syscalls/prctl/prctl02.c b/testcases/kernel/syscalls/prctl/prctl02.c index 82bff24..cda5dad 100644 --- a/testcases/kernel/syscalls/prctl/prctl02.c +++ b/testcases/kernel/syscalls/prctl/prctl02.c @@ -147,10 +147,8 @@ int main(int ac, char **av) exp_errno)) { exit(TEST_ERRNO); } else { - tst_resm(TWARN, "prctl() returned %d" - " errno = %d : %s", - TEST_RETURN, TEST_ERRNO, - strerror(TEST_ERRNO)); + tst_resm(TWARN|TTERRNO, "prctl() returned %ld", + TEST_RETURN); exit(TEST_ERRNO); } diff --git a/testcases/kernel/syscalls/pread/pread01.c b/testcases/kernel/syscalls/pread/pread01.c index ea95ac3..58055d1 100644 --- a/testcases/kernel/syscalls/pread/pread01.c +++ b/testcases/kernel/syscalls/pread/pread01.c @@ -73,6 +73,7 @@ #include <errno.h> #include <unistd.h> #include <fcntl.h> +#include <inttypes.h> #include "test.h" #include "usctest.h" @@ -306,9 +307,9 @@ void l_seek(int fdesc, off_t offset, int whence, off_t checkoff) off_t offloc; /* offset ret. from lseek() */ if ((offloc = lseek(fdesc, offset, whence)) != checkoff) { - tst_resm(TWARN, "return = %d, expected %d", offloc, checkoff); - tst_brkm(TBROK, cleanup, "lseek() on %s failed, error=%d : %s", - TEMPFILE, errno, strerror(errno)); + tst_resm(TWARN, "return = %"PRId64", expected %"PRId64, (int64_t)offloc, (int64_t)checkoff); + tst_brkm(TBROK|TERRNO, cleanup, "lseek() on %s failed", + TEMPFILE); } } diff --git a/testcases/kernel/syscalls/pread/pread02.c b/testcases/kernel/syscalls/pread/pread02.c index e8643c7..44f74c2 100644 --- a/testcases/kernel/syscalls/pread/pread02.c +++ b/testcases/kernel/syscalls/pread/pread02.c @@ -161,7 +161,7 @@ int main(int ac, char **av) /* Check for the return code of pread() */ if (TEST_RETURN != -1) { tst_brkm(TFAIL, cleanup, "pread() returned " - "%d, expected -1, errno:%d", + "%ld, expected -1, errno:%d", TEST_RETURN, Test_cases[i].exp_errno); } diff --git a/testcases/kernel/syscalls/pread/pread03.c b/testcases/kernel/syscalls/pread/pread03.c index b5e25c2..962f2b0 100644 --- a/testcases/kernel/syscalls/pread/pread03.c +++ b/testcases/kernel/syscalls/pread/pread03.c @@ -131,8 +131,8 @@ int main(int ac, char **av) /* Check for the return code of pread() */ if (TEST_RETURN != -1) { tst_brkm(TFAIL, cleanup, "pread() returned " - "%d, expected -1, errno:%d\n", - TEST_RETURN, exp_enos); + "%ld, expected -1, errno:%d\n", + TEST_RETURN, EISDIR); } TEST_ERROR_LOG(TEST_ERRNO); diff --git a/testcases/kernel/syscalls/pselect/pselect01.c b/testcases/kernel/syscalls/pselect/pselect01.c index 1d2b3c1..250ed03 100644 --- a/testcases/kernel/syscalls/pselect/pselect01.c +++ b/testcases/kernel/syscalls/pselect/pselect01.c @@ -44,6 +44,7 @@ #include <time.h> #include <unistd.h> #include <errno.h> +#include <stdint.h> #include "test.h" #include "usctest.h" @@ -100,8 +101,8 @@ int main() tv.tv_nsec = 0; tst_resm(TINFO, - "Testing basic pselect sanity,Sleeping for %d secs", - tv.tv_sec); + "Testing basic pselect sanity,Sleeping for %jd secs", + (intmax_t)tv.tv_sec); start = time(&t); retval = pselect(0, &readfds, NULL, NULL, (struct timespec *)&tv, @@ -126,7 +127,7 @@ int main() tv.tv_nsec = total_nsec; tst_resm(TINFO, - "Testing basic pselect sanity,Sleeping for %d nano secs", + "Testing basic pselect sanity,Sleeping for %ld nano secs", tv.tv_nsec); gettimeofday(&tv_start, NULL); retval = diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c index 52a3a4c..e54a339 100644 --- a/testcases/kernel/syscalls/ptrace/ptrace03.c +++ b/testcases/kernel/syscalls/ptrace/ptrace03.c @@ -176,10 +176,8 @@ int main(int ac, char **av) exp_errno)) { exit(TEST_ERRNO); } else { - tst_resm(TWARN, "ptrace() returned %d;" - " errno: %d, %s", TEST_RETURN, - TEST_ERRNO, - strerror(TEST_ERRNO)); + tst_resm(TWARN|TTERRNO, "ptrace() returned %ld", + TEST_RETURN); exit(TEST_ERRNO); } diff --git a/testcases/kernel/syscalls/pwrite/pwrite01.c b/testcases/kernel/syscalls/pwrite/pwrite01.c index f85686e..490969f 100644 --- a/testcases/kernel/syscalls/pwrite/pwrite01.c +++ b/testcases/kernel/syscalls/pwrite/pwrite01.c @@ -75,6 +75,7 @@ #include <fcntl.h> #include <stdlib.h> #include <string.h> +#include <inttypes.h> #include "test.h" #include "usctest.h" @@ -271,10 +272,10 @@ void l_seek(int fdesc, off_t offset, int whence, off_t checkoff) off_t offloc; /* offset ret. from lseek() */ if ((offloc = lseek(fdesc, offset, whence)) != checkoff) { - tst_resm(TWARN, "lseek returned %d, expected %d", offloc, - checkoff); - tst_brkm(TBROK, cleanup, "lseek() on %s Failed, error=%d : %s", - TEMPFILE, errno, strerror(errno)); + tst_resm(TWARN, "lseek returned %"PRId64", expected %"PRId64, (int64_t)offloc, + (int64_t)checkoff); + tst_brkm(TBROK|TERRNO, cleanup, "lseek() on %s Failed", + TEMPFILE); } } @@ -302,17 +303,17 @@ void check_file_contents() /* Seek to specified offset position from beginning */ offloc = lseek(fildes, count * K1, SEEK_SET); if (offloc != (count * K1)) { - tst_brkm(TBROK, cleanup, - "lseek() failed: offloc=%d, errno=%d", - offloc, errno); + tst_brkm(TBROK|TERRNO, cleanup, + "lseek() failed: offloc=%"PRId64, + (int64_t)offloc); } /* Read the data from file into a buffer */ nread = read(fildes, read_buf, K1); if (nread != K1) { - tst_brkm(TBROK, cleanup, - "read() failed: nread=%d, errno=%d", - nread, errno); + tst_brkm(TBROK|TERRNO, cleanup, + "read() failed: nread=%d", + nread); } /* Compare the read data with the data written using pwrite */ diff --git a/testcases/kernel/syscalls/pwrite/pwrite02.c b/testcases/kernel/syscalls/pwrite/pwrite02.c index 20a6fbe..c0eb61f 100644 --- a/testcases/kernel/syscalls/pwrite/pwrite02.c +++ b/testcases/kernel/syscalls/pwrite/pwrite02.c @@ -162,7 +162,7 @@ int main(int ac, char **av) /* Check for the return code of pwrite() */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "pwrite() returned %d, " + tst_resm(TFAIL, "pwrite() returned %ld, " "expected -1, errno:%d", TEST_RETURN, Test_cases[i].exp_errno); continue; diff --git a/testcases/kernel/syscalls/pwrite/pwrite03.c b/testcases/kernel/syscalls/pwrite/pwrite03.c index 985fd96..0f9ab7c 100644 --- a/testcases/kernel/syscalls/pwrite/pwrite03.c +++ b/testcases/kernel/syscalls/pwrite/pwrite03.c @@ -132,7 +132,7 @@ int main(int ac, char **av) /* Check for the return code of pwrite() */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "pwrite() returned %d, " + tst_resm(TFAIL, "pwrite() returned %ld, " "expected -1, errno:%d", TEST_RETURN, exp_enos[0]); } diff --git a/testcases/kernel/syscalls/read/read01.c b/testcases/kernel/syscalls/read/read01.c index 04e514d..b6b02d7 100644 --- a/testcases/kernel/syscalls/read/read01.c +++ b/testcases/kernel/syscalls/read/read01.c @@ -197,7 +197,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "read(pfds) returned %d", + tst_resm(TPASS, "read(pfds) returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/read/read04.c b/testcases/kernel/syscalls/read/read04.c index 4ebc5ad..a87d92e 100644 --- a/testcases/kernel/syscalls/read/read04.c +++ b/testcases/kernel/syscalls/read/read04.c @@ -99,7 +99,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { if (TEST_RETURN != TST_SIZE) { - tst_resm(TFAIL, "Bad read count - got %d - " + tst_resm(TFAIL, "Bad read count - got %ld - " "expected %d", TEST_RETURN, TST_SIZE); continue; } diff --git a/testcases/kernel/syscalls/readlink/readlink01.c b/testcases/kernel/syscalls/readlink/readlink01.c index d4f964f..cdbaa2f 100644 --- a/testcases/kernel/syscalls/readlink/readlink01.c +++ b/testcases/kernel/syscalls/readlink/readlink01.c @@ -148,7 +148,7 @@ int main(int ac, char **av) "correct", SYMFILE); } } else { - tst_resm(TFAIL, "readlink() return value %d " + tst_resm(TFAIL, "readlink() return value %ld " "does't match, Expected %d", TEST_RETURN, exp_val); } diff --git a/testcases/kernel/syscalls/readlink/readlink02.c b/testcases/kernel/syscalls/readlink/readlink02.c index d1ab5e1..3f73f00 100644 --- a/testcases/kernel/syscalls/readlink/readlink02.c +++ b/testcases/kernel/syscalls/readlink/readlink02.c @@ -174,7 +174,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "readlink(%s, buf, 255) returned %d", + "readlink(%s, buf, 255) returned %ld", symlnk, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/readlink/readlink03.c b/testcases/kernel/syscalls/readlink/readlink03.c index e07f24e..0535b25 100644 --- a/testcases/kernel/syscalls/readlink/readlink03.c +++ b/testcases/kernel/syscalls/readlink/readlink03.c @@ -187,7 +187,7 @@ int main(int ac, char **av) /* Check return code of readlink(2) */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "readlink() returned %d, " + tst_resm(TFAIL, "readlink() returned %ld, " "expected -1, errno:%d", TEST_RETURN, Test_cases[i].exp_errno); continue; diff --git a/testcases/kernel/syscalls/readlink/readlink04.c b/testcases/kernel/syscalls/readlink/readlink04.c index 8f14d94..5775655 100644 --- a/testcases/kernel/syscalls/readlink/readlink04.c +++ b/testcases/kernel/syscalls/readlink/readlink04.c @@ -152,7 +152,7 @@ int main(int ac, char **av) "correct", SYMFILE); } } else { - tst_resm(TFAIL, "readlink() return value %d " + tst_resm(TFAIL, "readlink() return value %ld " "doesn't match, Expected %d", TEST_RETURN, exp_val); } diff --git a/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c b/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c index 720230a..06e7b89 100644 --- a/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c +++ b/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c @@ -188,10 +188,9 @@ static void test_nonlinear(int fd) if (remap_file_pages(page, page_sz * 2, 0, (window_pages - i - 2), 0) == -1) { - tst_resm(TFAIL, - "remap_file_pages error for page=%d, page_sz=%d, window_pages=%d (errno=%d : %s)", - page, (page_sz * 2), (window_pages - i - 2), - errno, strerror(errno)); + tst_resm(TFAIL|TERRNO, + "remap_file_pages error for page=%p, page_sz=%d, window_pages=%d", + page, (page_sz * 2), (window_pages - i - 2)); cleanup(data); } } diff --git a/testcases/kernel/syscalls/rename/rename02.c b/testcases/kernel/syscalls/rename/rename02.c index 0b5a513..e2f0725 100644 --- a/testcases/kernel/syscalls/rename/rename02.c +++ b/testcases/kernel/syscalls/rename/rename02.c @@ -173,7 +173,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "rename(%s, %s) returned %d", + tst_resm(TPASS, "rename(%s, %s) returned %ld", fname, mname, TEST_RETURN); } if (unlink(mname) == -1) { diff --git a/testcases/kernel/syscalls/rmdir/rmdir04.c b/testcases/kernel/syscalls/rmdir/rmdir04.c index 15a0c87..ae75818 100644 --- a/testcases/kernel/syscalls/rmdir/rmdir04.c +++ b/testcases/kernel/syscalls/rmdir/rmdir04.c @@ -179,7 +179,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "rmdir(%s) returned %d", fname, + tst_resm(TPASS, "rmdir(%s) returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c index 27af970..ffc5fa2 100644 --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c @@ -186,7 +186,7 @@ int main(int ac, char **av) { TEST(set_handler(signal, 0, test_flags[flag])); if (TEST_RETURN == 0) { tst_resm(TINFO,"signal: %d ", signal); - tst_resm(TPASS, "rt_sigaction call succeeded: result = %d ",TEST_RETURN ); + tst_resm(TPASS, "rt_sigaction call succeeded: result = %ld ",TEST_RETURN ); tst_resm(TINFO, "sa.sa_flags = %s ",test_flags_list[flag]); kill(getpid(),signal); } else { diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c index c6f57ab..aa98de6 100644 --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c @@ -177,7 +177,7 @@ int main(int ac, char **av) { tst_resm(TINFO, "sa.sa_flags = %s ",test_flags_list[flag]); tst_resm(TPASS, "%s failure with sig: %d as expected errno = %s : %s", TCID, signal,test_cases[0].errdesc, strerror(TEST_ERRNO)); } else { - tst_resm(TFAIL, "rt_sigaction call succeeded: result = %d got error %d:but expected %d", TEST_RETURN, TEST_ERRNO, test_cases[0].exp_errno); + tst_resm(TFAIL, "rt_sigaction call succeeded: result = %ld got error %d:but expected %d", TEST_RETURN, TEST_ERRNO, test_cases[0].exp_errno); tst_resm(TINFO, "sa.sa_flags = %s ",test_flags_list[flag]); } } diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c index aa85117..9d3aa98 100644 --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c @@ -183,7 +183,7 @@ int main(int ac, char **av) { tst_resm(TINFO, "sa.sa_flags = %s ",test_flags_list[flag]); tst_resm(TPASS, "%s failure with sig: %d as expected errno = %s : %s", TCID, signal,test_cases[0].errdesc, strerror(TEST_ERRNO)); } else { - tst_resm(TFAIL, "rt_sigaction call succeeded: result = %d got error %d:but expected %d", TEST_RETURN, TEST_ERRNO, test_cases[0].exp_errno); + tst_resm(TFAIL, "rt_sigaction call succeeded: result = %ld got error %d:but expected %d", TEST_RETURN, TEST_ERRNO, test_cases[0].exp_errno); tst_resm(TINFO, "sa.sa_flags = %s ",test_flags_list[flag]); } } diff --git a/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c b/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c index 2db0ca5..beaafd8 100644 --- a/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c +++ b/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c @@ -118,11 +118,9 @@ int main(int ac, char **av) tst_resm(TPASS, "%s Passed", test_cases[ind].desc); } else { - tst_resm(TFAIL, "%s Failed," - "sched_get_priority_max() returned %d" - " errno = %d : %s", - test_cases[ind].desc, TEST_RETURN, - TEST_ERRNO, strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, "%s Failed," + "sched_get_priority_max() returned %ld", + tes... [truncated message content] |