summaryrefslogtreecommitdiff
path: root/ulib.c
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-08 08:56:09 +0000
committerrsc <rsc>2007-08-08 08:56:09 +0000
commite204d0a151a0611085510840465ee418cccfefcb (patch)
tree3639e7f0646a786bca002c405a81b3f5a2300144 /ulib.c
parente0924827eef75ac29f17909c6f932222eda72fbd (diff)
downloadxv6-labs-e204d0a151a0611085510840465ee418cccfefcb.tar.gz
xv6-labs-e204d0a151a0611085510840465ee418cccfefcb.tar.bz2
xv6-labs-e204d0a151a0611085510840465ee418cccfefcb.zip
atoi, for kill
Diffstat (limited to 'ulib.c')
-rw-r--r--ulib.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ulib.c b/ulib.c
index decab69..ce4e13d 100644
--- a/ulib.c
+++ b/ulib.c
@@ -88,3 +88,14 @@ stat(char *n, struct stat *st)
close(fd);
return r;
}
+
+int
+atoi(const char *s)
+{
+ int n;
+
+ n = 0;
+ while('0' <= *s && *s <= '9')
+ n = n*10 + *s++ - '0';
+ return n;
+}