mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-01 03:53:33 +00:00
1eb6484c9c
This change addresses a bug that was reported in #923 where bash on Windows behaved strangely. It turned out that our weak linking of malloc() caused bash's configure script to favor its own getcwd() function, which is implemented in the most astonishing way, using opendir() and readdir() to recursively construct the current path. This change moves getcwd() into LIBC_STDIO so it can strongly link malloc(). A new __getcwd() function is now introduced, so all the low-level runtime services can still use the actual system call. It provides the Linux Kernel API convention across platforms, and is overall a higher-quality implementation than what we had before. In the future, we should probably take a closer look into why bash's getcwd() polyfill wasn't working as intended on Windows, since there might be a potential opportunity there to improve our readdir() too. |
||
---|---|---|
.. | ||
_gc_free.c | ||
alg.h | ||
aligned_alloc.c | ||
alloca.h | ||
arraylist.internal.h | ||
arraylist2.internal.h | ||
bisect.internal.h | ||
bsearch.c | ||
bsearch_r.c | ||
bulk_free.c | ||
calloc.c | ||
critbit0.h | ||
critbit0_allprefixed.c | ||
critbit0_clear.c | ||
critbit0_contains.c | ||
critbit0_delete.c | ||
critbit0_emplace.c | ||
critbit0_get.c | ||
critbit0_insert.c | ||
free.c | ||
gc.c | ||
gc.h | ||
gc.internal.h | ||
heapsort.c | ||
hook.internal.h | ||
hook_realloc_in_place.c | ||
internal.h | ||
mallinfo.c | ||
malloc.c | ||
malloc_inspect_all.c | ||
malloc_trim.c | ||
malloc_usable_size.c | ||
mallopt.c | ||
mem.h | ||
mem.mk | ||
memalign.c | ||
mergesort.c | ||
posix_memalign.c | ||
putenv.c | ||
pvalloc.c | ||
qsort.c | ||
radix_sort_int32.c | ||
radix_sort_int64.c | ||
realloc.c | ||
reallocarray.c | ||
realpath.c | ||
reverse.internal.h | ||
setenv.c | ||
shuffle.internal.h | ||
sortedints.c | ||
sortedints.internal.h | ||
strdup.c | ||
strndup.c | ||
valloc.c | ||
wcsdup.c |