My understanding of the documentation is what dprintfwill lead to the failure or output of all output. But I agree that this is some kind of gray area (and I can misunderstand); I assume that partial inference is a kind of failure (therefore returns a negative size).
Here is the musl-libc implementation :
stdio/dprintf.c dprintf vdprintf
stdio/vdprintf.c :
static size_t wrap_write(FILE *f, const unsigned char *buf, size_t len)
{
return __stdio_write(f, buf, len);
}
int vdprintf(int fd, const char *restrict fmt, va_list ap)
{
FILE f = {
.fd = fd, .lbf = EOF, .write = wrap_write,
.buf = (void *)fmt, .buf_size = 0,
.lock = -1
};
return vfprintf(&f, fmt, ap);
}
, dprintf , vfprintf ( fprintf....).
, , snprintf asprintf write (2) .
stdio/__stdio_write.c __stdio_write ( writev (2) ).
, ; , , (, HTTP-), (, snprintf / asprintf), write (2).
PS. C, dprintf; GNU glibc libio/iovdprintf.c