mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[libc] Add stubbed-out stdio and libdl functions
In order to fix link errors with libunwind, stub out these functions for now.
This commit is contained in:
7
src/libraries/libc/arch/amd64/crt/libdl.cpp
Normal file
7
src/libraries/libc/arch/amd64/crt/libdl.cpp
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
extern "C" {
|
||||||
|
// Stub out these libdl functions for libunwind until
|
||||||
|
// we have a real libdl
|
||||||
|
int dladdr(const void *, void *) { return 0; }
|
||||||
|
int dl_iterate_phdr(void *, void *) { return 0; }
|
||||||
|
}
|
||||||
@@ -36,6 +36,10 @@ typedef size_t fpos_t;
|
|||||||
#define SEEK_END 1
|
#define SEEK_END 1
|
||||||
#define SEEK_SET 2
|
#define SEEK_SET 2
|
||||||
|
|
||||||
|
extern FILE *stdin;
|
||||||
|
extern FILE *stdout;
|
||||||
|
extern FILE *stderr;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -112,6 +116,10 @@ int feof(FILE *stream);
|
|||||||
int ferror(FILE *stream);
|
int ferror(FILE *stream);
|
||||||
void perror(const char *s);
|
void perror(const char *s);
|
||||||
|
|
||||||
|
// Environment functions
|
||||||
|
//
|
||||||
|
char * getenv(const char *name);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
3
src/libraries/libc/stdio/fflush.cpp
Normal file
3
src/libraries/libc/stdio/fflush.cpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int fflush(FILE *stream) { return 0; }
|
||||||
4
src/libraries/libc/stdio/fprintf.cpp
Normal file
4
src/libraries/libc/stdio/fprintf.cpp
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int fprintf(FILE * restrict stream, const char * restrict format, ...) { return 0; }
|
||||||
|
int vfprintf(FILE * restrict stream, const char * restrict format, va_list arg) { return 0; }
|
||||||
3
src/libraries/libc/stdio/fputc.cpp
Normal file
3
src/libraries/libc/stdio/fputc.cpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int fputc(char c, FILE *stream) { return 0; }
|
||||||
3
src/libraries/libc/stdio/fputs.cpp
Normal file
3
src/libraries/libc/stdio/fputs.cpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int fputs(const char * restrict s, FILE * restrict stream) { return 0; }
|
||||||
3
src/libraries/libc/stdio/fwrite.cpp
Normal file
3
src/libraries/libc/stdio/fwrite.cpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
size_t fwrite(const void * restrict ptr, size_t size, size_t nmemb, FILE * restrict stream) { return 0; }
|
||||||
3
src/libraries/libc/stdio/getenv.cpp
Normal file
3
src/libraries/libc/stdio/getenv.cpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
char * getenv(const char *name) { return nullptr; }
|
||||||
5
src/libraries/libc/stdio/stdio.cpp
Normal file
5
src/libraries/libc/stdio/stdio.cpp
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
FILE *stdin = nullptr;
|
||||||
|
FILE *stdout = nullptr;
|
||||||
|
FILE *stderr = nullptr;
|
||||||
Reference in New Issue
Block a user