summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-01-22 01:28:18 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-01-22 01:29:06 +0100
commita12a10679017d89194c0dd873f44804b64f71102 (patch)
treeeb378bc28f4be55aa8dc4221fbc9ffc9839160c3 /kern
parent4362d1a0c20b8490ffc3115ac4bd93183a670af6 (diff)
Fix build on 64bit host
When stealing the memset function from the 32bit host libc on a 64bit host system, glibc tends to bring unwanted references to _Unwind_Resume, __gcc_personality_v0, etc. So let's stop stealing memset. * kern/strings.c (memset): New function. * Makefile.am (clib_routines): Remove memset.
Diffstat (limited to 'kern')
-rw-r--r--kern/strings.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/kern/strings.c b/kern/strings.c
index 80e410e..3676f98 100644
--- a/kern/strings.c
+++ b/kern/strings.c
@@ -172,3 +172,22 @@ strlen(
return string - 1 - ret;
}
+
+/*
+ * Abstract:
+ * memset writes value "c" in the "n" bytes starting at address "s".
+ * The return value is a pointer to the "s" string.
+ */
+
+void *
+memset(
+ void *_s, int c, size_t n)
+{
+ char *s = _s;
+ int i;
+
+ for (i = 0; i < n ; i++)
+ s[i] = c;
+
+ return _s;
+}