diff options
author | rsc <rsc> | 2007-08-08 08:56:09 +0000 |
---|---|---|
committer | rsc <rsc> | 2007-08-08 08:56:09 +0000 |
commit | e204d0a151a0611085510840465ee418cccfefcb (patch) | |
tree | 3639e7f0646a786bca002c405a81b3f5a2300144 | |
parent | e0924827eef75ac29f17909c6f932222eda72fbd (diff) | |
download | xv6-labs-e204d0a151a0611085510840465ee418cccfefcb.tar.gz xv6-labs-e204d0a151a0611085510840465ee418cccfefcb.tar.bz2 xv6-labs-e204d0a151a0611085510840465ee418cccfefcb.zip |
atoi, for kill
-rw-r--r-- | ulib.c | 11 | ||||
-rw-r--r-- | user.h | 1 |
2 files changed, 12 insertions, 0 deletions
@@ -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; +} @@ -31,3 +31,4 @@ unsigned int strlen(char*); void* memset(void*, int, unsigned int); void* malloc(uint); void free(void*); +int atoi(const char*); |