Fix bugs and make improvements

- Get clone() working on FreeBSD
- Increase some Python build quotas
- Add more atomic builtins to chibicc
- Fix ASAN poisoning of alloca() memory
- Make MODE= mandatory link path tinier
- Improve the examples folder a little bit
- Start working on some more resource limits
- Make the linenoise auto-complete UI as good as GNU readline
- Update compile.com, avoiding AVX codegen on non-AVX systems
- Make sure empty path to syscalls like opendir raises ENOENT
- Correctly polyfill ENOENT vs. ENOTDIR on the New Technology
- Port bestline's paredit features to //third_party/linenoise
- Remove workarounds for RHEL 5.0 bugs that were fixed in 5.1
This commit is contained in:
Justine Tunney 2022-04-20 09:56:53 -07:00
parent c3fb624647
commit ae638c0850
181 changed files with 2994 additions and 1367 deletions

View file

@ -31,15 +31,6 @@ struct thr_param {
struct rtprio *rtp;
};
static inline wontreturn void thr_exit(int64_t *opt_out_state) {
long ax, di;
asm volatile("syscall"
: "=a"(ax)
: "0"(431), "D"(opt_out_state)
: "memory", "cc");
unreachable;
}
static inline int thr_new(struct thr_param *param, int param_size) {
bool failed;
long ax, di, si;
@ -51,62 +42,6 @@ static inline int thr_new(struct thr_param *param, int param_size) {
return ax;
}
static inline int thr_kill(int64_t id, int sig) {
bool failed;
long ax, di, si;
asm volatile(CFLAG_ASM("syscall")
: CFLAG_CONSTRAINT(failed), "=a"(ax), "=D"(di), "=S"(si)
: "1"(433), "2"(id), "3"(sig)
: "rcx", "rdx", "r8", "r9", "r10", "r11", "memory");
if (failed) ax = -ax;
return ax;
}
static inline int thr_suspend(const struct timespec *opt_timeout) {
bool failed;
long ax, di;
asm volatile(CFLAG_ASM("syscall")
: CFLAG_CONSTRAINT(failed), "=a"(ax), "=D"(di)
: "1"(442), "2"(opt_timeout)
: "rcx", "rdx", "rsi", "r8", "r9", "r10", "r11", "memory");
if (failed) ax = -ax;
return ax;
}
static inline int thr_wake(int64_t id) {
bool failed;
long ax, di;
asm volatile(CFLAG_ASM("syscall")
: CFLAG_CONSTRAINT(failed), "=a"(ax), "=D"(di)
: "1"(443), "2"(id)
: "rcx", "rdx", "rsi", "r8", "r9", "r10", "r11", "memory");
if (failed) ax = -ax;
return ax;
}
static inline int thr_set_name(int64_t id, const char *name) {
bool failed;
long ax, di, si;
asm volatile(CFLAG_ASM("syscall")
: CFLAG_CONSTRAINT(failed), "=a"(ax), "=D"(di), "=S"(si)
: "1"(464), "2"(id), "3"(name)
: "rcx", "rdx", "r8", "r9", "r10", "r11", "memory");
if (failed) ax = -ax;
return ax;
}
static inline int thr_kill2(int pid, int64_t id, int sig) {
bool failed;
long ax, di, si, dx;
asm volatile(CFLAG_ASM("syscall")
: CFLAG_CONSTRAINT(failed), "=a"(ax), "=D"(di), "=S"(si),
"=d"(dx)
: "1"(481), "2"(pid), "3"(id), "4"(sig)
: "rcx", "r8", "r9", "r10", "r11", "memory");
if (failed) ax = -ax;
return ax;
}
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_THREAD_FREEBSD_INTERNAL_H_ */