options/ansi: Implement stdio functions for gcc
This commit is contained in:
parent
2581f29c52
commit
02550f623e
|
@ -394,11 +394,15 @@ FILE *stderr = &stderrFile;
|
|||
FILE *stdin = &stdinFile;
|
||||
FILE *stdout = &stdoutFile;
|
||||
|
||||
int fileno(FILE *file_base) {
|
||||
int fileno_unlocked(FILE *file_base) {
|
||||
auto file = static_cast<mlibc::fd_file *>(file_base);
|
||||
return file->fd();
|
||||
}
|
||||
|
||||
int fileno(FILE *file_base) {
|
||||
return fileno_unlocked(file_base);
|
||||
}
|
||||
|
||||
FILE *fopen(const char *path, const char *mode) {
|
||||
// Consume the first char; this must be 'r', 'w' or 'a'.
|
||||
int flags;
|
||||
|
|
|
@ -510,10 +510,6 @@ int ferror_unlocked(FILE *file_base) {
|
|||
return file_base->__status_bits & __MLIBC_ERROR_BIT;
|
||||
}
|
||||
|
||||
int fileno_unlocked(FILE *) {
|
||||
__ensure(!"Not implemented");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
int fgetc_unlocked(FILE *) {
|
||||
__ensure(!"Not implemented");
|
||||
__builtin_unreachable();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#include <stdio_ext.h>
|
||||
#include <bits/ensure.h>
|
||||
#include <mlibc/debug.hpp>
|
||||
|
||||
size_t __fbufsize(FILE *) {
|
||||
__ensure(!"Not implemented");
|
||||
|
@ -32,8 +33,8 @@ int __fwriting(FILE *file_base) {
|
|||
}
|
||||
|
||||
int __fsetlocking(FILE *, int) {
|
||||
__ensure(!"Not implemented");
|
||||
__builtin_unreachable();
|
||||
mlibc::infoLogger() << "mlibc: __fsetlocking() is a no-op" << frg::endlog;
|
||||
return FSETLOCKING_INTERNAL;
|
||||
}
|
||||
|
||||
void _flushlbf(void) {
|
||||
|
|
Loading…
Reference in a new issue