summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhunt <hunt>2006-03-30 21:01:20 +0000
committerhunt <hunt>2006-03-30 21:01:20 +0000
commitae653153d30946a7706369486dc646a9a3839a7c (patch)
tree3e94891dd5bff1cbd9c28cb180343ce4acb870dd
parentcf0c46c27bca3de031b0ce546c11153430ebd9df (diff)
downloadsystemtap-steved-ae653153d30946a7706369486dc646a9a3839a7c.tar.gz
systemtap-steved-ae653153d30946a7706369486dc646a9a3839a7c.tar.xz
systemtap-steved-ae653153d30946a7706369486dc646a9a3839a7c.zip
2006-03-30 Martin Hunt <hunt@redhat.com>
* emul.h (kmalloc_node): New.
-rw-r--r--runtime/user/ChangeLog4
-rw-r--r--runtime/user/emul.h31
2 files changed, 35 insertions, 0 deletions
diff --git a/runtime/user/ChangeLog b/runtime/user/ChangeLog
index 82585425..e6c5ab32 100644
--- a/runtime/user/ChangeLog
+++ b/runtime/user/ChangeLog
@@ -1,3 +1,7 @@
+2006-03-30 Martin Hunt <hunt@redhat.com>
+
+ * emul.h (kmalloc_node): New.
+
2006-01-25 Martin Hunt <hunt@redhat.com>
* alloc.c (_stp_alloc_percpu): New function.
diff --git a/runtime/user/emul.h b/runtime/user/emul.h
index aa5479d4..63938b08 100644
--- a/runtime/user/emul.h
+++ b/runtime/user/emul.h
@@ -1,4 +1,6 @@
#define kmalloc(size,flags) malloc(size)
+#define kmalloc(size,flags) malloc(size)
+#define kmalloc_node(size,flags,cpu) malloc(size)
#define kfree(ptr) free(ptr)
@@ -88,3 +90,32 @@ void __lockfunc _spin_lock(spinlock_t *lock)
void __lockfunc _spin_unlock(spinlock_t *lock)
{
}
+
+size_t strlcat(char *dest, const char *src, size_t count)
+{
+ size_t dsize = strlen(dest);
+ size_t len = strlen(src);
+ size_t res = dsize + len;
+
+ /* This would be a bug */
+ BUG_ON(dsize >= count);
+
+ dest += dsize;
+ count -= dsize;
+ if (len >= count)
+ len = count-1;
+ memcpy(dest, src, len);
+ dest[len] = 0;
+ return res;
+}
+size_t strlcpy(char *dest, const char *src, size_t size)
+{
+ size_t ret = strlen(src);
+
+ if (size) {
+ size_t len = (ret >= size) ? size - 1 : ret;
+ memcpy(dest, src, len);
+ dest[len] = '\0';
+ }
+ return ret;
+}