add declarations for unsupported functions for libstdc++

So that it compiles - it won't link but we can leave that for later.
This commit is contained in:
Lephenixnoir 2022-08-13 00:01:00 +02:00
parent 714e1cf605
commit 8231557ff5
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
6 changed files with 122 additions and 7 deletions

View file

@ -33,6 +33,66 @@ extern int errno;
#define ENOMEDIUM 22 /* No medium found */
#define EMEDIUMTYPE 23 /* Wrong medium type */
/* Error codes used by libstdc++. */
#define EAFNOSUPPORT 24
#define EADDRINUSE 25
#define EADDRNOTAVAIL 26
#define EISCONN 27
#define E2BIG 28
#define EFAULT 29
#define EPIPE 30
#define ECONNABORTED 31
#define EALREADY 32
#define ECONNREFUSED 33
#define ECONNRESET 34
#define EXDEV 35
#define EDESTADDRREQ 36
#define EBUSY 37
#define ENOEXEC 38
#define EFBIG 39
#define ENAMETOOLONG 40
#define ENOSYS 41
#define EHOSTUNREACH 42
#define ENOTTY 43
#define EMSGSIZE 44
#define ENETDOWN 45
#define ENETRESET 46
#define ENETUNREACH 47
#define ENOBUFS 48
#define ECHILD 49
#define ENOLCK 50
#define ENOMSG 51
#define ENOPROTOOPT 52
#define ENXIO 53
#define ESRCH 54
#define ENOTSOCK 55
#define ENOTCONN 56
#define EINPROGRESS 57
#define EPERM 58
#define EOPNOTSUPP 59
#define EWOULDBLOCK 60
#define EPROTONOSUPPORT 61
#define EROFS 62
#define EDEADLK 63
#define ETIMEDOUT 64
#define EMFILE 65
#define EMLINK 66
#define ELOOP 67
#define EPROTOTYPE 68
#define EBADMSG 69
#define EIDRM 70
#define ENOLINK 71
#define ENODATA 72
#define ENOSR 73
#define ECANCELED 74
#define EOWNERDEAD 75
#define EPROTO 76
#define ENOTRECOVERABLE 77
#define ETIME 78
#define ETXTBUSY 79
#define EOVERFLOW 80
#ifdef __cplusplus
}
#endif

View file

@ -150,6 +150,12 @@ extern FILE *stderr;
In gint, the file must not be open (open files' names are not tracked). */
extern int remove(char const *__filename);
extern int rename(char const *__old, char const *__new);
extern FILE *tmpfile(void);
extern char *tmpnam(char *__s);
/*
** File access functions.
*/
@ -181,6 +187,8 @@ extern void setbuf(FILE * __restrict__ __fp, char * __restrict__ __buf);
extern int setvbuf(FILE * __restrict__ __fp, char * __restrict__ __buf,
int __mode, size_t __size);
extern int fileno(FILE *__fp);
/*
** Formatted input/output functions.
**
@ -262,6 +270,30 @@ extern int asprintf(char ** __restrict__ __str,
extern int vasprintf(char ** __restrict__ __str,
char const * __restrict__ __format, va_list __args);
/* Formatted scan from file. */
extern int fscanf(FILE * __restrict__ __fp,
char const * __restrict__ __format, ...);
/* Formatted scan from stdin. */
extern int scanf(
char const * __restrict__ __format, ...);
/* Formatted scan from string. */
extern int sscanf(const char * __restrict__ __s,
char const * __restrict__ __format, ...);
/* Formatted scan from file (variable argument list). */
extern int vfscanf(FILE * __restrict__ __fp,
char const * __restrict__ __format, va_list __args);
/* Formatted scan from stdin (variable argument list). */
extern int vscanf(
char const * __restrict__ __format, va_list __args);
/* Formatted scan from string (variable argument list). */
extern int vsscanf(char const * __restrict__ __s,
char const * __restrict__ __format, va_list __args);
/*
** Character input/output functions.
*/

View file

@ -38,6 +38,8 @@ extern void free(void *__ptr);
__attribute__((noreturn))
extern void abort(void);
extern int atexit(void (*__func)(void));
/* Exit; calls handlers, flushes and closes streams and temporary files. */
__attribute__((noreturn))
extern void exit(int __status);
@ -46,6 +48,10 @@ extern void exit(int __status);
__attribute__((noreturn))
extern void _Exit(int __status);
extern char *getenv(char const *__name);
extern int system(char const *__string);
/* Integer arithmetic functions. */
extern int abs(int __j);
@ -142,15 +148,20 @@ extern long double strtold(
#define RAND_MAX 0x7fffffff
/* Seed the PRNG. */
extern void srand(unsigned int seed);
extern void srand(unsigned int __seed);
/* Generate a pseudo-random number between 0 and RAND_MAX. */
extern int rand(void);
/* Searching and sorting utilities. */
void qsort(void *base, size_t nmemb, size_t size,
int (*compare)(void const *left, void const *right));
extern void *bsearch(void const *__key,
void const *__base, size_t __nmemb, size_t __size,
int (*__compare)(void const *, void const *));
extern void qsort(
void *__base, size_t __nmemb, size_t __size,
int (*__compare)(void const *, void const *));
#ifdef __cplusplus
}

View file

@ -55,16 +55,16 @@ struct stat {
dev_t st_dev;
ino_t st_ino;
nlink_t st_link;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
blksize_t st_blksize;
blkcnt_t st_blocks;
// struct timespec st_atim;
// struct timespec st_mtim;
// struct timespec st_ctim;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
};
#define st_atime st_atim.tv_sec
@ -75,6 +75,8 @@ struct stat {
extern int stat(char const * __restrict__ __pathname,
struct stat * __restrict__ __statbuf);
extern int chmod(char const *__pathname, mode_t mode);
#ifdef __cplusplus
}
#endif

View file

@ -31,6 +31,12 @@ struct tm {
int tm_isdst; /* Daylight Saving Time flag */
};
/* Full time specification with second/nanosecond precision. */
struct timespec {
time_t tv_sec;
long tv_nsec;
};
/* Returns CPU time used by the program (in number of CLOCKS_PER_SEC). */
extern clock_t clock(void);

View file

@ -41,6 +41,10 @@ extern int mkdir(const char *__path, mode_t __mode);
/* Remove an empty directory. */
extern int rmdir(const char *__path);
extern char *getcwd(char *__buf, size_t __size);
extern int chdir(char const *__path);
/* Kernel-style functions supported only by Vhex. */