Release Cosmopolitan v3.2

This commit is contained in:
Justine Tunney 2024-01-04 08:25:37 -08:00
parent 873069fcd7
commit a3deef70c2
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
11 changed files with 75 additions and 18 deletions

View file

@ -20,10 +20,10 @@
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/fmt/libgen.h"
#include "libc/serialize.h"
#include "libc/limits.h"
#include "libc/macros.internal.h"
#include "libc/mem/gc.internal.h"
#include "libc/serialize.h"
#include "libc/str/str.h"
#include "libc/testlib/testlib.h"
@ -33,6 +33,7 @@ void SetUpOnce(void) {
}
TEST(__getcwd, zero) {
if (IsQemu()) return;
ASSERT_SYS(ERANGE, -1, __getcwd(0, 0));
}

View file

@ -18,7 +18,9 @@
*/
#include "libc/calls/calls.h"
#include "libc/calls/metalfile.internal.h"
#include "libc/calls/syscall-nt.internal.h"
#include "libc/calls/syscall-sysv.internal.h"
#include "libc/calls/syscall_support-sysv.internal.h"
#include "libc/dce.h"
#include "libc/limits.h"
#include "libc/runtime/runtime.h"
@ -58,7 +60,13 @@ void SetUpOnce(void) {
__attribute__((__constructor__)) static void Child(int argc, char *argv[]) {
if (argc >= 2 && !strcmp(argv[1], "Child")) {
if (sys_chdir("/")) {
int rc;
if (!IsWindows()) {
rc = sys_chdir("/");
} else {
rc = sys_chdir_nt("/");
}
if (rc) {
exit(122);
}
if (strcmp(argv[2], GetProgramExecutableName())) {
@ -105,6 +113,13 @@ TEST(GetProramExecutableName, weirdArgv0NullEnv) {
TEST(GetProgramExecutableName, movedSelf) {
if (skiptests) return;
if (IsAarch64() && IsQemu()) {
// clang-format off
// TODO(mrdomino): fix: make -j8 m=aarch64 o/aarch64/test/libc/calls/getprogramexecutablename_test.com.ok
// possibly related to the intersection of binfmt_misc and qemu-aarch64
// clang-format on
return;
}
char buf[BUFSIZ];
ASSERT_SYS(0, 3, open(GetProgramExecutableName(), O_RDONLY));
ASSERT_SYS(0, 4, creat("test", 0755));

View file

@ -70,6 +70,7 @@ TEST(madvise, subPages) {
TEST(madvise, misalign) {
char *p;
if (!IsLinux()) return; // most platforms don't care
if (IsQemu()) return; // qemu claims to be linux but doesn't care
ASSERT_NE(MAP_FAILED, (p = mmap(0, FRAMESIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)));
ASSERT_SYS(EINVAL, -1, madvise(p + 1, FRAMESIZE - 1, MADV_WILLNEED));
@ -78,6 +79,7 @@ TEST(madvise, misalign) {
TEST(madvise, badAdvice) {
char *p;
if (IsAarch64() && IsQemu()) return; // qemu doesn't validate advice
ASSERT_NE(MAP_FAILED, (p = mmap(0, FRAMESIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)));
ASSERT_SYS(EINVAL, -1, madvise(p, FRAMESIZE, 127));
@ -85,7 +87,8 @@ TEST(madvise, badAdvice) {
}
TEST(madvise, missingMemory) {
if (!IsLinux()) return;
if (!IsLinux()) return; // most platforms don't care
if (IsQemu()) return; // qemu claims to be linux but doesn't care
ASSERT_SYS(ENOMEM, -1,
madvise((char *)0x83483838000, FRAMESIZE, MADV_WILLNEED));
}

View file

@ -126,9 +126,8 @@ TEST(writev, empty_stillPerformsIoOperation) {
ASSERT_NE(-1, (fd = open("file", O_RDONLY)));
errno = 0;
EXPECT_SYS(EBADF, -1, writev(fd, iov, ARRAYLEN(iov)));
#ifndef __aarch64__
// Can't test this due to qemu-aarch64 bug
EXPECT_EQ(-1, writev(fd, NULL, 0));
#endif
if (!(IsAarch64() && IsQemu())) {
EXPECT_EQ(-1, writev(fd, NULL, 0));
}
EXPECT_NE(-1, close(fd));
}

View file

@ -81,7 +81,7 @@ TEST(tmpfile, test) {
}
#ifndef __aarch64__
// TODO(jart): Find way to detect qemu-aarch64
// TODO(jart): Why does this apply to pi and qemu-aarch64?
TEST(tmpfile, renameToRealFile) {
if (!(IsLinux() && __is_linux_2_6_23())) return; // need non-ancient linux
FILE *f;