From 0ba092c1c9d7ff6091a80db79d4d6b26162ad50c Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Thu, 15 Feb 2001 16:20:14 +0000 Subject: Add vdprintf function. Note: will be rewritten to check if file descriptor has an associated FILE to avoid bad interactions with buffered output, but needed for busybox right now and that implementation has the same bug. --- libc/stdio/printf.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libc/stdio/printf.c') diff --git a/libc/stdio/printf.c b/libc/stdio/printf.c index 3a7dda007..898d0b94e 100644 --- a/libc/stdio/printf.c +++ b/libc/stdio/printf.c @@ -279,6 +279,17 @@ int vsnprintf(char *sp, size_t size, __const char *fmt, va_list ap) } #endif +#ifdef L_vdprintf +#warning rewrite vdprintf ... fd may have an associated file!!! plus buffer? +extern int vdprintf(int fd, const char *fmt, va_list ap) +{ + FILE f = {f.unbuf, f.unbuf, f.unbuf, f.unbuf, f.unbuf + sizeof(f.unbuf), + fd, _IONBF | __MODE_WRITE | __MODE_IOTRAN}; + + return vfnprintf(&f, -1, fmt, ap); +} +#endif + #ifdef L_vfnprintf extern char *__ultostr(char *buf, unsigned long uval, int base, int uppercase); -- cgit v1.2.3