user: implement mlibc as the libc, finally.

It's finally done..

Signed-off-by: kaguya <vpshinomiya@protonmail.com>
This commit is contained in:
kaguya
2026-05-02 03:31:49 -04:00
parent 2fa39ad85a
commit 9a9b91c940
2387 changed files with 152741 additions and 315 deletions
@@ -0,0 +1,32 @@
#ifndef MLIBC_GLIBC_ASSERT_H
#define MLIBC_GLIBC_ASSERT_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __MLIBC_ABI_ONLY
__attribute__ ((__noreturn__)) void __assert_fail_perror(int __errno, const char *__file, unsigned int __line,
const char *__function);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* MLIBC_GLIBC_ASSERT_H */
#ifdef NDEBUG
#undef assert_perror
#define assert_perror(ignore) ((void)0)
#else /* NDEBUG */
#undef assert_perror
#define assert_perror(errno) (!(errno) \
|| (__assert_fail_perror((errno), __FILE__, __LINE__, __func__), 0))
#endif /* NDEBUG */
@@ -0,0 +1,21 @@
#ifndef _GLIBC_NETINET_ICMP6_H
#define _GLIBC_NETINET_ICMP6_H
#ifdef __cplusplus
extern "C" {
#endif
#define ND_OPT_SOURCE_LINKADDR 1
#define ND_OPT_TARGET_LINKADDR 2
#define ND_OPT_PREFIX_INFORMATION 3
#define ND_OPT_REDIRECTED_HEADER 4
#define ND_OPT_MTU 5
#define ND_OPT_RTR_ADV_INTERVAL 7
#define ND_OPT_HOME_AGENT_INFO 8
#ifdef __cplusplus
}
#endif
#endif /* _GLIBC_NETINET_ICMP6_H */
@@ -0,0 +1,17 @@
#ifndef _GLIBC_MALLOC_H
#define _GLIBC_MALLOC_H
#ifdef __cplusplus
extern "C" {
#endif
#include <bits/size_t.h>
size_t malloc_usable_size(void *__ptr);
#ifdef __cplusplus
}
#endif
#endif /* _GLIBC_MALLOC_H */
@@ -0,0 +1,22 @@
#ifndef _GLIBC_SEARCH_H
#define _GLIBC_SEARCH_H
#ifdef __cplusplus
extern "C" {
#endif
#include <bits/search.h>
#ifndef __MLIBC_ABI_ONLY
int hcreate_r(size_t __num_entries, struct hsearch_data *__htab);
void hdestroy_r(struct hsearch_data *__htab);
int hsearch_r(ENTRY __item, ACTION __action, ENTRY **__ret, struct hsearch_data *__htab);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _GLIBC_SEARCH_H */
@@ -0,0 +1,24 @@
#ifndef MLIBC_GLIBC_SIGNAL_H
#define MLIBC_GLIBC_SIGNAL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __MLIBC_ABI_ONLY
int tgkill(int __tgid, int __tid, int __sig);
#if defined(_GNU_SOURCE)
typedef void (*sighandler_t)(int __signo);
#endif
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* MLIBC_GLIBC_SIGNAL_H */
@@ -0,0 +1,20 @@
#ifndef MLIBC_GLIBC_STDLIB_H
#define MLIBC_GLIBC_STDLIB_H
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*comparison_fn_t) (const void *__a, const void *__b);
#ifndef __MLIBC_ABI_ONLY
int rpmatch(const char *__resp);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* MLIBC_GLIBC_STDLIB_H */