diff options
Diffstat (limited to 'klibc_fixups')
-rw-r--r-- | klibc_fixups/klibc_fixups.h | 11 | ||||
-rw-r--r-- | klibc_fixups/malloc.h | 9 | ||||
-rw-r--r-- | klibc_fixups/mntent.h | 39 |
3 files changed, 59 insertions, 0 deletions
diff --git a/klibc_fixups/klibc_fixups.h b/klibc_fixups/klibc_fixups.h index 8d2933b1b6..a39ec42e5f 100644 --- a/klibc_fixups/klibc_fixups.h +++ b/klibc_fixups/klibc_fixups.h @@ -3,6 +3,17 @@ #ifndef _KLIBC_FIXUPS_H #define _KLIBC_FIXUPS_H +#include <unistd.h> + +#define _SC_PAGESIZE 0x66 +static inline long int sysconf(int name) +{ + if (name == _SC_PAGESIZE) + return getpagesize(); + + return -1; +} + struct exit_status { short int e_termination; /* process termination status */ short int e_exit; /* process exit status */ diff --git a/klibc_fixups/malloc.h b/klibc_fixups/malloc.h new file mode 100644 index 0000000000..439608e3c4 --- /dev/null +++ b/klibc_fixups/malloc.h @@ -0,0 +1,9 @@ +#ifdef __KLIBC__ + +#ifndef _MALLOC_H +#define _MALLOC_H + +#include <stdlib.h> + +#endif /* _MALLOC_H */ +#endif /* __KLIBC__ */ diff --git a/klibc_fixups/mntent.h b/klibc_fixups/mntent.h new file mode 100644 index 0000000000..ea79a2dd63 --- /dev/null +++ b/klibc_fixups/mntent.h @@ -0,0 +1,39 @@ +#ifdef __KLIBC__ + +#ifndef _MNTENT_H +#define _MNTENT_H + +#include <stdio.h> + +struct mntent +{ + char *mnt_fsname; + char *mnt_dir; + char *mnt_type; + char *mnt_opts; + int mnt_freq; + int mnt_passno; +}; + +static inline FILE *setmntent (const char *file, const char *mode) +{ + return (FILE *) 1; +} + +static inline struct mntent *getmntent (FILE *stream) +{ + static struct mntent mntent = { + .mnt_dir = "/sys", + .mnt_type = "sysfs" + }; + + return &mntent; +} + +static inline int endmntent (FILE *stream) +{ + return 0; +} + +#endif /* _MNTENT_H */ +#endif /* __KLIBC__ */ |