From nobody Mon Feb 9 00:24:04 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 45812269B07; Thu, 15 May 2025 19:58:21 +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=1747339105; cv=none; b=NRS7eXYiQMUVSSs+OM6+6zuSpRgkxEj9jmpoqUjW4bMt8qSkoxvdu6LcO6zi5QnKgBW5mLtL27UMDEZS9ho6YapKocWvaTnpjNGlNoeWNaxLV/+xPnRI1pdcTe6MUrlDBNDxSBmj9oNCxjYaGAzFk4hY/GcRdBGOTt3VsW7aU3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339105; c=relaxed/simple; bh=kSM1bMW0+DdV7v7mJM3vOo2rB0NxykmWPI2GBmXW580=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JpMgL+3S89Lbo6Qzgp1pVIgpeagGmfKwE6hvMEugn/gxJbQbfogVM+GtyvNk0o89FnIGtxssovskaxG8oQPW9f36YRspRPafM+rStNr/dyzJnNnB+o2yXRFUeJz9xdbD26qDEuHbxwo1QGjVInF8wJqpfYZ5kzvzGDLMBs++aMo= 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=JSV+bIcU; 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="JSV+bIcU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339092; bh=kSM1bMW0+DdV7v7mJM3vOo2rB0NxykmWPI2GBmXW580=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JSV+bIcUPO2ZGvCByrzetPHwmG2F0KwurIrITftorgw2nkuqrLaVmIRGmt7JdtZnP zXZBVXD4iIeZBTq998BMJE3Kq8EE2qAv2t5lVMQLsooOxr/Ylmmj1L0B7o3mVvt02a IzpHUnFCCYXeY6V3hovIrf2Fqx9/W3w9ZjwWYVjg= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:47 +0200 Subject: [PATCH 1/9] tools/nolibc: move ioctl() to sys/ioctl.h 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: <20250515-nolibc-sys-v1-1-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=2838; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=kSM1bMW0+DdV7v7mJM3vOo2rB0NxykmWPI2GBmXW580=; b=xdJfwjYCyN0LOEllnfA0IzlQCNpGMTh01WdmXuSRwrGbv2rIrDbF9EZji13+Z+v/wTo7cbqXQ X+yB9na3+5WBb4AixxJeHEEeg0Bs6E+ObS64cAXkcIKfwEGXwg00n1U X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This is the location regular userspace expects this definition. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/nolibc.h | 1 + tools/include/nolibc/sys.h | 12 ------------ tools/include/nolibc/sys/ioctl.h | 29 +++++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index 4c4b7b5ff605ac5dde11628331378489d76d4466..7d66847df91a94ca784c04ced27= 8eb6d7099bab4 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -49,6 +49,7 @@ all_files :=3D \ string.h \ sys.h \ sys/auxv.h \ + sys/ioctl.h \ sys/mman.h \ sys/random.h \ sys/stat.h \ diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 51c423a36b5957e2528e94d717d88e2383230cba..d6048d1e9ea5d4b5d504e156aaf= c5651dcd6b8c1 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -97,6 +97,7 @@ #include "types.h" #include "sys.h" #include "sys/auxv.h" +#include "sys/ioctl.h" #include "sys/mman.h" #include "sys/random.h" #include "sys/stat.h" diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 5733fe54911dca44c7423951ff85fb166d95c06f..313c210173c804f728b0be4ab8e= 67542bb3a7219 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -517,18 +517,6 @@ uid_t getuid(void) } =20 =20 -/* - * int ioctl(int fd, unsigned long cmd, ... arg); - */ - -static __attribute__((unused)) -long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - return my_syscall3(__NR_ioctl, fd, cmd, arg); -} - -#define ioctl(fd, cmd, arg) __sysret(sys_ioctl(fd, cmd, (unsigned long)(ar= g))) - /* * int kill(pid_t pid, int signal); */ diff --git a/tools/include/nolibc/sys/ioctl.h b/tools/include/nolibc/sys/io= ctl.h new file mode 100644 index 0000000000000000000000000000000000000000..cb34be92a5f96aa566afa53a0f1= 9932c2d5fe1eb --- /dev/null +++ b/tools/include/nolibc/sys/ioctl.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * Ioctl definitions for NOLIBC + * Copyright (C) 2017-2021 Willy Tarreau + */ + +/* make sure to include all global symbols */ +#include "nolibc.h" + +#ifndef _NOLIBC_SYS_IOCTL_H +#define _NOLIBC_SYS_IOCTL_H + +#include "../sys.h" + +#include + +/* + * int ioctl(int fd, unsigned long cmd, ... arg); + */ + +static __attribute__((unused)) +long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + return my_syscall3(__NR_ioctl, fd, cmd, arg); +} + +#define ioctl(fd, cmd, arg) __sysret(sys_ioctl(fd, cmd, (unsigned long)(ar= g))) + +#endif /* _NOLIBC_SYS_IOCTL_H */ --=20 2.49.0 From nobody Mon Feb 9 00:24:04 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 27FD01E480; Thu, 15 May 2025 19:58:20 +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=1747339103; cv=none; b=gImD4lzuXElw+WromB9Yfe25tUodzAYY/eOPwS7gwAlFa6KIrMugiPZTEio3BCthJOHvbljj6LSqAmb5DaPKmV9YI54FyMHV+FlzAYimNQIX+smvy6+B/KcDXibFHKHIb/HYZz1nhCJqONr40fz3uKG9j/dY6QJeFvDYGkrwKgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339103; c=relaxed/simple; bh=TvfFTWUEfp0HIUC1UiK0IdPOdFMzIQJdjD0UUr/+o0E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KTg11gh8NpbGoFBGYomH3vQgst2ytH+ajWu/F7ezeBPvf2Vn+U5599YjGIyWZNqZaJCzAOkDFc+kSnuPTAyaHB6PuiFiLhRT+pYLfELywl556lcuN331TRBm6jhUGbPRmf65n29hLzzPHerE7vzOfIAD4qMeD4mnwcz6iuc8Wa4= 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=onIOrrC/; 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="onIOrrC/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339092; bh=TvfFTWUEfp0HIUC1UiK0IdPOdFMzIQJdjD0UUr/+o0E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=onIOrrC/+PZ1lzbUoLwawy8U4RH/ZtuU/8dRKSoWIXcADDuulEl2wcEjKtUwJZ58A OQ4w8PzPRkUZIqmEOxP6Aph1pMFtoBqwmjgZ887ipTHWbH4wtPHFEi3I7p10WsGHIg zw4YVkf7Z7XQQprD82QR/dbZrLbx+DSHkstElIFg= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:48 +0200 Subject: [PATCH 2/9] tools/nolibc: move mount() to sys/mount.h 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: <20250515-nolibc-sys-v1-2-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=3542; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=TvfFTWUEfp0HIUC1UiK0IdPOdFMzIQJdjD0UUr/+o0E=; b=3/DdAFeh3tu/36+3/jAUkeF62jqtj70ad4s9nUWZmK/Uc1wpKjwUdm10kEnVnEN/OOD+FAhGG /sqeusOOkUDBl2wShHHSSINDHBnZdH0TaucQ+jK6TMgT0G7BUpMjaGl X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This is the location regular userspace expects this definition. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/nolibc.h | 1 + tools/include/nolibc/sys.h | 20 -------------------- tools/include/nolibc/sys/mount.h | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index 7d66847df91a94ca784c04ced278eb6d7099bab4..aa14dfddd77deb5442a6be65dee= 5684b6d218da7 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -51,6 +51,7 @@ all_files :=3D \ sys/auxv.h \ sys/ioctl.h \ sys/mman.h \ + sys/mount.h \ sys/random.h \ sys/stat.h \ sys/syscall.h \ diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index d6048d1e9ea5d4b5d504e156aafc5651dcd6b8c1..690368f8e46c33df37c824429cf= 89dd0e95bb806 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -99,6 +99,7 @@ #include "sys/auxv.h" #include "sys/ioctl.h" #include "sys/mman.h" +#include "sys/mount.h" #include "sys/random.h" #include "sys/stat.h" #include "sys/syscall.h" diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 313c210173c804f728b0be4ab8e67542bb3a7219..e66dd6e760557333353d98da262= 7b038dffe7f93 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -672,26 +672,6 @@ int mknod(const char *path, mode_t mode, dev_t dev) return __sysret(sys_mknod(path, mode, dev)); } =20 -/* - * int mount(const char *source, const char *target, - * const char *fstype, unsigned long flags, - * const void *data); - */ -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); -} - -static __attribute__((unused)) -int mount(const char *src, const char *tgt, - const char *fst, unsigned long flags, - const void *data) -{ - return __sysret(sys_mount(src, tgt, fst, flags, data)); -} - =20 /* * int pipe2(int pipefd[2], int flags); diff --git a/tools/include/nolibc/sys/mount.h b/tools/include/nolibc/sys/mo= unt.h new file mode 100644 index 0000000000000000000000000000000000000000..5129420e716d0a7e75c32a5bbc8= f4e9f0e21b03b --- /dev/null +++ b/tools/include/nolibc/sys/mount.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * Mount definitions for NOLIBC + * Copyright (C) 2017-2021 Willy Tarreau + */ + +/* make sure to include all global symbols */ +#include "nolibc.h" + +#ifndef _NOLIBC_SYS_MOUNT_H +#define _NOLIBC_SYS_MOUNT_H + +#include "../sys.h" + +#include + +/* + * int mount(const char *source, const char *target, + * const char *fstype, unsigned long flags, + * const void *data); + */ +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); +} + +static __attribute__((unused)) +int mount(const char *src, const char *tgt, + const char *fst, unsigned long flags, + const void *data) +{ + return __sysret(sys_mount(src, tgt, fst, flags, data)); +} + +#endif /* _NOLIBC_SYS_MOUNT_H */ --=20 2.49.0 From nobody Mon Feb 9 00:24:04 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 2802D22A7F8; Thu, 15 May 2025 19:58:20 +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=1747339103; cv=none; b=naKQYVbKqNC8Nrc8y0q+xuM3XtJgMX//xSCFVsRAwyHcpiss9MuKei+Zs6IGZRLv25LbMY03F/RMlMDHKp9I7NXZK/NPmZEn9NLljMdf+Bzos4wCG8xLuICbevkAey/nImHpNAEi6DMImTjjtpTBhBCnQ4IRsKQ3syH8Wjp9JO4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339103; c=relaxed/simple; bh=6ju7nF+tBZi6mC9sCNOtoJsGxPO0pmE/TqOSGXTWTzE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LAZ6iGGjMxuzpH7hl3rrX8tIxKwZcU/8iO18vHj8AoBVPly/m+jmYM9GqK5DdHdlUdvnavFHBMJr62GjM7OUnFG2I70HniOrj/Bq4S3/Da+CNEnT0Hb1wkJUrqDWafQrP/5lmm311nzXETQbXcxE+f323nwCLcp4i/YCgRZnKww= 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=seytGuxw; 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="seytGuxw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339092; bh=6ju7nF+tBZi6mC9sCNOtoJsGxPO0pmE/TqOSGXTWTzE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=seytGuxw3gxPAeBk5B9roGmljvZ1ZCl/q+zVz2Wqor0gMjb8Za18TErVdc+2Ntm6Z xGrKSlDzk6P+xobEXg5iNgeT/hbzIZ40mLOLpv9Dxs80++d/DFblRm0TRryYXmSxuu AhPw00RKP3p45kGteC9wy2BOP9XWTNUpflxSzkwM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:49 +0200 Subject: [PATCH 3/9] tools/nolibc: move prctl() to sys/prctl.h 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: <20250515-nolibc-sys-v1-3-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=3708; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=6ju7nF+tBZi6mC9sCNOtoJsGxPO0pmE/TqOSGXTWTzE=; b=DKoJcu6B05RRtO1W6ivagl4rdN0VPAmtvnTW35t+IJ4T2vzjmqQTPvXdmwMuNoAElwdPKlzVy 7tvKkoq1MX/DemTXpbIHsvrW0b4ACw+bz6HHyDcnyFEWIfA4egcMAIf X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This is the location regular userspace expects this definition. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/nolibc.h | 1 + tools/include/nolibc/sys.h | 21 --------------------- tools/include/nolibc/sys/prctl.h | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index aa14dfddd77deb5442a6be65dee5684b6d218da7..35cfbc84d499b0a57689bdfed95= a45023904d256 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -52,6 +52,7 @@ all_files :=3D \ sys/ioctl.h \ sys/mman.h \ sys/mount.h \ + sys/prctl.h \ sys/random.h \ sys/stat.h \ sys/syscall.h \ diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 690368f8e46c33df37c824429cf89dd0e95bb806..1c159e32a248d46fa4d36a2c35e= 92eb9da91e9f6 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -100,6 +100,7 @@ #include "sys/ioctl.h" #include "sys/mman.h" #include "sys/mount.h" +#include "sys/prctl.h" #include "sys/random.h" #include "sys/stat.h" #include "sys/syscall.h" diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index e66dd6e760557333353d98da2627b038dffe7f93..a17fe98968a29081661eaf23511= 1482a543f87ba 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -23,7 +23,6 @@ #include #include /* for O_* and AT_* */ #include /* for statx() */ -#include #include #include =20 @@ -697,26 +696,6 @@ int pipe(int pipefd[2]) } =20 =20 -/* - * int prctl(int option, unsigned long arg2, unsigned long arg3, - * unsigned long arg4, unsigned long arg5); - */ - -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); -} - -static __attribute__((unused)) -int prctl(int option, unsigned long arg2, unsigned long arg3, - unsigned long arg4, unsigned long arg5) -{ - return __sysret(sys_prctl(option, arg2, arg3, arg4, arg5)); -} - - /* * int pivot_root(const char *new, const char *old); */ diff --git a/tools/include/nolibc/sys/prctl.h b/tools/include/nolibc/sys/pr= ctl.h new file mode 100644 index 0000000000000000000000000000000000000000..778a6a868823ce496f0f5482a58= a31d69afd6d30 --- /dev/null +++ b/tools/include/nolibc/sys/prctl.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * Prctl definitions for NOLIBC + * Copyright (C) 2017-2021 Willy Tarreau + */ + +/* make sure to include all global symbols */ +#include "nolibc.h" + +#ifndef _NOLIBC_SYS_PRCTL_H +#define _NOLIBC_SYS_PRCTL_H + +#include "../sys.h" + +#include + +/* + * int prctl(int option, unsigned long arg2, unsigned long arg3, + * unsigned long arg4, unsigned long arg5); + */ + +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); +} + +static __attribute__((unused)) +int prctl(int option, unsigned long arg2, unsigned long arg3, + unsigned long arg4, unsigned long arg5) +{ + return __sysret(sys_prctl(option, arg2, arg3, arg4, arg5)); +} + +#endif /* _NOLIBC_SYS_PRCTL_H */ --=20 2.49.0 From nobody Mon Feb 9 00:24:04 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 2809825A646; Thu, 15 May 2025 19:58:20 +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=1747339104; cv=none; b=kpBfkENUyIaxX+dJzGtrvyU7akIvDOhGL92IzT7NIZmhPIur3Z0Rc52z1g8OE2ujiSSKLVxa+VSSxDcF2bXC2f5j4NrOJmCcBxvJRstL04sw+Ycf1qbJB8s8Stbfo+eAr6gRsPQ8ugvjaq33dEw5IcbzhHL2Ra09YQ0Ca8YD3+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339104; c=relaxed/simple; bh=Pg5hG2NXJIJ2AsojvxyH+DEumI/6ZQZsHN1YJrvIni4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YmKsga/GzL21hovK4gk/YXlaPpRkHfbboJKQ47zdopB/0RReYmhf49hDfPFrjSEShegu2SkrRYx8LHGUz9SX+xtkCdRJWBnZcqlAbXdQJtM2Yutm5wmpRevdh/TYkXwvr7oM91tcOA0aDK9AUcxCgJQkQJ6FQIV4/yPO8onJm9I= 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=Oete7QE9; 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="Oete7QE9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339092; bh=Pg5hG2NXJIJ2AsojvxyH+DEumI/6ZQZsHN1YJrvIni4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Oete7QE9FEy5ARoDlAAWYcFZ+QJWuJ3IO3NylIUU1Ff+JUNVWUFO1hYTw0uXoteYW rBYLiFPr/LZIud10uikynE7UtEMPHAzehHC1/jujNc5oNyYSGNg4kGQZX4qph/mnti Y6V1wPkoGbxNgwgeVaNIkIAU+eLlRhHmwdMdHyEA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:50 +0200 Subject: [PATCH 4/9] tools/nolibc: move reboot() to sys/reboot.h 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: <20250515-nolibc-sys-v1-4-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=3644; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=Pg5hG2NXJIJ2AsojvxyH+DEumI/6ZQZsHN1YJrvIni4=; b=TXd33KbCdsy+Zqu3NmNWddnRa1h3aM9OEjjUt42dUhnIxfEm+M4UhoPoO/m/Fs4rLG4aqsr3J GJT56Y8bS46AfNRjiQtZjGLW2IjERegD1KrQ+IHbZ+SH0LnR1vmw6zc X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This is the location regular userspace expects this definition. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/nolibc.h | 1 + tools/include/nolibc/sys.h | 18 ------------------ tools/include/nolibc/sys/reboot.h | 34 ++++++++++++++++++++++++++++++++++ tools/include/nolibc/types.h | 1 - 5 files changed, 36 insertions(+), 19 deletions(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index 35cfbc84d499b0a57689bdfed95a45023904d256..4850501b8d53be6b603ecbb04d6= f952cd5370cf0 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -54,6 +54,7 @@ all_files :=3D \ sys/mount.h \ sys/prctl.h \ sys/random.h \ + sys/reboot.h \ sys/stat.h \ sys/syscall.h \ sys/time.h \ diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 1c159e32a248d46fa4d36a2c35e92eb9da91e9f6..36ea7a02c7434cc006a7b12d413= add04a2f85565 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -102,6 +102,7 @@ #include "sys/mount.h" #include "sys/prctl.h" #include "sys/random.h" +#include "sys/reboot.h" #include "sys/stat.h" #include "sys/syscall.h" #include "sys/time.h" diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index a17fe98968a29081661eaf235111482a543f87ba..6c89dd0316dd0ebf03ebde6fa5c= 14273df6a0c62 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -730,24 +730,6 @@ ssize_t read(int fd, void *buf, size_t count) } =20 =20 -/* - * int reboot(int cmd); - * is among LINUX_REBOOT_CMD_* - */ - -static __attribute__((unused)) -ssize_t sys_reboot(int magic1, int magic2, int cmd, void *arg) -{ - return my_syscall4(__NR_reboot, magic1, magic2, cmd, arg); -} - -static __attribute__((unused)) -int reboot(int cmd) -{ - return __sysret(sys_reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd,= 0)); -} - - /* * int getrlimit(int resource, struct rlimit *rlim); * int setrlimit(int resource, const struct rlimit *rlim); diff --git a/tools/include/nolibc/sys/reboot.h b/tools/include/nolibc/sys/r= eboot.h new file mode 100644 index 0000000000000000000000000000000000000000..727363fbfd8a6f8994a0cf13829= b7347ced198bb --- /dev/null +++ b/tools/include/nolibc/sys/reboot.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * Reboot definitions for NOLIBC + * Copyright (C) 2017-2021 Willy Tarreau + */ + +/* make sure to include all global symbols */ +#include "nolibc.h" + +#ifndef _NOLIBC_SYS_REBOOT_H +#define _NOLIBC_SYS_REBOOT_H + +#include "../sys.h" + +#include + +/* + * int reboot(int cmd); + * is among LINUX_REBOOT_CMD_* + */ + +static __attribute__((unused)) +ssize_t sys_reboot(int magic1, int magic2, int cmd, void *arg) +{ + return my_syscall4(__NR_reboot, magic1, magic2, cmd, arg); +} + +static __attribute__((unused)) +int reboot(int cmd) +{ + return __sysret(sys_reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd,= 0)); +} + +#endif /* _NOLIBC_SYS_REBOOT_H */ diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 93da29fe7719c9f196fba38d1f3f31cad0fc02f1..74c7694b2d5e54f7a86854697ac= 32a2ea2b62e86 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -12,7 +12,6 @@ =20 #include "std.h" #include -#include /* for LINUX_REBOOT_* */ #include #include #include --=20 2.49.0 From nobody Mon Feb 9 00:24:04 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 8ECBB29B770; Thu, 15 May 2025 19:58:25 +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=1747339108; cv=none; b=dtAsz7daNvk641KdVUk/eJSbepusRbUEjk83h3Scbcy4qiu7emzKeC36TVVtZZGm3Ef/5xoJR8kMXbabs0Sdorx1uM3cZwK9nKJjnphtdIxpujkYtW5seCxCkD5iFtyTgIKoSeWEzhwQhJ/32f8wO5QHOyZpjiPEp5C2uq3bbv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339108; c=relaxed/simple; bh=Hx9XqnN1Ky1xnifC3f1mE3KSfmKRJqKgcc7ImwIV7lQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oBNsXsNwXX9DJjEhN4cupYo4CoGLaiSqHpIUbzpM4BnkOu75jVsuPKyWXCvT0ixlAcuvklyRbDp+uUC5iF7oNia0OQTi8m4KNThjs/OJjgoFwgDb5QEa6x0CTdKfw+9LE5IpHDJ4N8CNpaLf6F45Sieo/p0Ke56ybZxigBbmzwg= 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=XUjZbDsz; 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="XUjZbDsz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339094; bh=Hx9XqnN1Ky1xnifC3f1mE3KSfmKRJqKgcc7ImwIV7lQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=XUjZbDszCyK+gupu3DAzStjhd8f+wFojL4CdOCEUWMODoQ9YaGWksT19PPOaRUvQ+ QcGgP9NGkm4lyPcyo3cgNUlXWvnsxIRKUI1QM/pUEXc2Qo6Hd+tHwypXQq6r/3uMZd EybG514TlZU52ueKWwdIuOgShdFngCccoDiNDwfE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:51 +0200 Subject: [PATCH 5/9] tools/nolibc: move getrlimit() and friends to sys/resource.h 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: <20250515-nolibc-sys-v1-5-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=4891; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=Hx9XqnN1Ky1xnifC3f1mE3KSfmKRJqKgcc7ImwIV7lQ=; b=Q/rEXNf3m5peBPfud3+Idc+spcsnW4d0d2TDGQCL5DQGnaYKPoT5qUjF3T64ZgFUhgZoLKq9Z 16m6uxEJ/ouC/qIbS+p3wbjdcemc1Ki3OP3VsTCd6vDTrGL5iLxO6As X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This is the location regular userspace expects these definitions. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/nolibc.h | 1 + tools/include/nolibc/sys.h | 38 -------------------------- tools/include/nolibc/sys/resource.h | 53 +++++++++++++++++++++++++++++++++= ++++ tools/include/nolibc/types.h | 1 - 5 files changed, 55 insertions(+), 39 deletions(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index 4850501b8d53be6b603ecbb04d6f952cd5370cf0..cc82399e940e53940061b605885= 66db51f2e191a 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -55,6 +55,7 @@ all_files :=3D \ sys/prctl.h \ sys/random.h \ sys/reboot.h \ + sys/resource.h \ sys/stat.h \ sys/syscall.h \ sys/time.h \ diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 36ea7a02c7434cc006a7b12d413add04a2f85565..7d151776e47a30080dc3d961bcd= eacd6ab558629 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -103,6 +103,7 @@ #include "sys/prctl.h" #include "sys/random.h" #include "sys/reboot.h" +#include "sys/resource.h" #include "sys/stat.h" #include "sys/syscall.h" #include "sys/time.h" diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 6c89dd0316dd0ebf03ebde6fa5c14273df6a0c62..282909b1992d17d5292917fbabb= 0bd2a2dbfce88 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -23,7 +23,6 @@ #include #include /* for O_* and AT_* */ #include /* for statx() */ -#include #include =20 #include "errno.h" @@ -730,43 +729,6 @@ ssize_t read(int fd, void *buf, size_t count) } =20 =20 -/* - * int getrlimit(int resource, struct rlimit *rlim); - * int setrlimit(int resource, const struct rlimit *rlim); - */ - -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); -} - -static __attribute__((unused)) -int getrlimit(int resource, struct rlimit *rlim) -{ - struct rlimit64 rlim64; - int ret; - - ret =3D __sysret(sys_prlimit64(0, resource, NULL, &rlim64)); - rlim->rlim_cur =3D rlim64.rlim_cur; - rlim->rlim_max =3D rlim64.rlim_max; - - return ret; -} - -static __attribute__((unused)) -int setrlimit(int resource, const struct rlimit *rlim) -{ - struct rlimit64 rlim64 =3D { - .rlim_cur =3D rlim->rlim_cur, - .rlim_max =3D rlim->rlim_max, - }; - - return __sysret(sys_prlimit64(0, resource, &rlim64, NULL)); -} - - /* * int sched_yield(void); */ diff --git a/tools/include/nolibc/sys/resource.h b/tools/include/nolibc/sys= /resource.h new file mode 100644 index 0000000000000000000000000000000000000000..ac2705a67e8b3abacffa57f0970= 95b98afa1469c --- /dev/null +++ b/tools/include/nolibc/sys/resource.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * Resource definitions for NOLIBC + * Copyright (C) 2017-2021 Willy Tarreau + */ + +/* make sure to include all global symbols */ +#include "nolibc.h" + +#ifndef _NOLIBC_SYS_RESOURCE_H +#define _NOLIBC_SYS_RESOURCE_H + +#include "../sys.h" + +#include + +/* + * int getrlimit(int resource, struct rlimit *rlim); + * int setrlimit(int resource, const struct rlimit *rlim); + */ + +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); +} + +static __attribute__((unused)) +int getrlimit(int resource, struct rlimit *rlim) +{ + struct rlimit64 rlim64; + int ret; + + ret =3D __sysret(sys_prlimit64(0, resource, NULL, &rlim64)); + rlim->rlim_cur =3D rlim64.rlim_cur; + rlim->rlim_max =3D rlim64.rlim_max; + + return ret; +} + +static __attribute__((unused)) +int setrlimit(int resource, const struct rlimit *rlim) +{ + struct rlimit64 rlim64 =3D { + .rlim_cur =3D rlim->rlim_cur, + .rlim_max =3D rlim->rlim_max, + }; + + return __sysret(sys_prlimit64(0, resource, &rlim64, NULL)); +} + +#endif /* _NOLIBC_SYS_RESOURCE_H */ diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 74c7694b2d5e54f7a86854697ac32a2ea2b62e86..2225c9388a46480a18e9ce603b0= 8d846e5276bab 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -15,7 +15,6 @@ #include #include #include -#include =20 =20 /* Only the generic macros and types may be defined here. The arch-specific --=20 2.49.0 From nobody Mon Feb 9 00:24:04 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 7E23429B79B; Thu, 15 May 2025 19:58:26 +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=1747339108; cv=none; b=lYM4Vn2P3/fDJYxWEgLlrT9Dnuf83Vtb19YZy39EwwQ8CRW0vJoRxv/EuQUrMjJ/3uHN1uz3YrXs9cDcANM+mpW1O6zNhYEndTlPfk0ZaNspZSv41NasJwTfXyQPrPKl1duBO1vZ00N+EQz86lC/Df7CwSW2hFsmzHcP6LCiUP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339108; c=relaxed/simple; bh=CEjTUvBGsnd69Gkp4Kcg41wqhm8jvAm1b9FkzCvqtDU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tPXAUKRA0imz2i8h301T4B3MVMXKqQxW349HXu2XuZ9GZxk3lYkCWsdd+Kv4gixd25zRfRoB2dgH0bM9a57vgASJVRsrVg4lcNh3sCte21WlzzR47HL6+meocbccJbInCb6Tiq0faXKrDKXAQ6lyfCvouYmrLPqW81/NZEICDXg= 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=uT7Yn/JH; 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="uT7Yn/JH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339094; bh=CEjTUvBGsnd69Gkp4Kcg41wqhm8jvAm1b9FkzCvqtDU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uT7Yn/JHVpJOQTD9dj7EN5XnGoXwXqhmNRvJUUQq0K5ZNNLJMzGT3NPoedHqaaC0D FL4Jjvu76p9qhG3uApaVsEXEBoYgzM+XxsbCZsEhwSIqTFI5e90xODgF3okFCDAg4f kEK85uwl85hdObNm/YgUv5YpWfeaqPAYqwqvq4Io= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:52 +0200 Subject: [PATCH 6/9] tools/nolibc: move makedev() and friends to sys/sysmacros.h 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: <20250515-nolibc-sys-v1-6-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=2913; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=CEjTUvBGsnd69Gkp4Kcg41wqhm8jvAm1b9FkzCvqtDU=; b=tLPjHehGTm0gr5f1D8hEuXArffa0vPCMgKHd0jfciSsFm3GwJESOOCMXYbIisD9hNj9RcAjIy UOV712DOT5ICiq0JTFIiMfldNmSNhSp2wRNuCtn8oAGNqS6OgjUi1mK X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This is the location regular userspace expects these definitions. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/nolibc.h | 1 + tools/include/nolibc/sys/sysmacros.h | 20 ++++++++++++++++++++ tools/include/nolibc/types.h | 5 ----- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index cc82399e940e53940061b60588566db51f2e191a..ae04de46cdfeb2080d95b60c3d1= 6e1c9f3692c9c 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -58,6 +58,7 @@ all_files :=3D \ sys/resource.h \ sys/stat.h \ sys/syscall.h \ + sys/sysmacros.h \ sys/time.h \ sys/timerfd.h \ sys/types.h \ diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 7d151776e47a30080dc3d961bcdeacd6ab558629..182dcfce126638db1cc9fd3fa79= ab99835b42c26 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -106,6 +106,7 @@ #include "sys/resource.h" #include "sys/stat.h" #include "sys/syscall.h" +#include "sys/sysmacros.h" #include "sys/time.h" #include "sys/timerfd.h" #include "sys/wait.h" diff --git a/tools/include/nolibc/sys/sysmacros.h b/tools/include/nolibc/sy= s/sysmacros.h new file mode 100644 index 0000000000000000000000000000000000000000..e7e24dda1dbb51df92307def00f= 3670459b2409c --- /dev/null +++ b/tools/include/nolibc/sys/sysmacros.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * Sysmacro definitions for NOLIBC + * Copyright (C) 2017-2021 Willy Tarreau + */ + +/* make sure to include all global symbols */ +#include "nolibc.h" + +#ifndef _NOLIBC_SYS_SYSMACROS_H +#define _NOLIBC_SYS_SYSMACROS_H + +#include "../std.h" + +/* WARNING, it only deals with the 4096 first majors and 256 first minors = */ +#define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor)= & 0xff))) +#define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff)) +#define minor(dev) ((unsigned int)((dev) & 0xff)) + +#endif /* _NOLIBC_SYS_SYSMACROS_H */ diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 2225c9388a46480a18e9ce603b08d846e5276bab..0071bfbc23154cf9b47b0bd7471= 01fea4955018d 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -188,11 +188,6 @@ struct stat { typedef __kernel_clockid_t clockid_t; typedef int timer_t; =20 -/* WARNING, it only deals with the 4096 first majors and 256 first minors = */ -#define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor)= & 0xff))) -#define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff)) -#define minor(dev) ((unsigned int)((dev) & 0xff)) - #ifndef offsetof #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) #endif --=20 2.49.0 From nobody Mon Feb 9 00:24:04 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 8ED2029B771; Thu, 15 May 2025 19:58:25 +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=1747339107; cv=none; b=jGdQqbqOntMX+sgUy305mOMfkHYsgTYgJNCks8G5PxY8VyGzX3M3RhkgqoPgkUyTgb73tnySShm3tY/daoRscHKXpz4aXcrVh9upfPlT6ac1k3DtnLDar6Dcm87Gt/QID4styszpIYZe7/vYeYj1V9QsOOo/+s5fWt7QSNAGRnc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339107; c=relaxed/simple; bh=0DlqLIWaNZFpmu78FucI89rY5fHoKKK4yBF1UQkOheo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aXeMWoE70EYLQjS65AGPrPYxec66JbrF1GgzjY+4I98fnXHBAyqSZ/qys2B+wQk7xbeTgWfQaT0rvg5jjl7ZPBtkzBxrT4LXD4Lyn4NJw/n6hscieevJfWKF1FGoB/MyqrhCQyycLrNcZ/a8i2qvcXB99UCbzZEb8oRpR//v7zE= 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=DUwMUHyM; 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="DUwMUHyM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339094; bh=0DlqLIWaNZFpmu78FucI89rY5fHoKKK4yBF1UQkOheo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DUwMUHyMQ1VqtzBPwYQ5OUMWKYdS964RyInylMLwtwLSX8Oq5dWoLLmD3ENPGGqGP rz3J5RURhLDTbK5s4s1H3ZC5jfeF/bM1fPwqgaSkW0f4BHp+WwMK/ohe270QW4Yl/R z0LuwD+AWxADnrIe7XafdLXZjwSBQBiDDkN7pTWY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:53 +0200 Subject: [PATCH 7/9] tools/nolibc: move uname() and friends to sys/utsname.h 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: <20250515-nolibc-sys-v1-7-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=3394; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=0DlqLIWaNZFpmu78FucI89rY5fHoKKK4yBF1UQkOheo=; b=/PBUSVE95jOqgccQhI1vDHW+C3v3VwYTppDHIjIPiz37KeqvFUgWnPoar034skO05NS85WZea 7mwcaF/UiufAXXXK+Rod1hUWTf7Lm8W1crywgXx5s97uobOA2dMycWX X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This is the location regular userspace expects these definitions. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/nolibc.h | 1 + tools/include/nolibc/sys.h | 27 ------------------------ tools/include/nolibc/sys/utsname.h | 42 ++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 44 insertions(+), 27 deletions(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index ae04de46cdfeb2080d95b60c3d16e1c9f3692c9c..0ff06374577df457b0611d91dcf= e637a05476364 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -62,6 +62,7 @@ all_files :=3D \ sys/time.h \ sys/timerfd.h \ sys/types.h \ + sys/utsname.h \ sys/wait.h \ time.h \ types.h \ diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 182dcfce126638db1cc9fd3fa79ab99835b42c26..c199ade200c240ef4081f767a16= 2698256f39677 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -109,6 +109,7 @@ #include "sys/sysmacros.h" #include "sys/time.h" #include "sys/timerfd.h" +#include "sys/utsname.h" #include "sys/wait.h" #include "ctype.h" #include "elf.h" diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 282909b1992d17d5292917fbabb0bd2a2dbfce88..9556c69a6ae1ff0f19d884f5022= 599fc31e04f1f 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -23,7 +23,6 @@ #include #include /* for O_* and AT_* */ #include /* for statx() */ -#include =20 #include "errno.h" #include "stdarg.h" @@ -894,32 +893,6 @@ int umount2(const char *path, int flags) } =20 =20 -/* - * int uname(struct utsname *buf); - */ - -struct utsname { - char sysname[65]; - char nodename[65]; - char release[65]; - char version[65]; - char machine[65]; - char domainname[65]; -}; - -static __attribute__((unused)) -int sys_uname(struct utsname *buf) -{ - return my_syscall1(__NR_uname, buf); -} - -static __attribute__((unused)) -int uname(struct utsname *buf) -{ - return __sysret(sys_uname(buf)); -} - - /* * int unlink(const char *path); */ diff --git a/tools/include/nolibc/sys/utsname.h b/tools/include/nolibc/sys/= utsname.h new file mode 100644 index 0000000000000000000000000000000000000000..3adda115085069403253c2a276d= e1e2ae9bb1ad3 --- /dev/null +++ b/tools/include/nolibc/sys/utsname.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * Utsname definitions for NOLIBC + * Copyright (C) 2017-2021 Willy Tarreau + */ + +/* make sure to include all global symbols */ +#include "nolibc.h" + +#ifndef _NOLIBC_SYS_UTSNAME_H +#define _NOLIBC_SYS_UTSNAME_H + +#include "../sys.h" + +#include + +/* + * int uname(struct utsname *buf); + */ + +struct utsname { + char sysname[65]; + char nodename[65]; + char release[65]; + char version[65]; + char machine[65]; + char domainname[65]; +}; + +static __attribute__((unused)) +int sys_uname(struct utsname *buf) +{ + return my_syscall1(__NR_uname, buf); +} + +static __attribute__((unused)) +int uname(struct utsname *buf) +{ + return __sysret(sys_uname(buf)); +} + +#endif /* _NOLIBC_SYS_UTSNAME_H */ --=20 2.49.0 From nobody Mon Feb 9 00:24:04 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 8EC4D29B76F; Thu, 15 May 2025 19:58:25 +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=1747339107; cv=none; b=hBlmj7RkUJoRbyYwZqsDyJDHLgtrjkzaOXECmv3fXv5q+9FzoOoxTRaNc736n/+N6e3rpYmbjBLX8WdWJ83Xf9zB3CDT2o6UiL4z2LcOSdLjh5ZG9Bx+0o2pKkK8v7bLlJ42UCAmmM90IKIUlc7gF2znW9l8a35DjkCnuEsKD/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339107; c=relaxed/simple; bh=0mUa7QIK52LFZ5X4Py+boeWdALPA3eeNNCjqgmKvvE0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pXOtaYalHRxWmJtSgtVtYDmRIvUdBkJi5N/6E65OAq22fwxQdCKWk2BUhtClrEnLgjcDaVmW3cM+GRWw6T4JE1e+xApoIZ+vX0mh++nAW4qisWiyGxSLIXOt/tJF9Vj10tI8H91VpQrxHiU7zybYitPbUE9OI9kDpfPHIOf9XA0= 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=rH2X/+Az; 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="rH2X/+Az" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339094; bh=0mUa7QIK52LFZ5X4Py+boeWdALPA3eeNNCjqgmKvvE0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rH2X/+Az5uUP7XoRLT8SXA54BpMrre2+Detrzbnc2uWAQ8u6+wnTOdrTWMlWY5zuD +gVKPoc5KoEB3oL8FiiRCUrUH1gYwkCgczfBR3/ECfRoBJvGWDQAmnaZRgAknXVUaV nSZNzPZUWM/e/kYCAmfnYVqzWDCGD0dg2RuGjvXA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:54 +0200 Subject: [PATCH 8/9] tools/nolibc: move NULL and offsetof() to sys/stddef.h 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: <20250515-nolibc-sys-v1-8-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=2694; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=0mUa7QIK52LFZ5X4Py+boeWdALPA3eeNNCjqgmKvvE0=; b=aUalZNrMbnWgHJrEn8oTpfJ68qOXis1S1o0rQvrjZrrFqVyYaJtwi8yRxUN/hXtejpJ4n1mQc y7o6s4xMsFtCzMIOXJ4W0J5GPlaIV5UGUNmW/kR8cPqWEcu2zWC3Qri X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This is the location regular userspace expects these definitions. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/std.h | 6 +----- tools/include/nolibc/stddef.h | 24 ++++++++++++++++++++++++ tools/include/nolibc/types.h | 4 ---- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index 0ff06374577df457b0611d91dcfe637a05476364..c4615bed731ced75a00867fdeb4= 55d72652a7e42 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -44,6 +44,7 @@ all_files :=3D \ std.h \ stdarg.h \ stdbool.h \ + stddef.h \ stdint.h \ stdlib.h \ string.h \ diff --git a/tools/include/nolibc/std.h b/tools/include/nolibc/std.h index 933bc0be7e1c6be3b7909efc127f1d3b9c611135..adda7333d12e7d2c336938ede1a= af215b4b93165 100644 --- a/tools/include/nolibc/std.h +++ b/tools/include/nolibc/std.h @@ -13,12 +13,8 @@ * syscall-specific stuff, as this file is expected to be included very ea= rly. */ =20 -/* note: may already be defined */ -#ifndef NULL -#define NULL ((void *)0) -#endif - #include "stdint.h" +#include "stddef.h" =20 /* those are commonly provided by sys/types.h */ typedef unsigned int dev_t; diff --git a/tools/include/nolibc/stddef.h b/tools/include/nolibc/stddef.h new file mode 100644 index 0000000000000000000000000000000000000000..ecbd13eab1f5190fd0e90a07699= c2f06dbde8916 --- /dev/null +++ b/tools/include/nolibc/stddef.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * Stddef definitions for NOLIBC + * Copyright (C) 2017-2021 Willy Tarreau + */ + +/* make sure to include all global symbols */ +#include "nolibc.h" + +#ifndef _NOLIBC_STDDEF_H +#define _NOLIBC_STDDEF_H + +#include "stdint.h" + +/* note: may already be defined */ +#ifndef NULL +#define NULL ((void *)0) +#endif + +#ifndef offsetof +#define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) +#endif + +#endif /* _NOLIBC_STDDEF_H */ diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 0071bfbc23154cf9b47b0bd747101fea4955018d..30904be544ed01b212042ebc0f4= dab610f64b216 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -188,10 +188,6 @@ struct stat { typedef __kernel_clockid_t clockid_t; typedef int timer_t; =20 -#ifndef offsetof -#define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) -#endif - #ifndef container_of #define container_of(PTR, TYPE, FIELD) ({ \ __typeof__(((TYPE *)0)->FIELD) *__FIELD_PTR =3D (PTR); \ --=20 2.49.0 From nobody Mon Feb 9 00:24:04 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 8EDAB29B772; Thu, 15 May 2025 19:58:25 +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=1747339107; cv=none; b=n8ima8LKbc+sUskWdd6iY2XdcNtmF7Mq45TuwFWQsmkxUzQ2m3oCerw64gpo2kyLqfpD4Dzko7+M1Dp24XTO1icK+4qY5s4MVPO3BUYQ5mkZN7L1XJgET58VwZ8QhXhK31EYhaCacCbePlByPGnfzmHZohZdHAqqzIkF3IvD2S4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747339107; c=relaxed/simple; bh=KfGk8Rm9Bva09mPYGVIxj6/MXGN0IuCeh7vn1dPO4Ek=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Dzpd49Mw8Aal0WFg0qZz8pXDtCY+X74RZGZ6BuRLs+Upw+EezcRe7qW1xb9BtRX2LQQvdzHtH17VR3aveVOY6mSCI2nw07OC9g2J3TTpaPFFYGPReW1xyIeY7ifbWV+KujVxNzNLgB49/juPmJZr9s2PgocNdsCAaEDmc2g0v6Q= 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=GIuOmgQ6; 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="GIuOmgQ6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1747339094; bh=KfGk8Rm9Bva09mPYGVIxj6/MXGN0IuCeh7vn1dPO4Ek=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GIuOmgQ6jHcHq2keKFMv2//7sFWE4ByeDkGjvwuqxE+nxNPn5QDOQbpoUFjYWSCrN h8LrE9YJ2s2Sj5NPytbGOPSOfFJfdg4/H8DiZZT6X2VfLGPKs/BRjJdVJgEQYNCOF0 cZoy0gJsn4eJY++kwxQT6val4tj1/H4LI5axjo4U= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 15 May 2025 21:57:55 +0200 Subject: [PATCH 9/9] selftests/nolibc: drop include guards around standard headers 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: <20250515-nolibc-sys-v1-9-74f82eea3b59@weissschuh.net> References: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> In-Reply-To: <20250515-nolibc-sys-v1-0-74f82eea3b59@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747339091; l=1110; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=KfGk8Rm9Bva09mPYGVIxj6/MXGN0IuCeh7vn1dPO4Ek=; b=oydlvGkP4MN2UtdJcpZdE0AfFI8UId+JF33/0A37+gWEpZ2VpfmC0BK8wtzgsENyfeMDHgOyv EnomZLXfiUBD7Xss+xGM6Pv70AmwXU5wyLl3tO/zxg1hEBK+BX8UZgk X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Nolibc now provides all the headers required by nolibc-test.c. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/s= elftests/nolibc/nolibc-test.c index 0391c7d01380ea2f20d1d07497ea1964bcb6a9f4..dbe13000fb1ac153e9a89f62749= 2daeb584a05d4 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -9,12 +9,9 @@ * $(CC) -nostdlib -I/path/to/nolibc/sysroot =3D> _NOLIBC_* guards are = present * $(CC) with default libc =3D> NOLIBC* never defined */ -#ifndef NOLIBC #include #include #include -#ifndef _NOLIBC_STDIO_H -/* standard libcs need more includes */ #include #include #include @@ -43,8 +40,6 @@ #include #include #include -#endif -#endif =20 #pragma GCC diagnostic ignored "-Wmissing-prototypes" =20 --=20 2.49.0