Update userspace

This commit is contained in:
Alex
2023-08-24 04:53:34 +03:00
parent e5c3c55e17
commit a945423ef9
18 changed files with 72 additions and 1921 deletions

View File

@ -57,6 +57,7 @@ extern "C"
#define stdout stdout
#define stderr stderr
FILE *freopen(const char *filename, const char *mode, FILE *stream);
FILE *fopen(const char *filename, const char *mode);
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
@ -77,6 +78,8 @@ extern "C"
int puts(const char *s);
int putchar(int c);
int fgetc(FILE *stream);
#ifdef __cplusplus
}
#endif

View File

@ -10,6 +10,12 @@ PUBLIC FILE *stdin = NULL;
PUBLIC FILE *stdout = NULL;
PUBLIC FILE *stderr = NULL;
PUBLIC FILE *freopen(const char *filename, const char *mode, FILE *stream)
{
errno = ENOSYS;
return NULL;
}
PUBLIC FILE *fopen(const char *filename, const char *mode)
{
int fd = syscall2(sys_FileOpen, (uint64_t)filename, (uint64_t)mode);

9
libc/src/std/io/get.c Normal file
View File

@ -0,0 +1,9 @@
#include <stdio.h>
#include <stdarg.h>
#include <fennix/syscall.h>
#include <sys/types.h> // For PUBLIC
PUBLIC int fgetc(FILE *stream)
{
}