fxlibc/src/libc/stdio/dprintf.c

21 lines
303 B
C
Raw Normal View History

2021-05-09 17:34:00 +02:00
#include <stdio.h>
#include <fxlibc/printf.h>
2020-09-17 19:27:01 +02:00
int dprintf(int fd, char const * restrict fmt, ...)
2020-09-17 19:27:01 +02:00
{
if(fd < 0) return -1;
2020-09-17 19:27:01 +02:00
struct __printf_output out = {
.fd = fd,
.size = 65536,
};
va_list args;
va_start(args, fmt);
int count = __printf(&out, fmt, &args);
va_end(args);
return count;
2020-09-17 19:27:01 +02:00
}