diff mbox series

[1/2] regen.sh: Use intptr_t for tst_syscall return

Message ID 20221103164431.365731-2-teo.coupriediaz@arm.com
State Accepted
Headers show
Series Change return type of tst_syscall | expand

Commit Message

Teo Couprie Diaz Nov. 3, 2022, 4:44 p.m. UTC
Some syscalls directly return pointers, like brk or mmap. int is currently
used for the return value in tst_syscall but is not large enough
to guarantee that such a returned value will fit.
Instead, use intptr_t which is guaranted to be castable to (void *)
without loss of data.

Signed-off-by: Teo Couprie Diaz <teo.coupriediaz@arm.com>
---
 include/lapi/syscalls/regen.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Cyril Hrubis Nov. 7, 2022, 3:05 p.m. UTC | #1
Hi!
Reviwed-by: Cyril Hrubis <chrubis@suse.cz>
Richard Palethorpe Nov. 7, 2022, 3:12 p.m. UTC | #2
Hello,

Merged! thanks.

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
> Reviwed-by: Cyril Hrubis <chrubis@suse.cz>
>
> -- 
> Cyril Hrubis
> chrubis@suse.cz
diff mbox series

Patch

diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh
index 3bf38fd03..97027e2f3 100755
--- a/include/lapi/syscalls/regen.sh
+++ b/include/lapi/syscalls/regen.sh
@@ -48,7 +48,7 @@  cat << EOF > "${output_pid}"
 #endif
 
 #define tst_syscall(NR, ...) ({ \\
-	int tst_ret; \\
+	intptr_t tst_ret; \\
 	if (NR == __LTP__NR_INVALID_SYSCALL) { \\
 		errno = ENOSYS; \\
 		tst_ret = -1; \\