[COMMIT osv master] libc: replace __strndup.c by adding entry to aliases.ld

3 views
Skip to first unread message

Commit Bot

unread,
Aug 14, 2020, 1:30:28 AM8/14/20
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

libc: replace __strndup.c by adding entry to aliases.ld

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1592,7 +1592,6 @@ libc += string/__strncat_chk.o
musl += string/strncmp.o
musl += string/strncpy.o
libc += string/__strncpy_chk.o
-libc += string/__strndup.o
musl += string/strndup.o
musl += string/strnlen.o
musl += string/strpbrk.o
diff --git a/libc/aliases.ld b/libc/aliases.ld
--- a/libc/aliases.ld
+++ b/libc/aliases.ld
@@ -29,3 +29,4 @@ __mbrlen = mbrlen;

/* string */
__strtok_r = strtok_r;
+__strndup = strndup;
diff --git a/libc/string/__strndup.c b/libc/string/__strndup.c
--- a/libc/string/__strndup.c
+++ b/libc/string/__strndup.c
@@ -1,8 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "libc.h"
-
-char *__strndup(const char *s, size_t n)
-{
- return strndup(s, n);
-}
Reply all
Reply to author
Forward
0 new messages