From 99da70deba62de235454ef1852745610a9c9f741 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 29 Jul 2022 21:33:15 +0200 Subject: user/libc: properly implement snprintf; the v*printf family --- src/user/lib/include/stdio.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/user/lib/include') diff --git a/src/user/lib/include/stdio.h b/src/user/lib/include/stdio.h index bf9e09e..fe754da 100644 --- a/src/user/lib/include/stdio.h +++ b/src/user/lib/include/stdio.h @@ -1,5 +1,6 @@ #pragma once #include +#include #include #define EOF (-1) @@ -8,8 +9,13 @@ #define SEEK_CUR 2 #define SEEK_END 3 -int printf(const char *fmt, ...); -int snprintf(char *str, size_t len, const char *fmt, ...); +int printf(const char *restrict fmt, ...); +int fprintf(FILE *restrict f, const char *restrict fmt, ...); +int snprintf(char *restrict str, size_t len, const char *restrict fmt, ...); + +int vprintf(const char *restrict fmt, va_list ap); +int vfprintf(FILE *restrict f, const char *restrict fmt, va_list ap); +int vsnprintf(char *restrict str, size_t len, const char *restrict fmt, va_list ap); int _klogf(const char *fmt, ...); // for kernel debugging only -- cgit v1.2.3