Skip to contentSkip to conversation

nolibc changes for Linux 6.10-rc1

GIT PULL Merged Shuah Khan 2 participants 2 messages May 13, 2024 – May 14, 2024

Subsystems (2)
lore
Share & tools
lore

Shuah Khan

author maintainer
#0 lore raw

Hi Linus,

Please pull the nolibc update for Linux 6.10-rc1.

This nolibc update for Linux 6.10-rc1

- adds support for uname(2)
- removes open-coded strnlen()
- exports strlen()
- adds tests for strlcat() and strlcpy()
- fixes memory error in realloc()
- fixes strlcat() return code and size usage
- fixes strlcpy() return code and size usage

diff is attached.

thanks,
-- Shuah

----------------------------------------------------------------
The following changes since commit 4cece764965020c22cff7665b18a012006359095:

Linux 6.9-rc1 (2024-03-24 14:10:05 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-nolibc-6.10-rc1

for you to fetch changes up to 0adab2b6b7336fb6ee3c6456a432dad3b1d25647:

tools/nolibc: add support for uname(2) (2024-04-14 20:28:54 +0200)

----------------------------------------------------------------
linux_kselftest-nolibc-6.10-rc1

This nolibc update for Linux 6.10-rc1

- adds support for uname(2)
- removes open-coded strnlen()
- exports strlen()
- adds tests for strlcat() and strlcpy()
- fixes memory error in realloc()
- fixes strlcat() return code and size usage
- fixes strlcpy() return code and size usage

----------------------------------------------------------------
Brennan Xavier McManus (1):
tools/nolibc/stdlib: fix memory error in realloc()

Rodrigo Campos (4):
tools/nolibc/string: export strlen() tools/nolibc: Fix strlcat() return code and size usage tools/nolibc: Fix strlcpy() return code and size usage selftests/nolibc: Add tests for strlcat() and strlcpy()

Thomas Weißschuh (2):
tools/nolibc/string: remove open-coded strnlen() tools/nolibc: add support for uname(2)

 tools/include/nolibc/stdlib.h                |  2 +-
 tools/include/nolibc/string.h                | 46 +++++++++-------
 tools/include/nolibc/sys.h                   | 27 +++++++++
 tools/testing/selftests/nolibc/nolibc-test.c | 82 ++++++++++++++++++++++++++++
 4 files changed, 136 insertions(+), 21 deletions(-)

----------------------------------------------------------------

tools/include/nolibc/stdlib.h +1 -1
index bacfd35c5156..5be9d3c7435a 100644
@@ -185,7 +185,7 @@ void *realloc(void *old_ptr, size_t new_size)
 	if (__builtin_expect(!ret, 0))
 		return NULL;
 
-	memcpy(ret, heap->user_p, heap->len);
+	memcpy(ret, heap->user_p, user_p_len);
 	munmap(heap, heap->len);
 	return ret;
 }
tools/include/nolibc/string.h +26 -20

71 lines not on this page · raw message

tools/include/nolibc/sys.h +27 -0
index dda9dffd1d74..7b82bc3cf107 100644
@@ -22,6 +22,7 @@
 #include <linux/stat.h>  /* for statx() */
 #include <linux/prctl.h>
 #include <linux/resource.h>
+#include <linux/utsname.h>
 
 #include "arch.h"
 #include "errno.h"
@@ -1139,6 +1140,32 @@ int umount2(const char *path, int flags)
 }
 
 
+/*
+ * 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);
  */
tools/testing/selftests/nolibc/nolibc-test.c +82 -0

118 lines not on this page · raw message

merge bot Merged
#1 lore raw
The pull request you sent on Mon, 13 May 2024 09:13:47 -0600:

The pull request you sent on Mon, 13 May 2024 09:13:47 -0600:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-nolibc-6.10-rc1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/4b768bf062db22e042a731e4c385bb0b4fa21a0e

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html