cosmopolitan/libc/str
Justine Tunney 791f79fcb3
Make improvements
- We now serialize the file descriptor table when spawning / executing
  processes on Windows. This means you can now inherit more stuff than
  just standard i/o. It's needed by bash, which duplicates the console
  to file descriptor #255. We also now do a better job serializing the
  environment variables, so you're less likely to encounter E2BIG when
  using your bash shell. We also no longer coerce environ to uppercase

- execve() on Windows now remotely controls its parent process to make
  them spawn a replacement for itself. Then it'll be able to terminate
  immediately once the spawn succeeds, without having to linger around
  for the lifetime as a shell process for proxying the exit code. When
  process worker thread running in the parent sees the child die, it's
  given a handle to the new child, to replace it in the process table.

- execve() and posix_spawn() on Windows will now provide CreateProcess
  an explicit handle list. This allows us to remove handle locks which
  enables better fork/spawn concurrency, with seriously correct thread
  safety. Other codebases like Go use the same technique. On the other
  hand fork() still favors the conventional WIN32 inheritence approach
  which can be a little bit messy, but is *controlled* by guaranteeing
  perfectly clean slates at both the spawning and execution boundaries

- sigset_t is now 64 bits. Having it be 128 bits was a mistake because
  there's no reason to use that and it's only supported by FreeBSD. By
  using the system word size, signal mask manipulation on Windows goes
  very fast. Furthermore @asyncsignalsafe funcs have been rewritten on
  Windows to take advantage of signal masking, now that it's much more
  pleasant to use.

- All the overlapped i/o code on Windows has been rewritten for pretty
  good signal and cancelation safety. We're now able to ensure overlap
  data structures are cleaned up so long as you don't longjmp() out of
  out of a signal handler that interrupted an i/o operation. Latencies
  are also improved thanks to the removal of lots of "busy wait" code.
  Waits should be optimal for everything except poll(), which shall be
  the last and final demon we slay in the win32 i/o horror show.

- getrusage() on Windows is now able to report RUSAGE_CHILDREN as well
  as RUSAGE_SELF, thanks to aggregation in the process manager thread.
2023-10-08 08:59:53 -07:00
..
a64l.c Add base64 support 2021-03-27 18:17:54 -07:00
bcmp.c Make improvements 2023-09-06 12:34:59 -07:00
blake2.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
blake2.h Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
blocks.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
btowc.c Make improvements 2023-09-06 12:34:59 -07:00
c16rtomb.c Fix warnings 2023-09-01 20:50:18 -07:00
c32rtomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
chomp.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
chomp16.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
compareslices.c Refactor out some duplicated code 2021-08-14 06:17:56 -07:00
compareslicescase.c Refactor out some duplicated code 2021-08-14 06:17:56 -07:00
crc32c.c Brush up some more code 2023-07-10 10:17:26 -07:00
djbsort.c Restore missing cosmopolitan documentation on website 2023-07-30 11:07:53 -07:00
dosdatetimetounix.c Make improvements 2023-10-03 06:17:16 -07:00
eastasianwidth.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
endswith.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
endswith16.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
freelocale.c Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
getcachesize.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
getx86processormodel.c Fold LIBC_ALG into LIBC_MEM 2022-08-13 08:32:34 -07:00
getzipcdircomment.c Fix warnings 2023-09-01 20:50:18 -07:00
getzipcdircommentsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcdiroffset.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcdirrecords.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcdirsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfilecompressedsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfilemode.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfileoffset.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipcfiletimestamps.c Make improvements 2023-10-03 06:17:16 -07:00
getzipcfileuncompressedsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getzipeocd.c Fix warnings 2023-09-01 20:50:18 -07:00
getziplfilecompressedsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
getziplfileuncompressedsize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
hexpcpy.c Implement pthread_atfork() 2022-10-16 12:25:13 -07:00
highwayhash64.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
highwayhash64.h Make numerous improvements 2021-09-28 01:52:34 -07:00
intsort.c Make some sorting functions faster 2023-04-24 23:11:18 -07:00
isalnum.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isalpha.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isascii.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isblank.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iscntrl.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isdigit.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isdirsep.c Fix basename() and dirname() 2022-04-06 00:13:44 -07:00
isgraph.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
islower.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isprint.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
ispunct.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isspace.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
istext.c Make improvements 2023-08-21 02:34:17 -07:00
isupper.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isutf8.c Make improvements 2023-09-18 21:04:47 -07:00
iswalnum.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswalpha.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswblank.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswcntrl.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswctype.c Improve LLVM compatibility a little bit 2021-05-16 20:34:46 -07:00
iswdigit.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswgraph.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswlower.c Fix warnings 2023-09-01 20:50:18 -07:00
iswprint.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswpunct.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswseparator.c Brush up some more code 2023-07-10 10:17:26 -07:00
iswspace.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iswupper.c Fix warnings 2023-09-01 20:50:18 -07:00
iswxdigit.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
isxdigit.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
iszipeocd32.c Remove old zip base skew hack 2023-06-17 04:20:16 -07:00
iszipeocd64.c Remove old zip base skew hack 2023-06-17 04:20:16 -07:00
kcombiningchars.S Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
keastasianwidth.S Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
khextoint.c Get LIBC_FMT to build for aarch64 2023-05-10 04:20:47 -07:00
kmonthyearday.c Remove _Hide keyword 2023-07-24 08:34:58 -07:00
kx86processormodels.c Remove _Hide keyword 2023-07-24 08:34:58 -07:00
l64a.c Add base64 support 2021-03-27 18:17:54 -07:00
langinfo.c Add imaxdiv, wcscoll, getdtablesize (#639) 2022-10-05 07:14:58 -07:00
langinfo.h Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
locale.c Get GNU GMP test suite fully passing 2023-08-21 10:16:42 -07:00
locale.h Get GNU GMP test suite fully passing 2023-08-21 10:16:42 -07:00
localeconv.c Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
longsort.c Make some sorting functions faster 2023-04-24 23:11:18 -07:00
lz4check.c Change license 2020-12-27 17:18:44 -08:00
lz4cpy.c Fix warnings 2023-09-01 20:50:18 -07:00
lz4decode.c Make _Thread_local work across platforms 2022-07-10 04:01:17 -07:00
lz4len.c Fix warnings 2023-09-01 20:50:18 -07:00
mb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mb.internal.h Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mblen.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrlen.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtoc16.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtoc32.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtowc.c Fix warnings 2023-09-01 20:50:18 -07:00
mbsinit.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbsnrtowcs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbsrtowcs.c Fix warnings 2023-09-01 20:50:18 -07:00
mbstowcs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbtowc.c Fix warnings 2023-09-01 20:50:18 -07:00
memcasecmp.c Do work on curl/mbedtls/zstd 2023-07-07 10:13:35 -07:00
memccpy.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
memchr16.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
memfrob.c Change license 2020-12-27 17:18:44 -08:00
memmem.c Make improvements 2023-09-18 21:04:47 -07:00
memrchr16.c Make improvements 2023-09-18 21:04:47 -07:00
memset16.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
newlocale.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
nltypes.h Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
path.h Remove Windows executable path guessing logic 2023-09-21 08:13:50 -07:00
rawmemchr.c Make improvements 2023-09-18 21:04:47 -07:00
rawmemchr16.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
rldecode2.c Make numerous improvements 2021-09-28 01:52:34 -07:00
setlocale.c Fix warnings 2023-09-01 20:50:18 -07:00
slice.h Fixup and polish chibicc some more 2022-06-20 04:32:25 -07:00
smoothsort.c Make improvements 2023-09-06 12:34:59 -07:00
SpecialCasing.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
startswith.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
startswith16.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
startswithi.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
stpncpy.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
str.h Make improvements 2023-09-06 12:34:59 -07:00
str.mk Make improvements 2023-10-03 06:17:16 -07:00
strcasecmp.c Make improvements 2023-09-18 21:04:47 -07:00
strcasecmp16.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
strcasestr.c Make improvements 2023-09-18 21:04:47 -07:00
strcat.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
strcat16.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
strchr16.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
strchrnul16.c Make more progress on aarch64 2023-05-10 04:20:47 -07:00
strcmp16.c Change license 2020-12-27 17:18:44 -08:00
strcoll.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
strcpy16.c Do some string library work 2022-08-20 22:17:14 -07:00
strcspn.c Get --ftrace working on aarch64 2023-06-05 23:35:31 -07:00
strcspn16.c Change license 2020-12-27 17:18:44 -08:00
strlcat.c Make improvements 2023-09-18 21:04:47 -07:00
strlcpy.c Introduce native support for MacOS ARM64 2023-05-20 04:17:03 -07:00
strlen16.c Make improvements 2023-09-18 21:04:47 -07:00
strncasecmp.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
strncasecmp16.c Tune SQLite build for redbean (#97) 2021-06-10 08:00:08 -07:00
strncat.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
strncat16.c Undiamond Python headers 2021-08-12 14:07:40 -07:00
strncmp16.c Change license 2020-12-27 17:18:44 -08:00
strncpy.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
strnlen16.c Make improvements 2023-09-18 21:04:47 -07:00
strnlen_s.c Make improvements 2023-09-18 21:04:47 -07:00
strntolower.c Change license 2020-12-27 17:18:44 -08:00
strntoupper.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strnwidth.c Clean up more code 2023-07-06 08:03:24 -07:00
strnwidth16.c Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
strpbrk.c Remove getopt_long() from headers 2023-06-17 16:03:16 -07:00
strpbrk16.c Change license 2020-12-27 17:18:44 -08:00
strrchr16.c Change license 2020-12-27 17:18:44 -08:00
strsep.c Perform some code cleanup 2021-02-27 10:33:32 -08:00
strspn.c Get --ftrace working on aarch64 2023-06-05 23:35:31 -07:00
strspn16.c Change license 2020-12-27 17:18:44 -08:00
strstr.c Make improvements 2023-09-18 21:04:47 -07:00
strstr16.c Perform some code cleanup 2021-02-27 10:33:32 -08:00
strtok.c Make improvements 2023-10-03 06:17:16 -07:00
strtok_r.c Change license 2020-12-27 17:18:44 -08:00
strtolower.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strtoupper.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strverscmp.c Improve wait statuses 2023-07-30 14:51:37 -07:00
strwidth.c Make more compatibility improvements 2022-09-06 07:04:13 -07:00
strwidth.h Make more compatibility improvements 2022-09-06 07:04:13 -07:00
strwidth16.c Make more compatibility improvements 2022-09-06 07:04:13 -07:00
strxfrm.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
tab.internal.h Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
thompike.h Fix warnings 2023-09-01 20:50:18 -07:00
timespectowindowstime.c Make improvements 2023-10-03 06:17:16 -07:00
timevaltowindowstime.c Make improvements 2023-10-03 06:17:16 -07:00
timingsafe_bcmp.c Make improvements 2023-09-06 12:34:59 -07:00
timingsafe_memcmp.c Make improvements 2023-09-06 12:34:59 -07:00
toascii.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
tolower.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
toupper.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
towctrans.c Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
towlower.c Brush up some more code 2023-07-10 10:17:26 -07:00
towupper.c Make improvements 2023-10-08 08:59:53 -07:00
tpdecodecb.internal.h Pay off more technical debt 2022-09-12 23:36:56 -07:00
tprecode8to16.c Make improvements 2023-10-08 08:59:53 -07:00
tprecode16to8.c Make improvements 2023-09-18 21:04:47 -07:00
unicode-properties.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
unicode.h Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
unicodedata.txt Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
update.sh Improve cancellations, randomness, and time 2022-11-05 23:45:32 -07:00
uselocale.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
utf16.h Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
wchomp.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
wcrtomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcscasecmp.c Change license 2020-12-27 17:18:44 -08:00
wcscat.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
wcschr.c Fix warnings 2023-09-01 20:50:18 -07:00
wcschrnul.c Fix warnings 2023-09-01 20:50:18 -07:00
wcscmp.c Make quick fix for aarch64 build 2023-07-30 15:06:28 -07:00
wcscpy.c Do some string library work 2022-08-20 22:17:14 -07:00
wcscspn.c Change license 2020-12-27 17:18:44 -08:00
wcsendswith.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
wcslen.c Make improvements 2023-09-18 21:04:47 -07:00
wcsncasecmp.c Do some string library work 2022-08-20 22:17:14 -07:00
wcsncat.c Undiamond Python headers 2021-08-12 14:07:40 -07:00
wcsncmp.c Get TEST_LIBC_STR passing on AARCH64 2023-05-12 18:09:23 -07:00
wcsncpy.c Change license 2020-12-27 17:18:44 -08:00
wcsnlen.c Get LIBC_FMT to build for aarch64 2023-05-10 04:20:47 -07:00
wcsnlen_s.c Get LIBC_FMT to build for aarch64 2023-05-10 04:20:47 -07:00
wcsnrtombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcsnwidth.c Make improvements 2023-06-06 09:12:30 -07:00
wcspbrk.c Change license 2020-12-27 17:18:44 -08:00
wcsrchr.c Change license 2020-12-27 17:18:44 -08:00
wcsrtombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcsspn.c Change license 2020-12-27 17:18:44 -08:00
wcsstartswith.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
wcsstr.c Do some string library work 2022-08-20 22:17:14 -07:00
wcstok.c Added wcstok and wmemcmp (#183) 2021-06-09 19:34:27 -07:00
wcstombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcswidth.c Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
wcsxfrm.c Create ELF aliases for identical symbols 2023-06-06 03:33:49 -07:00
wctob.c Make improvements 2023-09-06 12:34:59 -07:00
wctomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wctrans.c Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
wctype.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
wcwidth.c Restore missing cosmopolitan documentation on website 2023-07-30 11:07:53 -07:00
wcwidth_osx.c Get TEST_LIBC_STR passing on AARCH64 2023-05-12 18:09:23 -07:00
wcwidth_osx.internal.h Get TEST_LIBC_STR passing on AARCH64 2023-05-12 18:09:23 -07:00
windowsdurationtotimespec.c Make improvements 2023-10-03 06:17:16 -07:00
windowsdurationtotimeval.c Make improvements 2023-10-03 06:17:16 -07:00
windowstimetotimespec.c Make improvements 2023-10-03 06:17:16 -07:00
windowstimetotimeval.c Make improvements 2023-10-03 06:17:16 -07:00
wmemchr.c Get LIBC_FMT to build for aarch64 2023-05-10 04:20:47 -07:00
wmemcmp.c Improve wait statuses 2023-07-30 14:51:37 -07:00
wmemcpy.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
wmemmove.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
wmempcpy.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
wmemrchr.c Make improvements 2023-09-18 21:04:47 -07:00
wmemset.c Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00