changeset 91:659fa1a26269

target-utils/libc: non-optimized C implementation of memset for the sake of completeness and compliance
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 28 Oct 2016 23:15:01 +0000
parents 8dc062c6359b
children bfed7a5c21a6
files target-utils/libc/Makefile target-utils/libc/memset.c
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/target-utils/libc/Makefile	Fri Oct 28 23:02:44 2016 +0000
+++ b/target-utils/libc/Makefile	Fri Oct 28 23:15:01 2016 +0000
@@ -4,8 +4,9 @@
 AR=	arm-elf-ar
 RANLIB=	arm-elf-ranlib
 
-OBJS=	atoi.o bzero.o ctype_.o index.o memcpy.o memcpy16.o memcpy32.o rindex.o\
-	strcasecmp.o strcat.o strcmp.o strcpy.o strncat.o strncmp.o strncpy.o
+OBJS=	atoi.o bzero.o ctype_.o index.o memcpy.o memcpy16.o memcpy32.o memset.o\
+	rindex.o strcasecmp.o strcat.o strcmp.o strcpy.o strncat.o strncmp.o \
+	strncpy.o
 
 all:	libc.a
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/target-utils/libc/memset.c	Fri Oct 28 23:15:01 2016 +0000
@@ -0,0 +1,14 @@
+#include <sys/types.h>
+
+u_char *
+memset(buf, c, n)
+	u_char *buf;
+	int c;
+	unsigned n;
+{
+	u_char *p = buf;
+
+	for (; n; n--)
+		*p++ = c;
+	return buf;
+}