summaryrefslogtreecommitdiff
path: root/user/lib/strlen.c
diff options
context:
space:
mode:
Diffstat (limited to 'user/lib/strlen.c')
-rw-r--r--user/lib/strlen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/user/lib/strlen.c b/user/lib/strlen.c
new file mode 100644
index 0000000..6c4cc86
--- /dev/null
+++ b/user/lib/strlen.c
@@ -0,0 +1,9 @@
+#include <string.h>
+
+size_t strlen(const char *str)
+{
+ const char *p;
+ for (p = str; *p != 0; p++) {
+ }
+ return p - str;
+}