diff --git mlibc-clean/abis/linux/in.h mlibc-workdir/abis/linux/in.h index 87bc25f..d7370d0 100644 --- mlibc-clean/abis/linux/in.h +++ mlibc-workdir/abis/linux/in.h @@ -109,6 +109,9 @@ struct group_source_req { #define IPPORT_RESERVED 1024 +#define IP_MULTICAST_TTL 33 +#define IPV6_MULTICAST_HOPS 18 + #define IPPROTO_IP 0 #define IPPROTO_HOPOPTS 0 #define IPPROTO_ICMP 1 diff --git mlibc-clean/options/ansi/generic/environment.cpp mlibc-workdir/options/ansi/generic/environment.cpp index 5625592..36b42ee 100644 --- mlibc-clean/options/ansi/generic/environment.cpp +++ mlibc-workdir/options/ansi/generic/environment.cpp @@ -111,8 +111,10 @@ namespace mlibc { int putenv(char *string) { frg::string_view view{string}; size_t s = view.find_first('='); - if(s == size_t(-1)) - __ensure(!"Environment strings need to contain an equals sign"); + if(s == size_t(-1)) { + unsetenv(string); + return 0; + } update_vector(); assign_variable(view.sub_string(0, s), string, true); diff --git mlibc-clean/options/ansi/generic/string-stubs.cpp mlibc-workdir/options/ansi/generic/string-stubs.cpp index 8defd0e..d6cb65b 100644 --- mlibc-clean/options/ansi/generic/string-stubs.cpp +++ mlibc-workdir/options/ansi/generic/string-stubs.cpp @@ -406,7 +406,6 @@ char *strerror(int e) { case ENOPROTOOPT: s = "Protocol not available (ENOPROTOOPT)"; break; case ENOTEMPTY: s = "Directory not empty (ENOTEMPTY)"; break; case ENOTRECOVERABLE: s = "Sate not recoverable (ENOTRECOVERABLE)"; break; - case ENOTSUP: s = "Operation not supported (ENOTSUP)"; break; case ENOTTY: s = "Inappropriate ioctl for device (ENOTTY)"; break; case EOVERFLOW: s = "Value too large for defined datatype (EOVERFLOW)"; break; #if EOPNOTSUPP != ENOTSUP diff --git mlibc-clean/options/crypt/generic/crypt-stubs.cpp mlibc-workdir/options/crypt/generic/crypt-stubs.cpp index 65e0d23..95b060c 100644 --- mlibc-clean/options/crypt/generic/crypt-stubs.cpp +++ mlibc-workdir/options/crypt/generic/crypt-stubs.cpp @@ -1,7 +1,8 @@ #include #include +#include -char *crypt(const char *, const char *) { +char *crypt(const char *passwd, const char *) { __ensure(!"Not implemented"); __builtin_unreachable(); } diff --git mlibc-clean/options/glibc/generic/execinfo.cpp mlibc-workdir/options/glibc/generic/execinfo.cpp index 3474615..e034881 100644 --- mlibc-clean/options/glibc/generic/execinfo.cpp +++ mlibc-workdir/options/glibc/generic/execinfo.cpp @@ -1,9 +1,10 @@ #include #include +#include int backtrace(void **, int) { - __ensure(!"Not implemented"); - __builtin_unreachable(); + mlibc::infoLogger() << "libc: backtrace() is not implemented!\n" << frg::endlog; + return 0; } char **backtrace_symbols(void *const *, int) { diff --git mlibc-clean/options/posix/generic/dlfcn-stubs.cpp mlibc-workdir/options/posix/generic/dlfcn-stubs.cpp index fc34a3b..b1a95a9 100644 --- mlibc-clean/options/posix/generic/dlfcn-stubs.cpp +++ mlibc-workdir/options/posix/generic/dlfcn-stubs.cpp @@ -1,4 +1,4 @@ - +#define _GNU_SOURCE #include #include diff --git mlibc-clean/options/posix/generic/unistd-stubs.cpp mlibc-workdir/options/posix/generic/unistd-stubs.cpp index 444ad22..d1ca86e 100644 --- mlibc-clean/options/posix/generic/unistd-stubs.cpp +++ mlibc-workdir/options/posix/generic/unistd-stubs.cpp @@ -484,8 +484,9 @@ int lockf(int fd, int op, off_t size) { } int nice(int) { - __ensure(!"Not implemented"); - __builtin_unreachable(); + return EPERM; + //__ensure(!"Not implemented"); + //__builtin_unreachable(); } long pathconf(const char *, int name) { diff --git mlibc-clean/options/rtld/generic/main.cpp mlibc-workdir/options/rtld/generic/main.cpp index 9219ef0..1ff679c 100644 --- mlibc-clean/options/rtld/generic/main.cpp +++ mlibc-workdir/options/rtld/generic/main.cpp @@ -17,6 +17,8 @@ #include "elf.hpp" #include "linker.hpp" +#define _GNU_SOURCE + #if __MLIBC_POSIX_OPTION #include #endif