aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-04-11 11:00:42 +0200
committerThomas Weißschuh <linux@weissschuh.net>2025-04-22 10:56:26 +0200
commit9b070d97d9e52195c3a2ee084fdd7c45b6b35adf (patch)
treed29ebcc088af8be1cd05ac70f1d4fd2a53d33d41 /tools/include
parenttools/nolibc: use ppoll_time64 if available (diff)
downloadlinux-9b070d97d9e52195c3a2ee084fdd7c45b6b35adf.tar.gz
linux-9b070d97d9e52195c3a2ee084fdd7c45b6b35adf.zip
tools/nolibc: add tolower() and toupper()
The kselftest harness uses these functions. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/nolibc/string.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/include/nolibc/string.h b/tools/include/nolibc/string.h
index ba84ab700e30..f0d335f0e467 100644
--- a/tools/include/nolibc/string.h
+++ b/tools/include/nolibc/string.h
@@ -289,6 +289,23 @@ char *strrchr(const char *s, int c)
return (char *)ret;
}
+static __attribute__((unused))
+int tolower(int c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return c - 'A' + 'a';
+ return c;
+}
+
+static __attribute__((unused))
+int toupper(int c)
+{
+ if (c >= 'a' && c <= 'z')
+ return c - 'a' + 'A';
+ return c;
+}
+
+
/* make sure to include all global symbols */
#include "nolibc.h"