Add a user-space printf

上级 03f6bac6
...@@ -22,6 +22,16 @@ fprintf(int fd, const char *fmt, ...) ...@@ -22,6 +22,16 @@ fprintf(int fd, const char *fmt, ...)
va_end(ap); va_end(ap);
} }
void
printf(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vprintfmt(writec, (void*) 1, fmt, ap);
va_end(ap);
}
// Print to a buffer. // Print to a buffer.
struct bufstate { struct bufstate {
char *p; char *p;
......
...@@ -49,6 +49,7 @@ int atoi(const char*); ...@@ -49,6 +49,7 @@ int atoi(const char*);
int forkt(void *sp, void *pc, void *arg); int forkt(void *sp, void *pc, void *arg);
// printf.c // printf.c
void printf(const char*, ...);
void fprintf(int, const char*, ...); void fprintf(int, const char*, ...);
void snprintf(char *buf, unsigned int n, const char *fmt, ...); void snprintf(char *buf, unsigned int n, const char *fmt, ...);
void die(const char* errstr, ...) __attribute__((noreturn)); void die(const char* errstr, ...) __attribute__((noreturn));
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论