xv6

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit e204d0a151a0611085510840465ee418cccfefcb
parent e0924827eef75ac29f17909c6f932222eda72fbd
Author: rsc <rsc>
Date:   Wed,  8 Aug 2007 08:56:09 +0000

atoi, for kill

Diffstat:
Mulib.c | 11+++++++++++
Muser.h | 1+
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git 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; +} diff --git a/user.h b/user.h @@ -31,3 +31,4 @@ unsigned int strlen(char*); void* memset(void*, int, unsigned int); void* malloc(uint); void free(void*); +int atoi(const char*);