All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/nolibc: handle large return values from syscall()
@ 2023-06-04 19:52 Thomas Weißschuh
  0 siblings, 0 replies; only message in thread
From: Thomas Weißschuh @ 2023-06-04 19:52 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux-kernel, Thomas Weißschuh

Syscalls return values long values. Don't truncate to int.

Fixes: 33158bb86d46 ("tools/nolibc/unistd: add syscall()")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---

Just noticed this when responding at
https://lore.kernel.org/lkml/ea4e7442-7223-4211-ba29-70821e907888@t-8ch.de/

Feel free to squash this directly into the broken commit.
---
 tools/include/nolibc/unistd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h
index 6773e83c16a0..c20b2fbf065e 100644
--- a/tools/include/nolibc/unistd.h
+++ b/tools/include/nolibc/unistd.h
@@ -58,7 +58,7 @@ int tcsetpgrp(int fd, pid_t pid)
 
 #define _syscall(N, ...)                                                      \
 ({                                                                            \
-	int _ret = my_syscall##N(__VA_ARGS__);                                \
+	long _ret = my_syscall##N(__VA_ARGS__);                               \
 	if (_ret < 0) {                                                       \
 		SET_ERRNO(-_ret);                                             \
 		_ret = -1;                                                    \

---
base-commit: a76324560e0f8f916d89452dd6aec1104e97a3c6
change-id: 20230604-nolibc-syscall-ret-520dfe9fb6b0

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-04 19:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-04 19:52 [PATCH] tools/nolibc: handle large return values from syscall() Thomas Weißschuh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.