1
0
mirror of https://github.com/UzixLS/KernelEx.git synced 2025-07-19 07:21:20 +03:00

import KernelEx-4.5-Beta1

This commit is contained in:
UzixLS
2018-11-03 16:21:13 +03:00
parent d6aad6c6c5
commit 09929b2b7d
392 changed files with 17832 additions and 2491 deletions

28
kexcrt/printf.c Executable file
View File

@ -0,0 +1,28 @@
/*
* printf.c
*/
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#define BUFFER_SIZE 16384
int printf(const char *format, ...)
{
va_list ap;
int rv;
char buffer[BUFFER_SIZE];
va_start(ap, format);
rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
va_end(ap);
if (rv < 0)
return rv;
if (rv > BUFFER_SIZE - 1)
rv = BUFFER_SIZE - 1;
return write(1, buffer, rv);
}