Make improvements

- More timspec_*() and timeval_*() APIs have been introduced.
- The copyfd() function is now simplified thanks to POSIX rules.
- More Cosmo-specific APIs have been moved behind the COSMO define.
- The setitimer() polyfill for Windows NT is now much higher quality.
- Fixed build error for MODE=aarch64 due to -mstringop-strategy=loop.
- This change introduces `make MODE=nox87 toolchain` which makes it
  possible to build programs using your cosmocc toolchain that don't
  have legacy fpu instructions. This is useful, for example, if you
  want to have a ~22kb tinier blink virtual machine.
This commit is contained in:
Justine Tunney 2023-06-15 13:50:42 -07:00
parent 8dc11afcf6
commit c3440d040c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
132 changed files with 539 additions and 587 deletions

View file

@ -21,7 +21,6 @@
#include "libc/errno.h"
#include "libc/intrin/kprintf.h"
#include "libc/macros.internal.h"
#include "libc/mem/copyfd.internal.h"
#include "libc/mem/mem.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
@ -58,7 +57,7 @@ void SetUpOnce(void) {
ASSERT_NE(-1, mkdir("bin", 0755));
ASSERT_NE(-1, (fdin = open("/zip/plinko.com", O_RDONLY)));
ASSERT_NE(-1, (fdout = creat("bin/plinko.com", 0755)));
ASSERT_NE(-1, _copyfd(fdin, fdout, -1));
ASSERT_NE(-1, copyfd(fdin, fdout, -1));
EXPECT_EQ(0, close(fdout));
EXPECT_EQ(0, close(fdin));
}
@ -100,7 +99,7 @@ TEST(plinko, worksOrPrintsNiceError) {
close(pfds[1][1]);
for (i = 0; i < ARRAYLEN(kSauces); ++i) {
EXPECT_NE(-1, (fdin = open(kSauces[i], O_RDONLY)));
rc = _copyfd(fdin, pfds[0][1], -1);
rc = copyfd(fdin, pfds[0][1], -1);
if (rc == -1) EXPECT_EQ(EPIPE, errno);
EXPECT_NE(-1, close(fdin));
}