int vsnprintf(char *buf, size_t size, const char *fmt, va_list ap) { sbuf = buf; ebuf = buf + size - 1; kdoprnt(sputchar, fmt, ap); *sbuf = '\0'; return sbuf - buf; }
void vprintf(const char *fmt, va_list ap) { kdoprnt(putchar, fmt, ap); #if defined(__minix) && defined(LIBSA_PRINTF_WIDTH_SUPPORT) /* BJG: our libminc kputc() relies on a 0 to flush the diag buffer. */ putchar(0); #endif /* defined(__minix) && defined(LIBSA_PRINTF_WIDTH_SUPPORT) */ }
int vsnprintf(char *buf, size_t size, const char *fmt, va_list ap) { sbuf = buf; ebuf = buf + size - 1; #if defined(__minix) scount = 0; /* use scount to keep track of written items */ #endif /* defined(__minix) */ kdoprnt(sputchar, fmt, ap); #if defined(__minix) if (sbuf){ /* handle case where sbuf == NULL */ *sbuf = '\0'; } return scount; #else /* __minix is not defined */ *sbuf = '\0'; return sbuf - buf; #endif /* defined(__minix) */ }
void vprintf(const char *fmt, va_list ap) { kdoprnt(putchar, fmt, ap); }