diff mbox series

[v1] syscalls/pread02_64: format string for 64-bit offset

Message ID 20220801233540.368009-1-edliaw@google.com
State Accepted
Headers show
Series [v1] syscalls/pread02_64: format string for 64-bit offset | expand

Commit Message

Edward Liaw Aug. 1, 2022, 11:35 p.m. UTC
When compiling as 32-bit with _FILE_OFFSET_BITS=64, the format string
needs to be specified as 64-bit long (%lld).

Signed-off-by: Edward Liaw <edliaw@google.com>
---
 testcases/kernel/syscalls/pread/pread02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Vorel Aug. 3, 2022, 9:47 a.m. UTC | #1
Hi Edward,

> When compiling as 32-bit with _FILE_OFFSET_BITS=64, the format string
> needs to be specified as 64-bit long (%lld).

Thanks, merged!

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/pread/pread02.c b/testcases/kernel/syscalls/pread/pread02.c
index fda5fd190..5fa011ef2 100644
--- a/testcases/kernel/syscalls/pread/pread02.c
+++ b/testcases/kernel/syscalls/pread/pread02.c
@@ -42,7 +42,7 @@  static void verify_pread(unsigned int n)
 	char buf[K1];
 
 	TST_EXP_FAIL2(pread(*tc->fd, &buf, tc->nb, tc->offst), tc->exp_errno,
-		"pread(%d, %zu, %ld) %s", *tc->fd, tc->nb, tc->offst, tc->desc);
+		"pread(%d, %zu, %lld) %s", *tc->fd, tc->nb, (long long)tc->offst, tc->desc);
 }
 
 static void setup(void)