Make improvements

- Improved async signal safety of read() particularly for longjmp()
- Started adding cancel cleanup handlers for locks / etc on Windows
- Make /dev/tty work better particularly for uses like `foo | less`
- Eagerly read console input into a linked list, so poll can signal
- Fix some libc definitional bugs, which configure scripts detected
This commit is contained in:
Justine Tunney 2023-09-21 07:30:39 -07:00
parent d6c2830850
commit 0c5dd7b342
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
85 changed files with 1062 additions and 671 deletions

View file

@ -30,6 +30,7 @@
#include "libc/runtime/memtrack.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
__static_yoink("strerror_wr");
@ -69,11 +70,10 @@ relegated void __check_fail(const char *suffix, //
va_end(va);
kprintf("\n");
}
kprintf("\t%m\n\t%s%s", SUBTLE, program_invocation_name);
kprintf("\t%s\n\t%s%s", strerror(errno), SUBTLE, program_invocation_name);
for (i = 1; i < __argc; ++i) {
kprintf(" %s", __argv[i]);
}
kprintf("%s\n", RESET);
__die();
__builtin_unreachable();
}

View file

@ -47,7 +47,7 @@ relegated wontreturn void __die(void) {
strcpy(host, "unknown");
gethostname(host, sizeof(host));
kprintf("%serror: %s on %s pid %d tid %d has perished%s\n"
" cosmoaddr2line %s%s %s\n",
"cosmoaddr2line %s%s %s\n",
__nocolor ? "" : "\e[1;31m", program_invocation_short_name, host,
getpid(), gettid(), __nocolor ? "" : "\e[0m", __argv[0],
endswith(__argv[0], ".com") ? ".dbg" : "",