From f32f3638f4c34fbf2fc4398878e6304612bb3283 Mon Sep 17 00:00:00 2001 From: rsc Date: Tue, 21 Aug 2007 19:22:08 +0000 Subject: Various cleanup: - Got rid of dummy proc[0]. Now proc[0] is init. - Added initcode.S to exec /init, so that /init is just a regular binary. - Moved exec out of sysfile to exec.c - Moved code dealing with fs guts (like struct inode) from sysfile.c to fs.c. Code dealing with system call arguments stays in sysfile.c - Refactored directory routines in fs.c; should be simpler. - Changed iget to return *unlocked* inode structure. This solves the lookup-then-use race in namei without introducing deadlocks. It also enabled getting rid of the dummy proc[0]. --- string.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index a871b68..0a92cca 100644 --- a/string.c +++ b/string.c @@ -75,3 +75,13 @@ safestrcpy(char *s, const char *t, int n) return os; } +int +strlen(const char *s) +{ + int n; + + for(n = 0; s[n]; n++) + ; + return n; +} + -- cgit v1.2.3