libc: Stub out setvbuf, and add S_ISREG

This commit is contained in:
apio 2022-10-23 10:09:20 +02:00
parent fa35e883d7
commit 0c33fcdff2
3 changed files with 12 additions and 1 deletions

View File

@ -30,6 +30,10 @@ extern FILE* stdin;
#define EOF -1
#define _IONBF 0
#define _IOLBF 1
#define _IOFBF 2
typedef off_t fpos_t;
#ifdef __cplusplus
@ -107,6 +111,7 @@ extern "C"
void clearerr(FILE* stream);
void setbuf(FILE*, char*); // Not implemented.
int setvbuf(FILE*, char*, int, size_t); // Not implemented.
/* Writes formatted output according to the string format to the file stream. */
int vfprintf(FILE* stream, const char* format, va_list ap);

View File

@ -12,6 +12,7 @@ struct stat // FIXME: This struct is quite stubbed out.
};
#define S_ISDIR(mode) (((mode)&0xf) == __VFS_DIRECTORY)
#define S_ISREG(mode) (((mode)&0xf) == __VFS_FILE)
#ifdef __cplusplus
extern "C"

View File

@ -244,4 +244,9 @@ extern "C"
{
NOT_IMPLEMENTED("setbuf");
}
int setvbuf(FILE*, char*, int, size_t)
{
NOT_IMPLEMENTED("setvbuf");
}
}