cosmopolitan/libc/stdio
Justine Tunney ff77f2a6af
Make improvements
- This change fixes a bug that allowed unbuffered printf() output (to
  streams like stderr) to be truncated. This regression was introduced
  some time between now and the last release.

- POSIX specifies all functions as thread safe by default. This change
  works towards cleaning up our use of the @threadsafe / @threadunsafe
  documentation annotations to reflect that. The goal is (1) to use
  @threadunsafe to document functions which POSIX say needn't be thread
  safe, and (2) use @threadsafe to document functions that we chose to
  implement as thread safe even though POSIX didn't mandate it.

- Tidy up the clock_gettime() implementation. We're now trying out a
  cleaner approach to system call support that aims to maintain the
  Linux errno convention as long as possible. This also fixes bugs that
  existed previously, where the vDSO errno wasn't being translated
  properly. The gettimeofday() system call is now a wrapper for
  clock_gettime(), which reduces bloat in apps that use both.

- The recently-introduced improvements to the execute bit on Windows has
  had bugs fixed. access(X_OK) on a directory on Windows now succeeds.
  fstat() will now perform the MZ/#! ReadFile() operation correctly.

- Windows.h is no longer included in libc/isystem/, because it confused
  PCRE's build system into thinking Cosmopolitan is a WIN32 platform.
  Cosmo's Windows.h polyfill was never even really that good, since it
  only defines a subset of the subset of WIN32 APIs that Cosmo defines.

- The setlongerjmp() / longerjmp() APIs are removed. While they're nice
  APIs that are superior to the standardized setjmp / longjmp functions,
  they weren't superior enough to not be dead code in the monorepo. If
  you use these APIs, please file an issue and they'll be restored.

- The .com appending magic has now been removed from APE Loader.
2023-10-03 06:17:16 -07:00
..
__fpurge.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
__freadahead.c Make improvements 2023-09-06 12:34:59 -07:00
__freadptr.c Make improvements 2023-09-06 12:34:59 -07:00
__freadptrinc.c Make improvements 2023-09-06 12:34:59 -07:00
__fseterr.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
alloc.c Get rid of kmalloc() 2023-09-11 21:56:00 -07:00
alphasort.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
append.h Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
appendd.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
appendf.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
appendr.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
appends.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
appendstrlist.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
appendw.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
appendz.c Fix small matters and improve sysconf() 2023-08-17 00:32:11 -07:00
asprintf.c Make improvements 2023-10-03 06:17:16 -07:00
atof.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
big5.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
clearerr.c Make improvements 2023-10-03 06:17:16 -07:00
clearerr_unlocked.c Make improvements 2023-10-03 06:17:16 -07:00
codepages.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
confstr.c Overhaul process spawning 2023-09-10 08:17:44 -07:00
ctermid.c Fix warnings 2023-09-01 20:50:18 -07:00
demangle.c Move demangling utility to stdio 2023-07-07 10:47:50 -07:00
dirstream.c Make improvements 2023-10-03 06:17:16 -07:00
dprintf.c Clean up more code 2023-06-18 01:00:05 -07:00
dprintf.h Fix warnings 2023-09-01 20:50:18 -07:00
dumphexc.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
ecvt.c Don't relocate file descriptor memory 2022-09-09 16:54:28 -07:00
fbufsize.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fclose.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
fdopen.c Rearrange code and make a faster sha256sum program 2022-11-02 23:19:16 -07:00
feof.c Make improvements 2023-10-03 06:17:16 -07:00
feof_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
ferror.c Make improvements 2023-10-03 06:17:16 -07:00
ferror_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fflush.c Make improvements 2023-10-03 06:17:16 -07:00
fflush.internal.h Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
fflush_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fflushimpl.c Make improvements 2023-09-06 12:34:59 -07:00
fgetc.c Make improvements 2023-10-03 06:17:16 -07:00
fgetc_unlocked.c Improve zip read-only filesystem 2023-08-16 17:52:12 -07:00
fgetln.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
fgetpos.c Change license 2020-12-27 17:18:44 -08:00
fgets.c Make improvements 2023-10-03 06:17:16 -07:00
fgets_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fgetwc.c Make improvements 2023-10-03 06:17:16 -07:00
fgetwc_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fgetws.c Make improvements 2023-10-03 06:17:16 -07:00
fgetws_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fileno.c Make improvements 2023-10-03 06:17:16 -07:00
fileno_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
flbf.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fleaks.c fleaks.c: initialize command buffer before calling system (#904) 2023-10-02 13:31:15 -07:00
flockfile.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
flushlbf.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
fmemopen.c Fix warnings 2023-09-01 20:50:18 -07:00
fmt.c Make improvements 2023-09-18 21:04:47 -07:00
fopen.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fopenflags.c Fix issues with stdio needed for Lua 2021-03-06 19:04:26 -08:00
fpending.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fprintf.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
fprintf_unlocked.c Clean up more code 2023-06-18 01:00:05 -07:00
fpurge.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fputc.c Make improvements 2023-10-03 06:17:16 -07:00
fputc_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fputs.c Make improvements 2023-10-03 06:17:16 -07:00
fputs_unlocked.c Apply even more fixups 2022-06-12 11:57:00 -07:00
fputwc.c Make improvements 2023-10-03 06:17:16 -07:00
fputwc_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fputws.c Make improvements 2023-10-03 06:17:16 -07:00
fputws_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fread.c Make improvements 2023-10-03 06:17:16 -07:00
fread_unlocked.c Remove _Hide keyword 2023-07-24 08:34:58 -07:00
freadable.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
freading.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
freestrlist.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
freopen.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
fscanf.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
fseek.c Make improvements 2023-10-03 06:17:16 -07:00
fseek_unlocked.c Fix warnings 2023-09-01 20:50:18 -07:00
fsetlocking.c Add raw memory visualization tool to redbean 2022-05-14 04:33:58 -07:00
fsetpos.c Run clang-format on most sources 2023-04-27 05:44:32 -07:00
ftell.c Make improvements 2023-10-03 06:17:16 -07:00
ftrylockfile.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
ftw.c Make improvements 2023-10-03 06:17:16 -07:00
ftw.h Make fixes and improvements 2023-07-09 05:21:11 -07:00
funlockfile.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
fwritable.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
fwrite.c Make improvements 2023-10-03 06:17:16 -07:00
fwrite_unlocked.c Make improvements 2023-09-06 12:34:59 -07:00
fwriting.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
g_rando.c Get LIBC_MEM and LIBC_STDIO building with aarch64 2023-05-10 04:20:47 -07:00
gb18030.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
gcvt.c Make the Windows Console work better 2023-09-07 18:27:22 -07:00
getchar.c Apply even more fixups 2022-06-12 11:57:00 -07:00
getchar_unlocked.c Apply even more fixups 2022-06-12 11:57:00 -07:00
getdelim.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
getdelim_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
getentropy.c Improve cancellations, randomness, and time 2022-11-05 23:45:32 -07:00
getline.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
gets.c Make important improvements 2022-09-14 22:39:08 -07:00
getwchar.c Make improvements 2023-10-03 06:17:16 -07:00
getwchar_unlocked.c Apply even more fixups 2022-06-12 11:57:00 -07:00
hex.internal.h Add function for creating hex string literals 2021-08-07 07:05:19 -07:00
hkscs.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
iconv.c Fix warnings 2023-09-01 20:50:18 -07:00
iconv.h Add more missing libc functionality 2022-08-06 10:50:51 -07:00
internal.h Get rid of kmalloc() 2023-09-11 21:56:00 -07:00
jis0208.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
joinstrlist.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
kappendf.c Pay off more technical debt 2022-09-12 23:36:56 -07:00
ksc.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
kvappendf.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
lcg.internal.h Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
legacychars.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
lemur64.c Rename rand64() to _rand64() 2022-10-10 04:12:06 -07:00
mt19937.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
nftw.c Make improvements 2023-10-03 06:17:16 -07:00
pclose.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
popen.c Make improvements 2023-10-03 06:17:16 -07:00
printf.c Clean up more code 2023-06-18 01:00:05 -07:00
putchar.c Make improvements 2023-10-03 06:17:16 -07:00
putchar_unlocked.c Apply even more fixups 2022-06-12 11:57:00 -07:00
puts.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
puts_unlocked.c Fix warnings 2023-09-01 20:50:18 -07:00
putwc_unlocked.c Introduce new fatcosmocc command 2023-08-11 22:52:11 -07:00
putwchar.c Make improvements 2023-10-03 06:17:16 -07:00
putwchar_unlocked.c Apply even more fixups 2022-06-12 11:57:00 -07:00
rand.c Make improvements 2023-10-03 06:17:16 -07:00
rand.h Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
random.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
rdseed.c Rename rand64() to _rand64() 2022-10-10 04:12:06 -07:00
real1.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
real2.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
real3.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
revjis.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
rewind.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
rngset.c Fix warnings 2023-09-01 20:50:18 -07:00
scandir.c Improve cosmo's conformance to libc-test 2022-10-10 17:52:41 -07:00
scanf.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
setbuf.c Make major improvements to stdio 2021-03-26 22:31:41 -07:00
setbuffer.c Make major improvements to stdio 2021-03-26 22:31:41 -07:00
setlinebuf.c Make major improvements to stdio 2021-03-26 22:31:41 -07:00
setvbuf.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
snprintf.c Make the Windows Console work better 2023-09-07 18:27:22 -07:00
sortstrlist.c Simplify redbean serialization code 2022-09-06 20:07:29 -07:00
sprintf.c Clean up more code 2023-06-18 01:00:05 -07:00
srand.c Improve cosmo's conformance to libc-test 2022-10-10 17:52:41 -07:00
sscanf.c Make the Windows Console work better 2023-09-07 18:27:22 -07:00
stdbuf.c Remove _Hide keyword 2023-07-24 08:34:58 -07:00
stderr.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
stdin.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
stdio.h Overhaul process spawning 2023-09-10 08:17:44 -07:00
stdio.mk Make improvements 2023-09-18 21:04:47 -07:00
stdio_ext.h Make improvements 2023-09-06 12:34:59 -07:00
stdout.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
strfry.c Fold LIBC_ALG into LIBC_MEM 2022-08-13 08:32:34 -07:00
strlist.internal.h Remove _Hide keyword 2023-07-24 08:34:58 -07:00
strtold.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
swprintf.c Remove printf() linking hack 2023-06-17 10:13:50 -07:00
syscall.c Fix syscall(2) returning -errno instead of using POSIX errno scheme (#830) 2023-06-11 10:33:28 -07:00
syscall.h Create a fake syscall() function due to Python 2023-06-09 05:18:38 -07:00
sysparam.h Make improvements 2023-10-03 06:17:16 -07:00
tmpfile.c Make improvements 2023-10-03 06:17:16 -07:00
tmpnam.c Make improvements 2023-09-06 12:34:59 -07:00
tmpnam_r.c Make improvements 2023-09-06 12:34:59 -07:00
ungetc.c Make improvements 2023-10-03 06:17:16 -07:00
ungetc_unlocked.c Further improve scanf 2023-08-21 16:55:29 -07:00
ungetwc.c Make improvements 2023-10-03 06:17:16 -07:00
ungetwc_unlocked.c Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
vappendf.c Make the Windows Console work better 2023-09-07 18:27:22 -07:00
vasprintf.c Make improvements 2023-10-03 06:17:16 -07:00
vcscanf.c Make improvements 2023-09-18 21:04:47 -07:00
vdprintf.c Fix warnings 2023-09-01 20:50:18 -07:00
versionsort.c Improve cosmo's conformance to libc-test 2022-10-10 17:52:41 -07:00
vfprintf.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
vfprintf_unlocked.c Make improvements 2023-10-03 06:17:16 -07:00
vfscanf.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
vigna.c Rename rand64() to _rand64() 2022-10-10 04:12:06 -07:00
vprintf.c Clean up more code 2023-06-18 01:00:05 -07:00
vscanf.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
vsnprintf.c Get GNU MPFR and MPC tests to pass 2023-08-21 15:05:10 -07:00
vsprintf.c Make the Windows Console work better 2023-09-07 18:27:22 -07:00
vsscanf.c Clean up more code 2023-06-18 01:00:05 -07:00
wcstod.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
wcstof.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
wcstold.c Perform inconsequential code cleanup 2023-08-07 20:24:50 -07:00
xorshift.h Replace COSMO define with _COSMO_SOURCE 2023-08-13 20:55:04 -07:00
xorshift32.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
xorshift64.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00