From e6584db26da34572fb13aa236e16e19f71c8e976 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 26 Aug 2022 14:16:16 +0200 Subject: user/libc: prepare for OpenED port --- src/user/lib/include/stdio.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/user/lib/include/stdio.h') diff --git a/src/user/lib/include/stdio.h b/src/user/lib/include/stdio.h index b0d34a7..5ad07e0 100644 --- a/src/user/lib/include/stdio.h +++ b/src/user/lib/include/stdio.h @@ -2,13 +2,20 @@ #include #include #include +#include #define EOF (-1) +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 #define SEEK_SET 1 #define SEEK_CUR 2 #define SEEK_END 3 +#define _IONBF 0 +#define _IOLBF 1 + /* stop fread() from trying to fill the entire buffer before returning * i.e. it will call _syscall_read() exactly once */ #define FEXT_NOFILL 1 @@ -28,15 +35,35 @@ FILE *fopen(const char *path, const char *mode); FILE *freopen(const char *path, const char *mode, FILE *); FILE *fdopen(int fd, const char *mode); FILE *file_clone(const FILE *, const char *mode); +FILE *popen(const char *cmd, const char *mode); +int pclose(FILE *f); + int fextflags(FILE *, int extflags); +int setvbuf(FILE *restrict f, char *restrict buf, int type, size_t size); int fclose(FILE *); int fflush(FILE *f); size_t fread(void *restrict ptr, size_t size, size_t nitems, FILE *restrict); size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict); +int fputs(const char *s, FILE *f); char *fgets(char *buf, int size, FILE *f); +int fgetc(FILE *f); +int getc(FILE *f); +int fputc(int c, FILE *f); +int putc(int c, FILE *f); + int fseek(FILE *f, long offset, int whence); +int fseeko(FILE *f, off_t offset, int whence); long ftell(FILE *f); +off_t ftello(FILE *f); int feof(FILE *); int ferror(FILE *); +void clearerr(FILE *f); + +void perror(const char *s); +int puts(const char *s); +int getchar(void); +int putchar(int c); + +off_t lseek(int fd, off_t off, int whence); -- cgit v1.2.3