mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Unbloat build config
- 10.5% reduction of o//depend dependency graph - 8.8% reduction in latency of make command - Fix issue with temporary file cleanup There's a new -w option in compile.com that turns off the recent Landlock output path workaround for "good commands" which do not unlink() the output file like GNU tooling does. Our new GNU Make unveil sandboxing appears to have zero overhead in the grand scheme of things. Full builds are pretty fast since the only thing that's actually slowed us down is probably libcxx make -j16 MODE=rel RL: took 85,732,063µs wall time RL: ballooned to 323,612kb in size RL: needed 828,560,521µs cpu (11% kernel) RL: caused 39,080,670 page faults (99% memcpy) RL: 350,073 context switches (72% consensual) RL: performed 0 reads and 11,494,960 write i/o operations pledge() and unveil() no longer consider ENOSYS to be an error. These functions have also been added to Python's cosmo module. This change also removes some WIN32 APIs and System Five magnums which we're not using and it's doubtful anyone else would be too
This commit is contained in:
parent
133c693650
commit
ae5d06dc53
1423 changed files with 2213 additions and 5560 deletions
|
@ -59,6 +59,20 @@ TEST(_timespec_frommicros, test) {
|
|||
_timespec_eq((struct timespec){0, 2000}, _timespec_frommicros(2)));
|
||||
EXPECT_TRUE(
|
||||
_timespec_eq((struct timespec){1}, _timespec_frommicros(1000000)));
|
||||
EXPECT_TRUE(_timespec_eq((struct timespec){2, 123000},
|
||||
_timespec_frommicros(2000123)));
|
||||
}
|
||||
|
||||
TEST(_timespec_tomillis, test) {
|
||||
EXPECT_EQ(2123, _timespec_tomillis((struct timespec){2, 123000000}));
|
||||
}
|
||||
|
||||
TEST(_timespec_tomicros, test) {
|
||||
EXPECT_EQ(2000123, _timespec_tomicros((struct timespec){2, 123000}));
|
||||
}
|
||||
|
||||
TEST(_timespec_tonanos, test) {
|
||||
EXPECT_EQ(2000123000, _timespec_tonanos((struct timespec){2, 123000}));
|
||||
}
|
||||
|
||||
static long mod(long x, long y) {
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(access, efault) {
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(chdir, efault) {
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/calls/syscall_support-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/nexgen32e/rdtsc.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sysv/consts/auxv.h"
|
||||
|
|
|
@ -40,8 +40,7 @@ char pathbuf[PATH_MAX];
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
void SetUp(void) {
|
||||
|
|
|
@ -33,8 +33,9 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr proc exec", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0,
|
||||
pledge("stdio rpath wpath cpath fattr proc exec prot_exec",
|
||||
"stdio rpath wpath prot_exec"));
|
||||
}
|
||||
|
||||
static textstartup void TestInit(int argc, char **argv) {
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(fcntl_getfl, testRemembersAccessMode) {
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(fileexists, test) {
|
||||
|
|
|
@ -33,8 +33,7 @@ struct stat st;
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath", 0));
|
||||
}
|
||||
|
||||
TEST(ftruncate, test) {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/log/check.h"
|
||||
|
@ -29,8 +28,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(getcwd, test) {
|
||||
|
|
|
@ -28,8 +28,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr proc", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr proc", 0));
|
||||
}
|
||||
|
||||
TEST(lseek, wat) {
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
@ -31,8 +32,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
void SetUp(void) {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "libc/calls/struct/itimerval.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/sysv/consts/itimer.h"
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
#include "libc/calls/internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
@ -28,8 +30,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(open, efault) {
|
||||
|
@ -51,7 +52,7 @@ TEST(open, enotdir) {
|
|||
|
||||
TEST(open, eexist) {
|
||||
ASSERT_SYS(0, 0, touch("exists", 0644));
|
||||
ASSERT_SYS(EEXIST, -1, open("exists", O_WRONLY | O_CREAT | O_EXCL));
|
||||
ASSERT_SYS(EEXIST, -1, open("exists", O_WRONLY | O_CREAT | O_EXCL, 0644));
|
||||
}
|
||||
|
||||
TEST(open, doubleSlash_worksAndGetsNormalizedOnWindows) {
|
||||
|
|
61
test/libc/calls/openbsd_test.c
Normal file
61
test/libc/calls/openbsd_test.c
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2022 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
#define SPAWN(METHOD) \
|
||||
{ \
|
||||
int ws, pid; \
|
||||
ASSERT_NE(-1, (pid = METHOD())); \
|
||||
if (!pid) {
|
||||
|
||||
#define EXITS(rc) \
|
||||
_Exit(0); \
|
||||
} \
|
||||
ASSERT_NE(-1, wait(&ws)); \
|
||||
ASSERT_TRUE(WIFEXITED(ws)); \
|
||||
ASSERT_EQ(rc, WEXITSTATUS(ws)); \
|
||||
}
|
||||
|
||||
#define TERMS(sig) \
|
||||
_Exit(0); \
|
||||
} \
|
||||
ASSERT_NE(-1, wait(&ws)); \
|
||||
ASSERT_TRUE(WIFSIGNALED(ws)); \
|
||||
ASSERT_EQ(sig, WTERMSIG(ws)); \
|
||||
}
|
||||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
TEST(pledge, promisedSyscallsCanBeCalled_ieEnosysIsIgnored) {
|
||||
SPAWN(fork);
|
||||
EXPECT_SYS(0, 0, pledge("stdio", 0));
|
||||
EXPECT_SYS(0, 0, read(0, 0, 0));
|
||||
EXITS(0);
|
||||
}
|
||||
|
||||
TEST(unveil, pathBecomeVisible_ieEnosysIsIgnored) {
|
||||
SPAWN(fork);
|
||||
EXPECT_SYS(0, 0, touch("foo", 0644));
|
||||
EXPECT_SYS(0, 0, unveil("foo", "r"));
|
||||
EXPECT_SYS(0, 0, unveil(0, 0));
|
||||
EXPECT_SYS(0, 3, open("foo", O_RDONLY));
|
||||
EXITS(0);
|
||||
}
|
|
@ -21,6 +21,7 @@
|
|||
#include "libc/calls/struct/seccomp.h"
|
||||
#include "libc/calls/syscall_support-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/promises.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
@ -98,7 +99,7 @@ TEST(pledge, testLogMessage_inSoftyMode) {
|
|||
read(fds[0], msg, sizeof(msg));
|
||||
close(fds[0]);
|
||||
if (IsLinux()) {
|
||||
ASSERT_STARTSWITH("error: maybe pledge inet", msg);
|
||||
ASSERT_STARTSWITH("error: pledge inet for socket", msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,7 +117,7 @@ TEST(pledge, testLogMessage_onKillProcess) {
|
|||
read(fds[0], msg, sizeof(msg));
|
||||
close(fds[0]);
|
||||
if (IsLinux()) {
|
||||
ASSERT_STARTSWITH("error: maybe pledge inet", msg);
|
||||
ASSERT_STARTSWITH("error: pledge inet for socket", msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ int extract(const char *from, const char *to, int mode) {
|
|||
}
|
||||
|
||||
void SetUp(void) {
|
||||
__enable_threads();
|
||||
if (!__is_linux_2_6_23() && !IsOpenbsd()) exit(0);
|
||||
ASSERT_SYS(0, 0, extract("/zip/life.elf", "life.elf", 0755));
|
||||
ASSERT_SYS(0, 0, extract("/zip/sock.elf", "sock.elf", 0755));
|
||||
|
|
|
@ -25,8 +25,7 @@ char buf[8];
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(pread, testReadPastEof_returnsZero) {
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
#include "libc/x/x.h"
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath tty proc", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath tty proc", 0));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,8 +26,7 @@ struct stat st;
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(pwrite, testWritePastEof_extendsFile) {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/x.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/gc.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
|
@ -33,8 +32,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(readlink, enoent) {
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(rename, enoent) {
|
||||
|
|
|
@ -29,7 +29,9 @@
|
|||
#include "libc/macros.internal.h"
|
||||
#include "libc/nexgen32e/threaded.h"
|
||||
#include "libc/rand/rand.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/clone.h"
|
||||
#include "libc/sysv/consts/itimer.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
|
@ -48,6 +50,11 @@ STATIC_YOINK("libc/testlib/hyperion.txt");
|
|||
|
||||
#define THREADS 8
|
||||
|
||||
void SetUpOnce(void) {
|
||||
__enable_threads();
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath", 0));
|
||||
}
|
||||
|
||||
void PullSomeZipFilesIntoLinkage(void) {
|
||||
gmtime(0);
|
||||
}
|
||||
|
|
|
@ -34,8 +34,7 @@
|
|||
#include "tool/net/sandbox.h"
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio proc", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio proc", 0));
|
||||
}
|
||||
|
||||
// It's been reported that Chromebooks return EINVAL here.
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
bool gotsig;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio", 0));
|
||||
}
|
||||
|
||||
void OnSigAlrm(int sig, siginfo_t *si, ucontext_t *ctx) {
|
||||
|
|
|
@ -34,8 +34,7 @@ struct sigaction oldsa;
|
|||
volatile bool gotsigint;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath proc", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath proc", 0));
|
||||
}
|
||||
|
||||
void OnSigInt(int sig) {
|
||||
|
|
|
@ -31,8 +31,7 @@ testonly void OnUsr1(int sig) {
|
|||
}
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio proc", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio proc", 0));
|
||||
}
|
||||
|
||||
TEST(signal, test) {
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
volatile int n;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio proc", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio proc", 0));
|
||||
}
|
||||
|
||||
void OnSig(int sig, siginfo_t *si, ucontext_t *ctx) {
|
||||
|
|
|
@ -37,8 +37,7 @@ STATIC_YOINK("zip_uri_support");
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(stat_010, testEmptyFile_sizeIsZero) {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/rand/rand.h"
|
||||
|
@ -31,8 +32,7 @@ char p[2][PATH_MAX];
|
|||
struct stat st;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(symlink, enoent) {
|
||||
|
|
|
@ -73,13 +73,13 @@ o/$(MODE)/test/libc/calls/%.com.dbg: \
|
|||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/test/libc/calls/tiny64.elf.zip.o: test/libc/calls/tiny64.elf
|
||||
@$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) -B $(OUTPUT_OPTION) $<
|
||||
@$(COMPILE) -wAZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) -B $(OUTPUT_OPTION) $<
|
||||
|
||||
o/$(MODE)/test/libc/calls/life-nomod.com.zip.o: o/$(MODE)/test/libc/calls/life-nomod.com
|
||||
@$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) -B $(OUTPUT_OPTION) $<
|
||||
@$(COMPILE) -wAZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) -B $(OUTPUT_OPTION) $<
|
||||
|
||||
o/$(MODE)/test/libc/calls/life-classic.com.zip.o: o/$(MODE)/test/libc/calls/life-classic.com
|
||||
@$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) -B $(OUTPUT_OPTION) $<
|
||||
@$(COMPILE) -wAZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) -B $(OUTPUT_OPTION) $<
|
||||
|
||||
o/$(MODE)/test/libc/calls/life-classic.com.dbg: \
|
||||
$(LIBC_RUNTIME) \
|
||||
|
|
|
@ -18,14 +18,14 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/sysv/consts/at.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(unlink, efault) {
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/mem/io.h"
|
||||
#include "libc/runtime/gc.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
@ -72,6 +73,7 @@ static bool SupportsLandlock(void) {
|
|||
}
|
||||
|
||||
void SetUpOnce(void) {
|
||||
__enable_threads();
|
||||
if (!(IsLinux() && SupportsLandlock()) && !IsOpenbsd()) exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(utimensat, test) {
|
||||
|
|
|
@ -32,8 +32,7 @@
|
|||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath fattr", 0);
|
||||
errno = 0;
|
||||
ASSERT_SYS(0, 0, pledge("stdio rpath wpath cpath fattr", 0));
|
||||
}
|
||||
|
||||
TEST(writev, test) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue