Skip to contentSkip to conversation

syscalls/pread02_64: format string for 64-bit offset

PATCH In review Edward Liaw via ltp 2 participants 2 messages Aug 1, 2022 – Aug 3, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/pread02_64: format string for 64-bit offset

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

---
 testcases/kernel/syscalls/pread/pread02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/pread/pread02.c +1 -1
index fda5fd190..5fa011ef2 100644
@@ -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)
Signature · 5 lines
2.37.1.455.g008518b4e5-goog


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Edward,

Quoted 2 lines

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

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp