From 3a9dccd76ee6916d5586a3fba49cb8e0edb3ca5d Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 2 Apr 2004 22:57:49 +0000 Subject: Change _p9strsig to return nil if tmp==nil. Add atoi, atol, atoll. These versions call strtol/strtoll with base==0. The Unix versions use base==10. --- src/lib9/atoi.c | 9 +++++++++ src/lib9/atol.c | 9 +++++++++ src/lib9/atoll.c | 9 +++++++++ src/lib9/await.c | 2 ++ src/lib9/mkfile | 3 +++ 5 files changed, 32 insertions(+) create mode 100644 src/lib9/atoi.c create mode 100644 src/lib9/atol.c create mode 100644 src/lib9/atoll.c (limited to 'src') diff --git a/src/lib9/atoi.c b/src/lib9/atoi.c new file mode 100644 index 00000000..66ecb4ef --- /dev/null +++ b/src/lib9/atoi.c @@ -0,0 +1,9 @@ +#include +#include + +int +atoi(char *s) +{ + return strtol(s, 0, 0); +} + diff --git a/src/lib9/atol.c b/src/lib9/atol.c new file mode 100644 index 00000000..d6713834 --- /dev/null +++ b/src/lib9/atol.c @@ -0,0 +1,9 @@ +#include +#include + +long +atol(char *s) +{ + return strtol(s, 0, 0); +} + diff --git a/src/lib9/atoll.c b/src/lib9/atoll.c new file mode 100644 index 00000000..6c345df6 --- /dev/null +++ b/src/lib9/atoll.c @@ -0,0 +1,9 @@ +#include +#include + +vlong +atoll(char *s) +{ + return strtoll(s, 0, 0); +} + diff --git a/src/lib9/await.c b/src/lib9/await.c index a97c6d18..c6c7122c 100644 --- a/src/lib9/await.c +++ b/src/lib9/await.c @@ -56,6 +56,8 @@ _p9sigstr(int sig, char *tmp) for(i=0; i