diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-05-02 22:37:41 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-05-02 22:37:41 +0000 |
commit | fe59e884939be00a0bbdc42add4076f23d2f3323 (patch) | |
tree | fc137821d97e04394d59f9a7e5c6ee7749349493 /ldso/ldso/ld_string.h | |
parent | 63882a13e073afa4efed39459215e239bfa23f9d (diff) |
Some more updates and explanation
Diffstat (limited to 'ldso/ldso/ld_string.h')
-rw-r--r-- | ldso/ldso/ld_string.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ldso/ldso/ld_string.h b/ldso/ldso/ld_string.h index be0de45b1..98f2dab81 100644 --- a/ldso/ldso/ld_string.h +++ b/ldso/ldso/ld_string.h @@ -109,4 +109,20 @@ extern inline void * _dl_memset(void * str,int c,size_t len) return str; } +/* Early on, we can't call printf, so use this to print out + * numbers using the SEND_STDERR() macro */ +static inline char *_dl_simple_itol(unsigned long i) +{ + /* 21 digits plus null terminator, good for 64-bit or smaller ints */ + static char local[22]; + char *p = &local[21]; + *p-- = '\0'; + do { + *p-- = '0' + i % 10; + i /= 10; + } while (i > 0); + return p + 1; +} + + #endif |