]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: morello: string: dummy c strcpy and stpcpy
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 26 Apr 2022 07:11:57 +0000 (08:11 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 5 Aug 2022 18:45:19 +0000 (19:45 +0100)
sysdeps/aarch64/morello/stpcpy.c [new file with mode: 0644]
sysdeps/aarch64/morello/strcpy.c [new file with mode: 0644]

diff --git a/sysdeps/aarch64/morello/stpcpy.c b/sysdeps/aarch64/morello/stpcpy.c
new file mode 100644 (file)
index 0000000..080f2fa
--- /dev/null
@@ -0,0 +1,34 @@
+/* Simple stpcpy.
+
+   Copyright (C) 2022 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, see <https://www.gnu.org/licenses/>.  */
+
+#define NO_MEMPCPY_STPCPY_REDIRECT
+#include <string.h>
+
+#undef stpcpy
+#undef __stpcpy
+
+char *__stpcpy (char *d, const char *s)
+{
+  size_t n = strlen (s);
+  return memcpy (d, s, n+1) + n;
+}
+
+weak_alias (__stpcpy, stpcpy)
+libc_hidden_def (__stpcpy)
+libc_hidden_builtin_def (stpcpy)
diff --git a/sysdeps/aarch64/morello/strcpy.c b/sysdeps/aarch64/morello/strcpy.c
new file mode 100644 (file)
index 0000000..f803307
--- /dev/null
@@ -0,0 +1,28 @@
+/* Simple strcpy.
+
+   Copyright (C) 2022 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, see <https://www.gnu.org/licenses/>.  */
+
+#include <string.h>
+
+char *strcpy (char *d, const char *s)
+{
+  size_t n = strlen (s);
+  return memcpy (d, s, n+1);
+}
+
+libc_hidden_builtin_def (strcpy)