Add vsnrprintf() which is just like vsnprintf() but takes a "radix"

argument for the kernel-special %r format.
This commit is contained in:
Poul-Henning Kamp 2003-02-04 10:00:34 +00:00
parent 02718c4983
commit 8751a8c73b
2 changed files with 18 additions and 0 deletions

View File

@ -416,6 +416,23 @@ vsnprintf(char *str, size_t size, const char *format, va_list ap)
return (retval);
}
/*
* Kernel version which takes radix argument vsnprintf(3).
*/
int
vsnrprintf(char *str, size_t size, int radix, const char *format, va_list ap)
{
struct snprintf_arg info;
int retval;
info.str = str;
info.remain = size;
retval = kvprintf(format, snprintf_func, &info, radix, ap);
if (info.remain >= 1)
*info.str++ = '\0';
return (retval);
}
static void
snprintf_func(int ch, void *arg)
{

View File

@ -157,6 +157,7 @@ int sprintf(char *buf, const char *, ...) __printflike(2, 3);
int uprintf(const char *, ...) __printflike(1, 2);
int vprintf(const char *, __va_list) __printflike(1, 0);
int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0);
int vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0);
int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0);
int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3);
int sscanf(const char *, char const *, ...);