From nobody Fri Apr 17 03:11:58 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83200378D86 for ; Mon, 23 Feb 2026 21:40:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771882822; cv=none; b=EAgO9jmyyIju/bE0N6vrAbNq+2BOLu0C/lRNFB/KskwknkXm2PiTpFPX2ASiqBOfnnrLUk5A7t2ZiVX6o5K/ipPWh6kH55ltlyGuKftaYzBtdTlmcJ0Ni2P7MysJnZqMAwfsijfDLc0ckL/+GuKgzYOaPr/qMfUS0u5G023e1eA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771882822; c=relaxed/simple; bh=cadEQt/zDAmUoybFqt4M0LgW6cjJXbbDN34cnIJGDaM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=B1z1ov+yTjbnIpLd23xUuKtahPQDoZ8f+p870VI5BvJL9DtdnbNHoX+VPOw4IPv4S29DVXdX9nOvqN/gtrjuohusIbqdd6wyLRkYbfIi+sZxOLb2O+sHQ4fUtfQIVGzfoXYMXVMFN/Ojs1lj8nQZzOfQWkb2gaLLuTAcQeTq90c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=a9uHST+U; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="a9uHST+U" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1771882817; bh=cadEQt/zDAmUoybFqt4M0LgW6cjJXbbDN34cnIJGDaM=; h=From:Date:Subject:To:Cc:From; b=a9uHST+UwgfromBzBV0DBJyZzaxDjGYy2UPzbWLfvwaclsC4BOxEcBMPgDuY4s/7e 1zl5q3iO1TJaBeJpafKfXVLumhqtkx4le1NgLEWdZwP338St0i5RJRuQB57e+xOPmz Prt0xslcBbfvI6FHmpor/DfMur4ZLJcUMc5vqQg4= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Feb 2026 22:40:14 +0100 Subject: [PATCH] tools/nolibc: rename my_syscallX() to __nolibc_syscallX() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-nolibc-namespacing-v1-1-52574ffebb2c@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/x3MTQqAIBBA4avIrBPKsL+rRIvRphqoMRQiiO6et PwW7z2QKDIlGNQDkS5OHCSjKhT4DWUlzXM2mNLYsjOVlrCz81rwoHSiZ1l139i2nheHHhFyeEZ a+P6n4/S+H3WH5apkAAAA X-Change-ID: 20250821-nolibc-namespacing-96573dfbacaa To: Willy Tarreau Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771882817; l=81199; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=cadEQt/zDAmUoybFqt4M0LgW6cjJXbbDN34cnIJGDaM=; b=7hIjY4qJjTbRq+QWS+GXr7D1+FYOTXUBMnAKCP/v00QvBNwmpVYcjTClcVxIxIhRAVDzcgJnL 5o6GHbM7eDHDoeFX99l5QrxRcAMeVPth6oGjHswP5G/ndO1bOiCbB5B X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The naming convention of the my_syscallX() macros is a bit unfortunate. They may conflict with application code and the name is very generic. Switch to __nolibc_syscallX(). The leading underscores place the symbols in the implementation-defined namespace, avoiding conflicting names. It is also clearer that these are non-standard extensions from nolibc. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Willy Tarreau --- All in-tree users have been removed during the last development cycle. FYI, run-tests.sh is currently broken for loongarch and riscv32, due to unrelated issues: * https://lore.kernel.org/lkml/20260216082834-edc51c46-7b7a-4295-8ea5-4d9a3= ca2224f@linutronix.de/ * https://lore.kernel.org/lkml/20260223144108-dcace0b9-02e8-4b67-a7ce-f263b= ed36f26@linutronix.de/ --- tools/include/nolibc/arch-arm.h | 14 ++--- tools/include/nolibc/arch-arm64.h | 14 ++--- tools/include/nolibc/arch-loongarch.h | 14 ++--- tools/include/nolibc/arch-m68k.h | 14 ++--- tools/include/nolibc/arch-mips.h | 18 +++--- tools/include/nolibc/arch-powerpc.h | 14 ++--- tools/include/nolibc/arch-riscv.h | 14 ++--- tools/include/nolibc/arch-s390.h | 20 +++---- tools/include/nolibc/arch-sh.h | 14 ++--- tools/include/nolibc/arch-sparc.h | 18 +++--- tools/include/nolibc/arch-x86.h | 68 ++++++++++----------- tools/include/nolibc/fcntl.h | 4 +- tools/include/nolibc/nolibc.h | 6 +- tools/include/nolibc/poll.h | 4 +- tools/include/nolibc/sched.h | 4 +- tools/include/nolibc/stackprotector.h | 8 +-- tools/include/nolibc/sys.h | 110 +++++++++++++++++-------------= ---- tools/include/nolibc/sys/ioctl.h | 2 +- tools/include/nolibc/sys/mman.h | 8 +-- tools/include/nolibc/sys/mount.h | 2 +- tools/include/nolibc/sys/prctl.h | 2 +- tools/include/nolibc/sys/ptrace.h | 2 +- tools/include/nolibc/sys/random.h | 2 +- tools/include/nolibc/sys/reboot.h | 2 +- tools/include/nolibc/sys/resource.h | 2 +- tools/include/nolibc/sys/select.h | 6 +- tools/include/nolibc/sys/stat.h | 2 +- tools/include/nolibc/sys/syscall.h | 2 +- tools/include/nolibc/sys/timerfd.h | 10 ++-- tools/include/nolibc/sys/uio.h | 4 +- tools/include/nolibc/sys/utsname.h | 2 +- tools/include/nolibc/sys/wait.h | 2 +- tools/include/nolibc/time.h | 28 ++++----- tools/include/nolibc/unistd.h | 2 +- 34 files changed, 220 insertions(+), 218 deletions(-) diff --git a/tools/include/nolibc/arch-arm.h b/tools/include/nolibc/arch-ar= m.h index 251c42579028..a4d3a777a051 100644 --- a/tools/include/nolibc/arch-arm.h +++ b/tools/include/nolibc/arch-arm.h @@ -50,7 +50,7 @@ =20 #endif /* end THUMB */ =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _num __asm__(_NOLIBC_SYSCALL_REG) =3D (num); \ register long _arg1 __asm__ ("r0"); \ @@ -67,7 +67,7 @@ _arg1; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _num __asm__(_NOLIBC_SYSCALL_REG) =3D (num); \ register long _arg1 __asm__ ("r0") =3D (long)(arg1); \ @@ -84,7 +84,7 @@ _arg1; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _num __asm__(_NOLIBC_SYSCALL_REG) =3D (num); \ register long _arg1 __asm__ ("r0") =3D (long)(arg1); \ @@ -102,7 +102,7 @@ _arg1; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _num __asm__(_NOLIBC_SYSCALL_REG) =3D (num); \ register long _arg1 __asm__ ("r0") =3D (long)(arg1); \ @@ -121,7 +121,7 @@ _arg1; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _num __asm__(_NOLIBC_SYSCALL_REG) =3D (num); \ register long _arg1 __asm__ ("r0") =3D (long)(arg1); \ @@ -141,7 +141,7 @@ _arg1; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__(_NOLIBC_SYSCALL_REG) =3D (num); \ register long _arg1 __asm__ ("r0") =3D (long)(arg1); \ @@ -162,7 +162,7 @@ _arg1; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__(_NOLIBC_SYSCALL_REG) =3D (num); \ register long _arg1 __asm__ ("r0") =3D (long)(arg1); \ diff --git a/tools/include/nolibc/arch-arm64.h b/tools/include/nolibc/arch-= arm64.h index 080a55a7144e..28b3c7536ad6 100644 --- a/tools/include/nolibc/arch-arm64.h +++ b/tools/include/nolibc/arch-arm64.h @@ -22,7 +22,7 @@ * don't have to experience issues with register constraints. */ =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _num __asm__ ("x8") =3D (num); \ register long _arg1 __asm__ ("x0"); \ @@ -36,7 +36,7 @@ _arg1; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _num __asm__ ("x8") =3D (num); \ register long _arg1 __asm__ ("x0") =3D (long)(arg1); \ @@ -51,7 +51,7 @@ _arg1; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _num __asm__ ("x8") =3D (num); \ register long _arg1 __asm__ ("x0") =3D (long)(arg1); \ @@ -67,7 +67,7 @@ _arg1; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _num __asm__ ("x8") =3D (num); \ register long _arg1 __asm__ ("x0") =3D (long)(arg1); \ @@ -84,7 +84,7 @@ _arg1; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _num __asm__ ("x8") =3D (num); \ register long _arg1 __asm__ ("x0") =3D (long)(arg1); \ @@ -102,7 +102,7 @@ _arg1; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__ ("x8") =3D (num); \ register long _arg1 __asm__ ("x0") =3D (long)(arg1); \ @@ -121,7 +121,7 @@ _arg1; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__ ("x8") =3D (num); \ register long _arg1 __asm__ ("x0") =3D (long)(arg1); \ diff --git a/tools/include/nolibc/arch-loongarch.h b/tools/include/nolibc/a= rch-loongarch.h index c894176c3f89..86fb34bbf185 100644 --- a/tools/include/nolibc/arch-loongarch.h +++ b/tools/include/nolibc/arch-loongarch.h @@ -24,7 +24,7 @@ #define _NOLIBC_SYSCALL_CLOBBERLIST \ "memory", "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$t8" =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0"); \ @@ -38,7 +38,7 @@ _arg1; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -52,7 +52,7 @@ _arg1; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -68,7 +68,7 @@ _arg1; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -85,7 +85,7 @@ _arg1; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -103,7 +103,7 @@ _arg1; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -122,7 +122,7 @@ _arg1; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ diff --git a/tools/include/nolibc/arch-m68k.h b/tools/include/nolibc/arch-m= 68k.h index 2a4fbada5e79..81d34c219a42 100644 --- a/tools/include/nolibc/arch-m68k.h +++ b/tools/include/nolibc/arch-m68k.h @@ -15,7 +15,7 @@ =20 #define _NOLIBC_SYSCALL_CLOBBERLIST "memory" =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _num __asm__ ("d0") =3D (num); \ \ @@ -28,7 +28,7 @@ _num; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _num __asm__ ("d0") =3D (num); \ register long _arg1 __asm__ ("d1") =3D (long)(arg1); \ @@ -42,7 +42,7 @@ _num; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _num __asm__ ("d0") =3D (num); \ register long _arg1 __asm__ ("d1") =3D (long)(arg1); \ @@ -57,7 +57,7 @@ _num; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _num __asm__ ("d0") =3D (num); \ register long _arg1 __asm__ ("d1") =3D (long)(arg1); \ @@ -73,7 +73,7 @@ _num; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _num __asm__ ("d0") =3D (num); \ register long _arg1 __asm__ ("d1") =3D (long)(arg1); \ @@ -90,7 +90,7 @@ _num; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__ ("d0") =3D (num); \ register long _arg1 __asm__ ("d1") =3D (long)(arg1); \ @@ -108,7 +108,7 @@ _num; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__ ("d0") =3D (num); \ register long _arg1 __asm__ ("d1") =3D (long)(arg1); \ diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-m= ips.h index a72506ceec6b..bd4a9b57e1f0 100644 --- a/tools/include/nolibc/arch-mips.h +++ b/tools/include/nolibc/arch-mips.h @@ -59,7 +59,7 @@ =20 #endif /* _ABIO32 */ =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg4 __asm__ ("a3"); \ @@ -75,7 +75,7 @@ _arg4 ? -_num : _num; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -93,7 +93,7 @@ _arg4 ? -_num : _num; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -112,7 +112,7 @@ _arg4 ? -_num : _num; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -132,7 +132,7 @@ _arg4 ? -_num : _num; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -154,7 +154,7 @@ =20 #if defined(_ABIO32) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -176,7 +176,7 @@ _arg4 ? -_num : _num; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -203,7 +203,7 @@ =20 #else /* _ABIN32 || _ABI64 */ =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg1 __asm__ ("$4") =3D (long)(arg1); \ @@ -222,7 +222,7 @@ _arg4 ? -_num : _num; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__ ("v0") =3D (num); \ register long _arg1 __asm__ ("$4") =3D (long)(arg1); \ diff --git a/tools/include/nolibc/arch-powerpc.h b/tools/include/nolibc/arc= h-powerpc.h index e0c7e0b81f7c..ef878868aa4a 100644 --- a/tools/include/nolibc/arch-powerpc.h +++ b/tools/include/nolibc/arch-powerpc.h @@ -25,7 +25,7 @@ #define _NOLIBC_SYSCALL_CLOBBERLIST \ "memory", "cr0", "r12", "r11", "r10", "r9" =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _ret __asm__ ("r3"); \ register long _num __asm__ ("r0") =3D (num); \ @@ -42,7 +42,7 @@ _ret; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _ret __asm__ ("r3"); \ register long _num __asm__ ("r0") =3D (num); \ @@ -61,7 +61,7 @@ }) =20 =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _ret __asm__ ("r3"); \ register long _num __asm__ ("r0") =3D (num); \ @@ -81,7 +81,7 @@ }) =20 =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _ret __asm__ ("r3"); \ register long _num __asm__ ("r0") =3D (num); \ @@ -102,7 +102,7 @@ }) =20 =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _ret __asm__ ("r3"); \ register long _num __asm__ ("r0") =3D (num); \ @@ -125,7 +125,7 @@ }) =20 =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _ret __asm__ ("r3"); \ register long _num __asm__ ("r0") =3D (num); \ @@ -148,7 +148,7 @@ _ret; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _ret __asm__ ("r3"); \ register long _num __asm__ ("r0") =3D (num); \ diff --git a/tools/include/nolibc/arch-riscv.h b/tools/include/nolibc/arch-= riscv.h index 1c00cacf57e1..386ebb9f5b08 100644 --- a/tools/include/nolibc/arch-riscv.h +++ b/tools/include/nolibc/arch-riscv.h @@ -21,7 +21,7 @@ * so that we don't have to experience issues with register constraint= s. */ =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0"); \ @@ -35,7 +35,7 @@ _arg1; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -49,7 +49,7 @@ _arg1; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -65,7 +65,7 @@ _arg1; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -82,7 +82,7 @@ _arg1; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -100,7 +100,7 @@ _arg1; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ @@ -119,7 +119,7 @@ _arg1; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__ ("a7") =3D (num); \ register long _arg1 __asm__ ("a0") =3D (long)(arg1); \ diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s= 390.h index 904281e95f99..d301b636e083 100644 --- a/tools/include/nolibc/arch-s390.h +++ b/tools/include/nolibc/arch-s390.h @@ -28,7 +28,7 @@ * */ =20 -#define my_syscall0(num) \ +#define __nolibc_syscall0(num) \ ({ \ register long _num __asm__ ("1") =3D (num); \ register long _rc __asm__ ("2"); \ @@ -42,7 +42,7 @@ _rc; \ }) =20 -#define my_syscall1(num, arg1) \ +#define __nolibc_syscall1(num, arg1) \ ({ \ register long _num __asm__ ("1") =3D (num); \ register long _arg1 __asm__ ("2") =3D (long)(arg1); \ @@ -56,7 +56,7 @@ _arg1; \ }) =20 -#define my_syscall2(num, arg1, arg2) \ +#define __nolibc_syscall2(num, arg1, arg2) \ ({ \ register long _num __asm__ ("1") =3D (num); \ register long _arg1 __asm__ ("2") =3D (long)(arg1); \ @@ -71,7 +71,7 @@ _arg1; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) \ ({ \ register long _num __asm__ ("1") =3D (num); \ register long _arg1 __asm__ ("2") =3D (long)(arg1); \ @@ -87,7 +87,7 @@ _arg1; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \ ({ \ register long _num __asm__ ("1") =3D (num); \ register long _arg1 __asm__ ("2") =3D (long)(arg1); \ @@ -104,7 +104,7 @@ _arg1; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \ ({ \ register long _num __asm__ ("1") =3D (num); \ register long _arg1 __asm__ ("2") =3D (long)(arg1); \ @@ -123,7 +123,7 @@ _arg1; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \ ({ \ register long _num __asm__ ("1") =3D (num); \ register long _arg1 __asm__ ("2") =3D (long)(arg1); \ @@ -179,21 +179,21 @@ void *sys_mmap(void *addr, size_t length, int prot, i= nt flags, int fd, .offset =3D (unsigned long)offset }; =20 - return (void *)my_syscall1(__NR_mmap, &args); + return (void *)__nolibc_syscall1(__NR_mmap, &args); } #define sys_mmap sys_mmap =20 static __attribute__((unused)) pid_t sys_fork(void) { - return my_syscall5(__NR_clone, 0, SIGCHLD, 0, 0, 0); + return __nolibc_syscall5(__NR_clone, 0, SIGCHLD, 0, 0, 0); } #define sys_fork sys_fork =20 static __attribute__((unused)) pid_t sys_vfork(void) { - return my_syscall5(__NR_clone, 0, CLONE_VM | CLONE_VFORK | SIGCHLD, 0, 0,= 0); + return __nolibc_syscall5(__NR_clone, 0, CLONE_VM | CLONE_VFORK | SIGCHLD,= 0, 0, 0); } #define sys_vfork sys_vfork =20 diff --git a/tools/include/nolibc/arch-sh.h b/tools/include/nolibc/arch-sh.h index 7a421197d104..b5a64ceeec97 100644 --- a/tools/include/nolibc/arch-sh.h +++ b/tools/include/nolibc/arch-sh.h @@ -19,7 +19,7 @@ * - syscall return value is in r0 */ =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _num __asm__ ("r3") =3D (num); \ register long _ret __asm__ ("r0"); \ @@ -33,7 +33,7 @@ _ret; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _num __asm__ ("r3") =3D (num); \ register long _ret __asm__ ("r0"); \ @@ -48,7 +48,7 @@ _ret; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _num __asm__ ("r3") =3D (num); \ register long _ret __asm__ ("r0"); \ @@ -64,7 +64,7 @@ _ret; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _num __asm__ ("r3") =3D (num); \ register long _ret __asm__ ("r0"); \ @@ -81,7 +81,7 @@ _ret; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _num __asm__ ("r3") =3D (num); \ register long _ret __asm__ ("r0"); \ @@ -99,7 +99,7 @@ _ret; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__ ("r3") =3D (num); \ register long _ret __asm__ ("r0"); \ @@ -119,7 +119,7 @@ _ret; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__ ("r3") =3D (num); \ register long _ret __asm__ ("r0"); \ diff --git a/tools/include/nolibc/arch-sparc.h b/tools/include/nolibc/arch-= sparc.h index 2ebb5686e105..02aca6579cb2 100644 --- a/tools/include/nolibc/arch-sparc.h +++ b/tools/include/nolibc/arch-sparc.h @@ -38,7 +38,7 @@ =20 #endif /* __arch64__ */ =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ register long _num __asm__ ("g1") =3D (num); \ register long _arg1 __asm__ ("o0"); \ @@ -52,7 +52,7 @@ _arg1; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ register long _num __asm__ ("g1") =3D (num); \ register long _arg1 __asm__ ("o0") =3D (long)(arg1); \ @@ -66,7 +66,7 @@ _arg1; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ register long _num __asm__ ("g1") =3D (num); \ register long _arg1 __asm__ ("o0") =3D (long)(arg1); \ @@ -81,7 +81,7 @@ _arg1; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ register long _num __asm__ ("g1") =3D (num); \ register long _arg1 __asm__ ("o0") =3D (long)(arg1); \ @@ -97,7 +97,7 @@ _arg1; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ register long _num __asm__ ("g1") =3D (num); \ register long _arg1 __asm__ ("o0") =3D (long)(arg1); \ @@ -114,7 +114,7 @@ _arg1; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ register long _num __asm__ ("g1") =3D (num); \ register long _arg1 __asm__ ("o0") =3D (long)(arg1); \ @@ -132,7 +132,7 @@ _arg1; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ register long _num __asm__ ("g1") =3D (num); \ register long _arg1 __asm__ ("o0") =3D (long)(arg1); \ @@ -180,7 +180,7 @@ pid_t sys_fork(void) pid_t parent, ret; =20 parent =3D getpid(); - ret =3D my_syscall0(__NR_fork); + ret =3D __nolibc_syscall0(__NR_fork); =20 /* The syscall returns the parent pid in the child instead of 0 */ if (ret =3D=3D parent) @@ -196,7 +196,7 @@ pid_t sys_vfork(void) pid_t parent, ret; =20 parent =3D getpid(); - ret =3D my_syscall0(__NR_vfork); + ret =3D __nolibc_syscall0(__NR_vfork); =20 /* The syscall returns the parent pid in the child instead of 0 */ if (ret =3D=3D parent) diff --git a/tools/include/nolibc/arch-x86.h b/tools/include/nolibc/arch-x8= 6.h index f6c43ac5377b..769ba01a8629 100644 --- a/tools/include/nolibc/arch-x86.h +++ b/tools/include/nolibc/arch-x86.h @@ -30,7 +30,7 @@ */ #define __ARCH_WANT_SYS_OLD_SELECT =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ long _ret; \ register long _num __asm__ ("eax") =3D (num); \ @@ -44,7 +44,7 @@ _ret; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ long _ret; \ register long _num __asm__ ("eax") =3D (num); \ @@ -60,7 +60,7 @@ _ret; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ long _ret; \ register long _num __asm__ ("eax") =3D (num); \ @@ -77,7 +77,7 @@ _ret; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ long _ret; \ register long _num __asm__ ("eax") =3D (num); \ @@ -95,7 +95,7 @@ _ret; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ long _ret; \ register long _num __asm__ ("eax") =3D (num); \ @@ -114,7 +114,7 @@ _ret; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ long _ret; \ register long _num __asm__ ("eax") =3D (num); \ @@ -134,27 +134,27 @@ _ret; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \ -({ \ - long _eax =3D (long)(num); \ - long _arg6 =3D (long)(arg6); /* Always in memory */ \ - __asm__ volatile ( \ - "pushl %[_arg6]\n\t" \ - "pushl %%ebp\n\t" \ - "movl 4(%%esp),%%ebp\n\t" \ - "int $0x80\n\t" \ - "popl %%ebp\n\t" \ - "addl $4,%%esp\n\t" \ - : "+a"(_eax) /* %eax */ \ - : "b"(arg1), /* %ebx */ \ - "c"(arg2), /* %ecx */ \ - "d"(arg3), /* %edx */ \ - "S"(arg4), /* %esi */ \ - "D"(arg5), /* %edi */ \ - [_arg6]"m"(_arg6) /* memory */ \ - : "memory", "cc" \ - ); \ - _eax; \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \ +({ \ + long _eax =3D (long)(num); \ + long _arg6 =3D (long)(arg6); /* Always in memory */ \ + __asm__ volatile ( \ + "pushl %[_arg6]\n\t" \ + "pushl %%ebp\n\t" \ + "movl 4(%%esp),%%ebp\n\t" \ + "int $0x80\n\t" \ + "popl %%ebp\n\t" \ + "addl $4,%%esp\n\t" \ + : "+a"(_eax) /* %eax */ \ + : "b"(arg1), /* %ebx */ \ + "c"(arg2), /* %ecx */ \ + "d"(arg3), /* %edx */ \ + "S"(arg4), /* %esi */ \ + "D"(arg5), /* %edi */ \ + [_arg6]"m"(_arg6) /* memory */ \ + : "memory", "cc" \ + ); \ + _eax; \ }) =20 #ifndef NOLIBC_NO_RUNTIME @@ -200,7 +200,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoin= t __no_stack_protector _s * */ =20 -#define my_syscall0(num) = \ +#define __nolibc_syscall0(num) = \ ({ = \ long _ret; \ register long _num __asm__ ("rax") =3D (num); \ @@ -214,7 +214,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoin= t __no_stack_protector _s _ret; \ }) =20 -#define my_syscall1(num, arg1) = \ +#define __nolibc_syscall1(num, arg1) = \ ({ = \ long _ret; \ register long _num __asm__ ("rax") =3D (num); \ @@ -230,7 +230,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoin= t __no_stack_protector _s _ret; \ }) =20 -#define my_syscall2(num, arg1, arg2) = \ +#define __nolibc_syscall2(num, arg1, arg2) = \ ({ = \ long _ret; \ register long _num __asm__ ("rax") =3D (num); \ @@ -247,7 +247,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoin= t __no_stack_protector _s _ret; \ }) =20 -#define my_syscall3(num, arg1, arg2, arg3) = \ +#define __nolibc_syscall3(num, arg1, arg2, arg3) = \ ({ = \ long _ret; \ register long _num __asm__ ("rax") =3D (num); \ @@ -265,7 +265,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoin= t __no_stack_protector _s _ret; \ }) =20 -#define my_syscall4(num, arg1, arg2, arg3, arg4) = \ +#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) = \ ({ = \ long _ret; \ register long _num __asm__ ("rax") =3D (num); \ @@ -284,7 +284,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoin= t __no_stack_protector _s _ret; \ }) =20 -#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ +#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) = \ ({ = \ long _ret; \ register long _num __asm__ ("rax") =3D (num); \ @@ -304,7 +304,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoin= t __no_stack_protector _s _ret; \ }) =20 -#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ +#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) = \ ({ = \ long _ret; \ register long _num __asm__ ("rax") =3D (num); \ diff --git a/tools/include/nolibc/fcntl.h b/tools/include/nolibc/fcntl.h index bff2e542f20f..8d82768dea9d 100644 --- a/tools/include/nolibc/fcntl.h +++ b/tools/include/nolibc/fcntl.h @@ -21,7 +21,7 @@ static __attribute__((unused)) int sys_openat(int dirfd, const char *path, int flags, mode_t mode) { - return my_syscall4(__NR_openat, dirfd, path, flags, mode); + return __nolibc_syscall4(__NR_openat, dirfd, path, flags, mode); } =20 static __attribute__((unused)) @@ -47,7 +47,7 @@ int openat(int dirfd, const char *path, int flags, ...) static __attribute__((unused)) int sys_open(const char *path, int flags, mode_t mode) { - return my_syscall4(__NR_openat, AT_FDCWD, path, flags, mode); + return __nolibc_syscall4(__NR_openat, AT_FDCWD, path, flags, mode); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 9c7f43b9218b..d1d08b7f8599 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -12,14 +12,14 @@ * * Syscalls are split into 3 levels: * - The lower level is the arch-specific syscall() definition, consisti= ng in - * assembly code in compound expressions. These are called my_syscall0= () to - * my_syscall6() depending on the number of arguments. All input argum= ents + * assembly code in compound expressions. These are called __nolibc_sy= scall0() to + * __nolibc_syscall6() depending on the number of arguments. All input= arguments * are castto a long stored in a register. These expressions always re= turn * the syscall's return value as a signed long value which is often ei= ther * a pointer or the negated errno value. * * - The second level is mostly architecture-independent. It is made of - * static functions called sys_() which rely on my_syscallN() + * static functions called sys_() which rely on __nolibc_syscall= N() * depending on the syscall definition. These functions are responsible * for exposing the appropriate types for the syscall arguments (int, * pointers, etc) and for setting the appropriate return type (often i= nt). diff --git a/tools/include/nolibc/poll.h b/tools/include/nolibc/poll.h index e854c94647b1..ea5a6d08c43c 100644 --- a/tools/include/nolibc/poll.h +++ b/tools/include/nolibc/poll.h @@ -30,7 +30,7 @@ int sys_poll(struct pollfd *fds, int nfds, int timeout) t.tv_sec =3D timeout / 1000; t.tv_nsec =3D (timeout % 1000) * 1000000; } - return my_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >=3D 0) ? &t : = NULL, NULL, 0); + return __nolibc_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >=3D 0) ?= &t : NULL, NULL, 0); #else struct __kernel_old_timespec t; =20 @@ -38,7 +38,7 @@ int sys_poll(struct pollfd *fds, int nfds, int timeout) t.tv_sec =3D timeout / 1000; t.tv_nsec =3D (timeout % 1000) * 1000000; } - return my_syscall5(__NR_ppoll, fds, nfds, (timeout >=3D 0) ? &t : NULL, N= ULL, 0); + return __nolibc_syscall5(__NR_ppoll, fds, nfds, (timeout >=3D 0) ? &t : N= ULL, NULL, 0); #endif } =20 diff --git a/tools/include/nolibc/sched.h b/tools/include/nolibc/sched.h index 32221562c166..b1af7fa6672d 100644 --- a/tools/include/nolibc/sched.h +++ b/tools/include/nolibc/sched.h @@ -21,7 +21,7 @@ static __attribute__((unused)) int sys_setns(int fd, int nstype) { - return my_syscall2(__NR_setns, fd, nstype); + return __nolibc_syscall2(__NR_setns, fd, nstype); } =20 static __attribute__((unused)) @@ -38,7 +38,7 @@ int setns(int fd, int nstype) static __attribute__((unused)) int sys_unshare(int flags) { - return my_syscall1(__NR_unshare, flags); + return __nolibc_syscall1(__NR_unshare, flags); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/stackprotector.h b/tools/include/nolibc/s= tackprotector.h index 7123aa056cb0..ae8b1d3a374d 100644 --- a/tools/include/nolibc/stackprotector.h +++ b/tools/include/nolibc/stackprotector.h @@ -24,9 +24,9 @@ __attribute__((weak,used,noreturn,section(".text.nolibc_s= tack_chk"))) void __stack_chk_fail(void) { pid_t pid; - my_syscall3(__NR_write, STDERR_FILENO, "!!Stack smashing detected!!\n", 2= 8); - pid =3D my_syscall0(__NR_getpid); - my_syscall2(__NR_kill, pid, SIGABRT); + __nolibc_syscall3(__NR_write, STDERR_FILENO, "!!Stack smashing detected!!= \n", 28); + pid =3D __nolibc_syscall0(__NR_getpid); + __nolibc_syscall2(__NR_kill, pid, SIGABRT); for (;;); } =20 @@ -42,7 +42,7 @@ uintptr_t __stack_chk_guard; =20 static __no_stack_protector void __stack_chk_init(void) { - my_syscall3(__NR_getrandom, &__stack_chk_guard, sizeof(__stack_chk_guard)= , 0); + __nolibc_syscall3(__NR_getrandom, &__stack_chk_guard, sizeof(__stack_chk_= guard), 0); /* a bit more randomness in case getrandom() fails, ensure the guard is n= ever 0 */ if (__stack_chk_guard !=3D (uintptr_t) &__stack_chk_guard) __stack_chk_guard ^=3D (uintptr_t) &__stack_chk_guard; diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 403ee9ce8389..bc1c76cb2f63 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -87,7 +87,7 @@ static __inline__ int __nolibc_enosys(const char *syscall= , ...) static __attribute__((unused)) void *sys_brk(void *addr) { - return (void *)my_syscall1(__NR_brk, addr); + return (void *)__nolibc_syscall1(__NR_brk, addr); } =20 static __attribute__((unused)) @@ -124,7 +124,7 @@ void *sbrk(intptr_t inc) static __attribute__((unused)) int sys_chdir(const char *path) { - return my_syscall1(__NR_chdir, path); + return __nolibc_syscall1(__NR_chdir, path); } =20 static __attribute__((unused)) @@ -136,7 +136,7 @@ int chdir(const char *path) static __attribute__((unused)) int sys_fchdir(int fildes) { - return my_syscall1(__NR_fchdir, fildes); + return __nolibc_syscall1(__NR_fchdir, fildes); } =20 static __attribute__((unused)) @@ -154,9 +154,9 @@ static __attribute__((unused)) int sys_chmod(const char *path, mode_t mode) { #if defined(__NR_fchmodat) - return my_syscall4(__NR_fchmodat, AT_FDCWD, path, mode, 0); + return __nolibc_syscall4(__NR_fchmodat, AT_FDCWD, path, mode, 0); #else - return my_syscall2(__NR_chmod, path, mode); + return __nolibc_syscall2(__NR_chmod, path, mode); #endif } =20 @@ -175,9 +175,9 @@ static __attribute__((unused)) int sys_chown(const char *path, uid_t owner, gid_t group) { #if defined(__NR_fchownat) - return my_syscall5(__NR_fchownat, AT_FDCWD, path, owner, group, 0); + return __nolibc_syscall5(__NR_fchownat, AT_FDCWD, path, owner, group, 0); #else - return my_syscall3(__NR_chown, path, owner, group); + return __nolibc_syscall3(__NR_chown, path, owner, group); #endif } =20 @@ -195,7 +195,7 @@ int chown(const char *path, uid_t owner, gid_t group) static __attribute__((unused)) int sys_chroot(const char *path) { - return my_syscall1(__NR_chroot, path); + return __nolibc_syscall1(__NR_chroot, path); } =20 static __attribute__((unused)) @@ -212,7 +212,7 @@ int chroot(const char *path) static __attribute__((unused)) int sys_close(int fd) { - return my_syscall1(__NR_close, fd); + return __nolibc_syscall1(__NR_close, fd); } =20 static __attribute__((unused)) @@ -229,7 +229,7 @@ int close(int fd) static __attribute__((unused)) int sys_dup(int fd) { - return my_syscall1(__NR_dup, fd); + return __nolibc_syscall1(__NR_dup, fd); } =20 static __attribute__((unused)) @@ -256,13 +256,13 @@ int sys_dup2(int old, int new) #endif =20 if (old =3D=3D new) { - ret =3D my_syscall2(nr_fcntl, old, F_GETFD); + ret =3D __nolibc_syscall2(nr_fcntl, old, F_GETFD); return ret < 0 ? ret : old; } =20 - return my_syscall3(__NR_dup3, old, new, 0); + return __nolibc_syscall3(__NR_dup3, old, new, 0); #else - return my_syscall2(__NR_dup2, old, new); + return __nolibc_syscall2(__NR_dup2, old, new); #endif } =20 @@ -281,7 +281,7 @@ int dup2(int old, int new) static __attribute__((unused)) int sys_dup3(int old, int new, int flags) { - return my_syscall3(__NR_dup3, old, new, flags); + return __nolibc_syscall3(__NR_dup3, old, new, flags); } =20 static __attribute__((unused)) @@ -299,7 +299,7 @@ int dup3(int old, int new, int flags) static __attribute__((unused)) int sys_execve(const char *filename, char *const argv[], char *const envp[= ]) { - return my_syscall3(__NR_execve, filename, argv, envp); + return __nolibc_syscall3(__NR_execve, filename, argv, envp); } =20 static __attribute__((unused)) @@ -316,7 +316,7 @@ int execve(const char *filename, char *const argv[], ch= ar *const envp[]) static __attribute__((noreturn,unused)) void sys_exit(int status) { - my_syscall1(__NR_exit, status & 255); + __nolibc_syscall1(__NR_exit, status & 255); while(1); /* shut the "noreturn" warnings. */ } =20 @@ -346,9 +346,9 @@ pid_t sys_fork(void) * have a different API, but most archs have the flags on first arg and * will not use the rest with no other flag. */ - return my_syscall5(__NR_clone, SIGCHLD, 0, 0, 0, 0); + return __nolibc_syscall5(__NR_clone, SIGCHLD, 0, 0, 0, 0); #else - return my_syscall0(__NR_fork); + return __nolibc_syscall0(__NR_fork); #endif } #endif @@ -365,9 +365,9 @@ pid_t sys_vfork(void) { #if defined(__NR_clone) /* See the note in sys_fork(). */ - return my_syscall5(__NR_clone, CLONE_VM | CLONE_VFORK | SIGCHLD, 0, 0, 0,= 0); + return __nolibc_syscall5(__NR_clone, CLONE_VM | CLONE_VFORK | SIGCHLD, 0,= 0, 0, 0); #elif defined(__NR_vfork) - return my_syscall0(__NR_vfork); + return __nolibc_syscall0(__NR_vfork); #endif } #endif @@ -385,7 +385,7 @@ pid_t vfork(void) static __attribute__((unused)) int sys_fsync(int fd) { - return my_syscall1(__NR_fsync, fd); + return __nolibc_syscall1(__NR_fsync, fd); } =20 static __attribute__((unused)) @@ -402,7 +402,7 @@ int fsync(int fd) static __attribute__((unused)) int sys_getdents64(int fd, struct linux_dirent64 *dirp, int count) { - return my_syscall3(__NR_getdents64, fd, dirp, count); + return __nolibc_syscall3(__NR_getdents64, fd, dirp, count); } =20 static __attribute__((unused)) @@ -420,9 +420,9 @@ static __attribute__((unused)) uid_t sys_geteuid(void) { #if defined(__NR_geteuid32) - return my_syscall0(__NR_geteuid32); + return __nolibc_syscall0(__NR_geteuid32); #else - return my_syscall0(__NR_geteuid); + return __nolibc_syscall0(__NR_geteuid); #endif } =20 @@ -440,7 +440,7 @@ uid_t geteuid(void) static __attribute__((unused)) pid_t sys_getpgid(pid_t pid) { - return my_syscall1(__NR_getpgid, pid); + return __nolibc_syscall1(__NR_getpgid, pid); } =20 static __attribute__((unused)) @@ -474,7 +474,7 @@ pid_t getpgrp(void) static __attribute__((unused)) pid_t sys_getpid(void) { - return my_syscall0(__NR_getpid); + return __nolibc_syscall0(__NR_getpid); } =20 static __attribute__((unused)) @@ -491,7 +491,7 @@ pid_t getpid(void) static __attribute__((unused)) pid_t sys_getppid(void) { - return my_syscall0(__NR_getppid); + return __nolibc_syscall0(__NR_getppid); } =20 static __attribute__((unused)) @@ -508,7 +508,7 @@ pid_t getppid(void) static __attribute__((unused)) pid_t sys_gettid(void) { - return my_syscall0(__NR_gettid); + return __nolibc_syscall0(__NR_gettid); } =20 static __attribute__((unused)) @@ -539,9 +539,9 @@ static __attribute__((unused)) uid_t sys_getuid(void) { #if defined(__NR_getuid32) - return my_syscall0(__NR_getuid32); + return __nolibc_syscall0(__NR_getuid32); #else - return my_syscall0(__NR_getuid); + return __nolibc_syscall0(__NR_getuid); #endif } =20 @@ -559,7 +559,7 @@ uid_t getuid(void) static __attribute__((unused)) int sys_kill(pid_t pid, int signal) { - return my_syscall2(__NR_kill, pid, signal); + return __nolibc_syscall2(__NR_kill, pid, signal); } =20 static __attribute__((unused)) @@ -577,9 +577,9 @@ static __attribute__((unused)) int sys_link(const char *old, const char *new) { #if defined(__NR_linkat) - return my_syscall5(__NR_linkat, AT_FDCWD, old, AT_FDCWD, new, 0); + return __nolibc_syscall5(__NR_linkat, AT_FDCWD, old, AT_FDCWD, new, 0); #else - return my_syscall2(__NR_link, old, new); + return __nolibc_syscall2(__NR_link, old, new); #endif } =20 @@ -602,7 +602,7 @@ off_t sys_lseek(int fd, off_t offset, int whence) off_t result; int ret; =20 - ret =3D my_syscall5(__NR_llseek, fd, offset >> 32, (uint32_t)offset, &lof= f, whence); + ret =3D __nolibc_syscall5(__NR_llseek, fd, offset >> 32, (uint32_t)offset= , &loff, whence); if (ret < 0) result =3D ret; else @@ -610,7 +610,7 @@ off_t sys_lseek(int fd, off_t offset, int whence) =20 return result; #else - return my_syscall3(__NR_lseek, fd, offset, whence); + return __nolibc_syscall3(__NR_lseek, fd, offset, whence); #endif } =20 @@ -629,9 +629,9 @@ static __attribute__((unused)) int sys_mkdir(const char *path, mode_t mode) { #if defined(__NR_mkdirat) - return my_syscall3(__NR_mkdirat, AT_FDCWD, path, mode); + return __nolibc_syscall3(__NR_mkdirat, AT_FDCWD, path, mode); #else - return my_syscall2(__NR_mkdir, path, mode); + return __nolibc_syscall2(__NR_mkdir, path, mode); #endif } =20 @@ -649,9 +649,9 @@ static __attribute__((unused)) int sys_rmdir(const char *path) { #if defined(__NR_rmdir) - return my_syscall1(__NR_rmdir, path); + return __nolibc_syscall1(__NR_rmdir, path); #else - return my_syscall3(__NR_unlinkat, AT_FDCWD, path, AT_REMOVEDIR); + return __nolibc_syscall3(__NR_unlinkat, AT_FDCWD, path, AT_REMOVEDIR); #endif } =20 @@ -670,9 +670,9 @@ static __attribute__((unused)) long sys_mknod(const char *path, mode_t mode, dev_t dev) { #if defined(__NR_mknodat) - return my_syscall4(__NR_mknodat, AT_FDCWD, path, mode, dev); + return __nolibc_syscall4(__NR_mknodat, AT_FDCWD, path, mode, dev); #else - return my_syscall3(__NR_mknod, path, mode, dev); + return __nolibc_syscall3(__NR_mknod, path, mode, dev); #endif } =20 @@ -691,7 +691,7 @@ int mknod(const char *path, mode_t mode, dev_t dev) static __attribute__((unused)) int sys_pipe2(int pipefd[2], int flags) { - return my_syscall2(__NR_pipe2, pipefd, flags); + return __nolibc_syscall2(__NR_pipe2, pipefd, flags); } =20 static __attribute__((unused)) @@ -714,7 +714,7 @@ int pipe(int pipefd[2]) static __attribute__((unused)) int sys_pivot_root(const char *new, const char *old) { - return my_syscall2(__NR_pivot_root, new, old); + return __nolibc_syscall2(__NR_pivot_root, new, old); } =20 static __attribute__((unused)) @@ -731,7 +731,7 @@ int pivot_root(const char *new, const char *old) static __attribute__((unused)) ssize_t sys_read(int fd, void *buf, size_t count) { - return my_syscall3(__NR_read, fd, buf, count); + return __nolibc_syscall3(__NR_read, fd, buf, count); } =20 static __attribute__((unused)) @@ -748,7 +748,7 @@ ssize_t read(int fd, void *buf, size_t count) static __attribute__((unused)) int sys_sched_yield(void) { - return my_syscall0(__NR_sched_yield); + return __nolibc_syscall0(__NR_sched_yield); } =20 static __attribute__((unused)) @@ -765,7 +765,7 @@ int sched_yield(void) static __attribute__((unused)) int sys_setpgid(pid_t pid, pid_t pgid) { - return my_syscall2(__NR_setpgid, pid, pgid); + return __nolibc_syscall2(__NR_setpgid, pid, pgid); } =20 static __attribute__((unused)) @@ -792,7 +792,7 @@ pid_t setpgrp(void) static __attribute__((unused)) pid_t sys_setsid(void) { - return my_syscall0(__NR_setsid); + return __nolibc_syscall0(__NR_setsid); } =20 static __attribute__((unused)) @@ -810,9 +810,9 @@ static __attribute__((unused)) int sys_symlink(const char *old, const char *new) { #if defined(__NR_symlinkat) - return my_syscall3(__NR_symlinkat, old, AT_FDCWD, new); + return __nolibc_syscall3(__NR_symlinkat, old, AT_FDCWD, new); #else - return my_syscall2(__NR_symlink, old, new); + return __nolibc_syscall2(__NR_symlink, old, new); #endif } =20 @@ -830,7 +830,7 @@ int symlink(const char *old, const char *new) static __attribute__((unused)) mode_t sys_umask(mode_t mode) { - return my_syscall1(__NR_umask, mode); + return __nolibc_syscall1(__NR_umask, mode); } =20 static __attribute__((unused)) @@ -847,7 +847,7 @@ mode_t umask(mode_t mode) static __attribute__((unused)) int sys_umount2(const char *path, int flags) { - return my_syscall2(__NR_umount2, path, flags); + return __nolibc_syscall2(__NR_umount2, path, flags); } =20 static __attribute__((unused)) @@ -865,9 +865,9 @@ static __attribute__((unused)) int sys_unlink(const char *path) { #if defined(__NR_unlinkat) - return my_syscall3(__NR_unlinkat, AT_FDCWD, path, 0); + return __nolibc_syscall3(__NR_unlinkat, AT_FDCWD, path, 0); #else - return my_syscall1(__NR_unlink, path); + return __nolibc_syscall1(__NR_unlink, path); #endif } =20 @@ -885,7 +885,7 @@ int unlink(const char *path) static __attribute__((unused)) ssize_t sys_write(int fd, const void *buf, size_t count) { - return my_syscall3(__NR_write, fd, buf, count); + return __nolibc_syscall3(__NR_write, fd, buf, count); } =20 static __attribute__((unused)) @@ -902,7 +902,7 @@ ssize_t write(int fd, const void *buf, size_t count) static __attribute__((unused)) int sys_memfd_create(const char *name, unsigned int flags) { - return my_syscall2(__NR_memfd_create, name, flags); + return __nolibc_syscall2(__NR_memfd_create, name, flags); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/ioctl.h b/tools/include/nolibc/sys/io= ctl.h index fc880687e02a..289cc1494f2c 100644 --- a/tools/include/nolibc/sys/ioctl.h +++ b/tools/include/nolibc/sys/ioctl.h @@ -21,7 +21,7 @@ static __attribute__((unused)) long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) { - return my_syscall3(__NR_ioctl, fd, cmd, arg); + return __nolibc_syscall3(__NR_ioctl, fd, cmd, arg); } =20 #define ioctl(fd, cmd, arg) __sysret(sys_ioctl(fd, cmd, (unsigned long)(ar= g))) diff --git a/tools/include/nolibc/sys/mman.h b/tools/include/nolibc/sys/mma= n.h index 77084ac3405a..5679fdda0a87 100644 --- a/tools/include/nolibc/sys/mman.h +++ b/tools/include/nolibc/sys/mman.h @@ -27,7 +27,7 @@ void *sys_mmap(void *addr, size_t length, int prot, int f= lags, int fd, n =3D __NR_mmap; #endif =20 - return (void *)my_syscall6(n, addr, length, prot, flags, fd, offset); + return (void *)__nolibc_syscall6(n, addr, length, prot, flags, fd, offset= ); } #endif =20 @@ -46,8 +46,8 @@ void *mmap(void *addr, size_t length, int prot, int flags= , int fd, off_t offset) static __attribute__((unused)) void *sys_mremap(void *old_address, size_t old_size, size_t new_size, int = flags, void *new_address) { - return (void *)my_syscall5(__NR_mremap, old_address, old_size, - new_size, flags, new_address); + return (void *)__nolibc_syscall5(__NR_mremap, old_address, old_size, + new_size, flags, new_address); } =20 static __attribute__((unused)) @@ -65,7 +65,7 @@ void *mremap(void *old_address, size_t old_size, size_t n= ew_size, int flags, voi static __attribute__((unused)) int sys_munmap(void *addr, size_t length) { - return my_syscall2(__NR_munmap, addr, length); + return __nolibc_syscall2(__NR_munmap, addr, length); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/mount.h b/tools/include/nolibc/sys/mo= unt.h index e39ec02ea24c..1f8d14da276f 100644 --- a/tools/include/nolibc/sys/mount.h +++ b/tools/include/nolibc/sys/mount.h @@ -23,7 +23,7 @@ static __attribute__((unused)) int sys_mount(const char *src, const char *tgt, const char *fst, unsigned long flags, const void *data) { - return my_syscall5(__NR_mount, src, tgt, fst, flags, data); + return __nolibc_syscall5(__NR_mount, src, tgt, fst, flags, data); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/prctl.h b/tools/include/nolibc/sys/pr= ctl.h index 0205907b6ac8..b019b4618328 100644 --- a/tools/include/nolibc/sys/prctl.h +++ b/tools/include/nolibc/sys/prctl.h @@ -23,7 +23,7 @@ static __attribute__((unused)) int sys_prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) { - return my_syscall5(__NR_prctl, option, arg2, arg3, arg4, arg5); + return __nolibc_syscall5(__NR_prctl, option, arg2, arg3, arg4, arg5); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/ptrace.h b/tools/include/nolibc/sys/p= trace.h index 72ca28541633..6cde77e93ceb 100644 --- a/tools/include/nolibc/sys/ptrace.h +++ b/tools/include/nolibc/sys/ptrace.h @@ -21,7 +21,7 @@ static __attribute__((unused)) long sys_ptrace(int op, pid_t pid, void *addr, void *data) { - return my_syscall4(__NR_ptrace, op, pid, addr, data); + return __nolibc_syscall4(__NR_ptrace, op, pid, addr, data); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/random.h b/tools/include/nolibc/sys/r= andom.h index cd5d25c571a8..af9a270fc29d 100644 --- a/tools/include/nolibc/sys/random.h +++ b/tools/include/nolibc/sys/random.h @@ -22,7 +22,7 @@ static __attribute__((unused)) ssize_t sys_getrandom(void *buf, size_t buflen, unsigned int flags) { - return my_syscall3(__NR_getrandom, buf, buflen, flags); + return __nolibc_syscall3(__NR_getrandom, buf, buflen, flags); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/reboot.h b/tools/include/nolibc/sys/r= eboot.h index 38274c64a722..20431025ccc6 100644 --- a/tools/include/nolibc/sys/reboot.h +++ b/tools/include/nolibc/sys/reboot.h @@ -22,7 +22,7 @@ static __attribute__((unused)) ssize_t sys_reboot(int magic1, int magic2, int cmd, void *arg) { - return my_syscall4(__NR_reboot, magic1, magic2, cmd, arg); + return __nolibc_syscall4(__NR_reboot, magic1, magic2, cmd, arg); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/resource.h b/tools/include/nolibc/sys= /resource.h index b990f914dc56..ff3c65f5fade 100644 --- a/tools/include/nolibc/sys/resource.h +++ b/tools/include/nolibc/sys/resource.h @@ -23,7 +23,7 @@ static __attribute__((unused)) int sys_prlimit64(pid_t pid, int resource, const struct rlimit64 *new_limit, struct rlimit64 *old_limit) { - return my_syscall4(__NR_prlimit64, pid, resource, new_limit, old_limit); + return __nolibc_syscall4(__NR_prlimit64, pid, resource, new_limit, old_li= mit); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/select.h b/tools/include/nolibc/sys/s= elect.h index 80cb3755ba18..fcbcf4d0f8d1 100644 --- a/tools/include/nolibc/sys/select.h +++ b/tools/include/nolibc/sys/select.h @@ -70,7 +70,8 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_s= et *efds, struct timeva t.tv_sec =3D timeout->tv_sec; t.tv_nsec =3D (uint32_t)timeout->tv_usec * 1000; } - return my_syscall6(__NR_pselect6_time64, nfds, rfds, wfds, efds, timeout = ? &t : NULL, NULL); + return __nolibc_syscall6(__NR_pselect6_time64, nfds, rfds, wfds, efds, + timeout ? &t : NULL, NULL); #else struct __kernel_old_timespec t; =20 @@ -78,7 +79,8 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_s= et *efds, struct timeva t.tv_sec =3D timeout->tv_sec; t.tv_nsec =3D (uint32_t)timeout->tv_usec * 1000; } - return my_syscall6(__NR_pselect6, nfds, rfds, wfds, efds, timeout ? &t : = NULL, NULL); + return __nolibc_syscall6(__NR_pselect6, nfds, rfds, wfds, efds, + timeout ? &t : NULL, NULL); #endif } =20 diff --git a/tools/include/nolibc/sys/stat.h b/tools/include/nolibc/sys/sta= t.h index 8b4d80e3ea03..2777217793db 100644 --- a/tools/include/nolibc/sys/stat.h +++ b/tools/include/nolibc/sys/stat.h @@ -26,7 +26,7 @@ static __attribute__((unused)) int sys_statx(int fd, const char *path, int flags, unsigned int mask, stru= ct statx *buf) { #ifdef __NR_statx - return my_syscall5(__NR_statx, fd, path, flags, mask, buf); + return __nolibc_syscall5(__NR_statx, fd, path, flags, mask, buf); #else return __nolibc_enosys(__func__, fd, path, flags, mask, buf); #endif diff --git a/tools/include/nolibc/sys/syscall.h b/tools/include/nolibc/sys/= syscall.h index 4bf97f1386a0..8cbcae4a32aa 100644 --- a/tools/include/nolibc/sys/syscall.h +++ b/tools/include/nolibc/sys/syscall.h @@ -12,7 +12,7 @@ =20 #define __syscall_narg(_0, _1, _2, _3, _4, _5, _6, N, ...) N #define _syscall_narg(...) __syscall_narg(__VA_ARGS__, 6, 5, 4, 3, 2, 1, 0) -#define _syscall(N, ...) __sysret(my_syscall##N(__VA_ARGS__)) +#define _syscall(N, ...) __sysret(__nolibc_syscall##N(__VA_ARGS__)) #define _syscall_n(N, ...) _syscall(N, __VA_ARGS__) #define syscall(...) _syscall_n(_syscall_narg(__VA_ARGS__), ##__VA_ARGS__) =20 diff --git a/tools/include/nolibc/sys/timerfd.h b/tools/include/nolibc/sys/= timerfd.h index 29fd92bd47d2..87f89c789b3b 100644 --- a/tools/include/nolibc/sys/timerfd.h +++ b/tools/include/nolibc/sys/timerfd.h @@ -19,7 +19,7 @@ static __attribute__((unused)) int sys_timerfd_create(int clockid, int flags) { - return my_syscall2(__NR_timerfd_create, clockid, flags); + return __nolibc_syscall2(__NR_timerfd_create, clockid, flags); } =20 static __attribute__((unused)) @@ -34,10 +34,10 @@ int sys_timerfd_gettime(int fd, struct itimerspec *curr= _value) { #if defined(__NR_timerfd_gettime64) __nolibc_assert_time64_type(curr_value->it_value.tv_sec); - return my_syscall2(__NR_timerfd_gettime64, fd, curr_value); + return __nolibc_syscall2(__NR_timerfd_gettime64, fd, curr_value); #else __nolibc_assert_native_time64(); - return my_syscall2(__NR_timerfd_gettime, fd, curr_value); + return __nolibc_syscall2(__NR_timerfd_gettime, fd, curr_value); #endif } =20 @@ -54,10 +54,10 @@ int sys_timerfd_settime(int fd, int flags, { #if defined(__NR_timerfd_settime64) __nolibc_assert_time64_type(new_value->it_value.tv_sec); - return my_syscall4(__NR_timerfd_settime64, fd, flags, new_value, old_valu= e); + return __nolibc_syscall4(__NR_timerfd_settime64, fd, flags, new_value, ol= d_value); #else __nolibc_assert_native_time64(); - return my_syscall4(__NR_timerfd_settime, fd, flags, new_value, old_value); + return __nolibc_syscall4(__NR_timerfd_settime, fd, flags, new_value, old_= value); #endif } =20 diff --git a/tools/include/nolibc/sys/uio.h b/tools/include/nolibc/sys/uio.h index 7ad42b927d2f..21ff8c626dfe 100644 --- a/tools/include/nolibc/sys/uio.h +++ b/tools/include/nolibc/sys/uio.h @@ -21,7 +21,7 @@ static __attribute__((unused)) ssize_t sys_readv(int fd, const struct iovec *iovec, int count) { - return my_syscall3(__NR_readv, fd, iovec, count); + return __nolibc_syscall3(__NR_readv, fd, iovec, count); } =20 static __attribute__((unused)) @@ -36,7 +36,7 @@ ssize_t readv(int fd, const struct iovec *iovec, int coun= t) static __attribute__((unused)) ssize_t sys_writev(int fd, const struct iovec *iovec, int count) { - return my_syscall3(__NR_writev, fd, iovec, count); + return __nolibc_syscall3(__NR_writev, fd, iovec, count); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/utsname.h b/tools/include/nolibc/sys/= utsname.h index 01023e1bb439..25992d644525 100644 --- a/tools/include/nolibc/sys/utsname.h +++ b/tools/include/nolibc/sys/utsname.h @@ -30,7 +30,7 @@ struct utsname { static __attribute__((unused)) int sys_uname(struct utsname *buf) { - return my_syscall1(__NR_uname, buf); + return __nolibc_syscall1(__NR_uname, buf); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/sys/wait.h b/tools/include/nolibc/sys/wai= t.h index 9d9319ba92cb..bc11100e7f82 100644 --- a/tools/include/nolibc/sys/wait.h +++ b/tools/include/nolibc/sys/wait.h @@ -23,7 +23,7 @@ static __attribute__((unused)) int sys_waitid(int which, pid_t pid, siginfo_t *infop, int options, struct= rusage *rusage) { - return my_syscall5(__NR_waitid, which, pid, infop, options, rusage); + return __nolibc_syscall5(__NR_waitid, which, pid, infop, options, rusage); } =20 static __attribute__((unused)) diff --git a/tools/include/nolibc/time.h b/tools/include/nolibc/time.h index f9257d6a7878..4d93d5188cec 100644 --- a/tools/include/nolibc/time.h +++ b/tools/include/nolibc/time.h @@ -37,10 +37,10 @@ int sys_clock_getres(clockid_t clockid, struct timespec= *res) { #if defined(__NR_clock_getres_time64) __nolibc_assert_time64_type(res->tv_sec); - return my_syscall2(__NR_clock_getres_time64, clockid, res); + return __nolibc_syscall2(__NR_clock_getres_time64, clockid, res); #else __nolibc_assert_native_time64(); - return my_syscall2(__NR_clock_getres, clockid, res); + return __nolibc_syscall2(__NR_clock_getres, clockid, res); #endif } =20 @@ -55,10 +55,10 @@ int sys_clock_gettime(clockid_t clockid, struct timespe= c *tp) { #if defined(__NR_clock_gettime64) __nolibc_assert_time64_type(tp->tv_sec); - return my_syscall2(__NR_clock_gettime64, clockid, tp); + return __nolibc_syscall2(__NR_clock_gettime64, clockid, tp); #else __nolibc_assert_native_time64(); - return my_syscall2(__NR_clock_gettime, clockid, tp); + return __nolibc_syscall2(__NR_clock_gettime, clockid, tp); #endif } =20 @@ -73,10 +73,10 @@ int sys_clock_settime(clockid_t clockid, struct timespe= c *tp) { #if defined(__NR_clock_settime64) __nolibc_assert_time64_type(tp->tv_sec); - return my_syscall2(__NR_clock_settime64, clockid, tp); + return __nolibc_syscall2(__NR_clock_settime64, clockid, tp); #else __nolibc_assert_native_time64(); - return my_syscall2(__NR_clock_settime, clockid, tp); + return __nolibc_syscall2(__NR_clock_settime, clockid, tp); #endif } =20 @@ -92,10 +92,10 @@ int sys_clock_nanosleep(clockid_t clockid, int flags, c= onst struct timespec *rqt { #if defined(__NR_clock_nanosleep_time64) __nolibc_assert_time64_type(rqtp->tv_sec); - return my_syscall4(__NR_clock_nanosleep_time64, clockid, flags, rqtp, rmt= p); + return __nolibc_syscall4(__NR_clock_nanosleep_time64, clockid, flags, rqt= p, rmtp); #else __nolibc_assert_native_time64(); - return my_syscall4(__NR_clock_nanosleep, clockid, flags, rqtp, rmtp); + return __nolibc_syscall4(__NR_clock_nanosleep, clockid, flags, rqtp, rmtp= ); #endif } =20 @@ -143,7 +143,7 @@ time_t time(time_t *tptr) static __attribute__((unused)) int sys_timer_create(clockid_t clockid, struct sigevent *evp, timer_t *tim= erid) { - return my_syscall3(__NR_timer_create, clockid, evp, timerid); + return __nolibc_syscall3(__NR_timer_create, clockid, evp, timerid); } =20 static __attribute__((unused)) @@ -155,7 +155,7 @@ int timer_create(clockid_t clockid, struct sigevent *ev= p, timer_t *timerid) static __attribute__((unused)) int sys_timer_delete(timer_t timerid) { - return my_syscall1(__NR_timer_delete, timerid); + return __nolibc_syscall1(__NR_timer_delete, timerid); } =20 static __attribute__((unused)) @@ -169,10 +169,10 @@ int sys_timer_gettime(timer_t timerid, struct itimers= pec *curr_value) { #if defined(__NR_timer_gettime64) __nolibc_assert_time64_type(curr_value->it_value.tv_sec); - return my_syscall2(__NR_timer_gettime64, timerid, curr_value); + return __nolibc_syscall2(__NR_timer_gettime64, timerid, curr_value); #else __nolibc_assert_native_time64(); - return my_syscall2(__NR_timer_gettime, timerid, curr_value); + return __nolibc_syscall2(__NR_timer_gettime, timerid, curr_value); #endif } =20 @@ -188,10 +188,10 @@ int sys_timer_settime(timer_t timerid, int flags, { #if defined(__NR_timer_settime64) __nolibc_assert_time64_type(new_value->it_value.tv_sec); - return my_syscall4(__NR_timer_settime64, timerid, flags, new_value, old_v= alue); + return __nolibc_syscall4(__NR_timer_settime64, timerid, flags, new_value,= old_value); #else __nolibc_assert_native_time64(); - return my_syscall4(__NR_timer_settime, timerid, flags, new_value, old_val= ue); + return __nolibc_syscall4(__NR_timer_settime, timerid, flags, new_value, o= ld_value); #endif } =20 diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h index bb5e80f3f05d..6456d60daa02 100644 --- a/tools/include/nolibc/unistd.h +++ b/tools/include/nolibc/unistd.h @@ -33,7 +33,7 @@ static __attribute__((unused)) int sys_faccessat(int fd, const char *path, int amode, int flag) { - return my_syscall4(__NR_faccessat, fd, path, amode, flag); + return __nolibc_syscall4(__NR_faccessat, fd, path, amode, flag); } =20 static __attribute__((unused)) --- base-commit: d9b60512cd0ed6e6984a7e00f31c1d1ffe813ec9 change-id: 20250821-nolibc-namespacing-96573dfbacaa Best regards, --=20 Thomas Wei=C3=9Fschuh