BarryServer : Git

All the code for all my projects
// BarryServer : Git / OrionLibC / blob / ad9b6af63f1fdfcf3556c9b2fc670f72cdc60ab4 / stdio / printf.c

// Related

OrionLibC

Barry Importing existing Orion LibC 03048a9 (2 years, 2 months ago)
#include <unistd.h>
#include <stdarg.h>
#include <sys/syscall.h>
#include <stdio.h>

int vsprintf(char *buf, const char *fmt, va_list args);

/* Write a formatted string to stdout */
int
printf(const char *fmt, ...)
{
	int len;
	char buf[8196];
	va_list args;
	va_start(args, fmt);
	len = vsprintf(buf, fmt, args);
	va_end(args);

	len = write(STDOUT_FILENO, buf, len);
	return len;
}