feat(userspace/libc): support for linux target

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-03-17 23:18:54 +00:00
parent 8258d40115
commit 7e69b8f82a
27 changed files with 1379 additions and 48 deletions

View File

@ -166,8 +166,10 @@ export char *strerror(int errnum)
return (char *)"State not recoverable";
case ENOTSOCK:
return (char *)"Not a socket";
#if ENOTSUP != EOPNOTSUPP
case ENOTSUP:
return (char *)"Not supported";
#endif
case ENOTTY:
return (char *)"Inappropriate I/O control operation";
case ENXIO:

View File

@ -1700,3 +1700,21 @@ export double yn(int n, double x)
}
return by;
}
void sincos(double x, double *s, double *c)
{
*s = sin(x);
*c = cos(x);
}
void sincosf(float x, float *s, float *c)
{
*s = sinf(x);
*c = cosf(x);
}
void sincosl(long double x, long double *s, long double *c)
{
*s = sinl(x);
*c = cosl(x);
}

View File

@ -65,6 +65,14 @@ export int sigaction(int sig, const struct sigaction *restrict act, struct sigac
export int sigaddset(sigset_t *set, int signo)
{
#ifndef SIGNAL_MAX
#ifdef NSIG
#define SIGNAL_MAX NSIG
#else
#error "NSIG is not defined"
#endif // NSIG
#endif // SIGNAL_MAX
if (set == NULL || signo <= 0 || signo >= SIGNAL_MAX)
{
errno = EINVAL;

View File

@ -563,8 +563,10 @@ export char *strsignal(int signum)
{
switch (signum)
{
#ifdef SIGNULL
case SIGNULL:
return "NULL signal";
#endif
case SIGABRT:
return "Aborted";
case SIGALRM: