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

@ -25,11 +25,6 @@
#include "libc/testlib/testlib.h"
void SetUpOnce(void) {
if (!IsWindows()) {
// TODO(jart): mock out that win32 i/o call
tinyprint(2, program_invocation_name, ": skipping on non-windows\n", NULL);
exit(0);
}
testlib_enable_tmp_setup_teardown();
}
@ -197,16 +192,3 @@ TEST(GetDosArgv, cmdToil) {
free(argv);
free(buf);
}
TEST(GetDosArgv, canonicalizesCurrentDirectoryCommandPath) {
size_t max = 4;
size_t size = ARG_MAX / 2;
char *buf = malloc(size * sizeof(char));
char **argv = malloc(max * sizeof(char *));
ASSERT_SYS(0, 0, touch("emacs.com", 0755));
EXPECT_EQ(1, GetDosArgv(u"emacs.com", buf, size, argv, max));
EXPECT_STREQ(".\\emacs.com", argv[0]);
EXPECT_EQ(NULL, argv[1]);
free(argv);
free(buf);
}