summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-09-02 18:14:19 +0200
committerSerge Hallyn <serge@hallyn.com>2023-09-04 08:57:43 -0500
commitc1fd94d7d5b14e34a26ea1b3a2030c376df9ba36 (patch)
tree01dc1796b02daf3c780ffcb3fe46330c5257a3ff
parent9b0f8ddc30527727d66ca2bd9cd64977993b8cf5 (diff)
lib/mempcpy.[ch]: Remove our definition of mempcpy(3)
It is provided by glibc, musl, and FreeBSD. Reported-by: Sam James <sam@gentoo.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--configure.ac2
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/mempcpy.c23
-rw-r--r--lib/mempcpy.h31
-rw-r--r--lib/stpecpy.h2
-rw-r--r--lib/zustr2stp.h1
6 files changed, 1 insertions, 60 deletions
diff --git a/configure.ac b/configure.ac
index b3bbf57d..7d213038 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,7 +47,7 @@ AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
AC_CHECK_FUNCS(arc4random_buf futimes \
getentropy getrandom getspnam getusershell \
- initgroups lckpwdf lutimes mempcpy \
+ initgroups lckpwdf lutimes \
setgroups updwtmp updwtmpx innetgr \
getspnam_r \
rpmatch \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 11e405c2..897f0602 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -84,8 +84,6 @@ libshadow_la_SOURCES = \
lockpw.c \
loginprompt.c \
mail.c \
- mempcpy.c \
- mempcpy.h \
memzero.c \
memzero.h \
motd.c \
diff --git a/lib/mempcpy.c b/lib/mempcpy.c
deleted file mode 100644
index 14a09613..00000000
--- a/lib/mempcpy.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2023, Alejandro Colomar <alx@kernel.org>
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-#include <config.h>
-
-#if !defined(HAVE_MEMPCPY)
-
-#ident "$Id$"
-
-#include "mempcpy.h"
-
-#include <stddef.h>
-
-
-extern inline void *mempcpy(void *restrict dst, const void *restrict src,
- size_t n);
-
-
-#endif
diff --git a/lib/mempcpy.h b/lib/mempcpy.h
deleted file mode 100644
index 528b976a..00000000
--- a/lib/mempcpy.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2023, Alejandro Colomar <alx@kernel.org>
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-#ifndef SHADOW_INCLUDE_LIB_MEMPCPY_H_
-#define SHADOW_INCLUDE_LIB_MEMPCPY_H_
-
-
-#include <config.h>
-
-#if !defined(HAVE_MEMPCPY)
-
-#include <stddef.h>
-#include <string.h>
-
-
-inline void *mempcpy(void *restrict dst, const void *restrict src, size_t n);
-
-
-inline void *
-mempcpy(void *restrict dst, const void *restrict src, size_t n)
-{
- return memcpy(dst, src, n) + n;
-}
-
-
-#endif // !HAVE_MEMPCPY
-#endif // include guard
diff --git a/lib/stpecpy.h b/lib/stpecpy.h
index 766793ba..c4a60680 100644
--- a/lib/stpecpy.h
+++ b/lib/stpecpy.h
@@ -17,8 +17,6 @@
#include <stddef.h>
#include <string.h>
-#include "mempcpy.h"
-
inline char *stpecpy(char *dst, char *end, const char *restrict src);
diff --git a/lib/zustr2stp.h b/lib/zustr2stp.h
index f2dbc741..2160a1b0 100644
--- a/lib/zustr2stp.h
+++ b/lib/zustr2stp.h
@@ -14,7 +14,6 @@
#include <stddef.h>
#include <string.h>
-#include "mempcpy.h"
#include "must_be.h"
#include "sizeof.h"