cosmopolitan/libc/stdio
Justine Tunney 6ffed14b9c
Rewrite memory manager
Actually Portable Executable now supports Android. Cosmo's old mmap code
required a 47 bit address space. The new implementation is very agnostic
and supports both smaller address spaces (e.g. embedded) and even modern
56-bit PML5T paging for x86 which finally came true on Zen4 Threadripper

Cosmopolitan no longer requires UNIX systems to observe the Windows 64kb
granularity; i.e. sysconf(_SC_PAGE_SIZE) will now report the host native
page size. This fixes a longstanding POSIX conformance issue, concerning
file mappings that overlap the end of file. Other aspects of conformance
have been improved too, such as the subtleties of address assignment and
and the various subtleties surrounding MAP_FIXED and MAP_FIXED_NOREPLACE

On Windows, mappings larger than 100 megabytes won't be broken down into
thousands of independent 64kb mappings. Support for MAP_STACK is removed
by this change; please use NewCosmoStack() instead.

Stack overflow avoidance is now being implemented using the POSIX thread
APIs. Please use GetStackBottom() and GetStackAddr(), instead of the old
error-prone GetStackAddr() and HaveStackMemory() APIs which are removed.
2024-06-22 05:45:11 -07:00
..
__fpurge.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
__freadahead.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
__freadptr.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
__freadptrinc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
__fseterr.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
alloc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
alphasort.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
append.h Make cosmo.h work a little better 2024-02-21 16:40:09 -08:00
appendd.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
appendf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
appendr.c Rename _bsr/_bsf to bsr/bsf 2024-03-04 17:33:26 -08:00
appends.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
appendstrlist.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
appendw.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
appendz.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
asprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
atof.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
big5.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
BUILD.mk Implement proper time zone support 2024-05-04 23:06:37 -07:00
clearerr.c more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
clearerr_unlocked.c more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
codepages.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
confstr.c Put confstr() in unistd.h 2024-05-21 15:35:06 -07:00
ctermid.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
dirstream.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
dprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
dprintf.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
dumphexc.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
ecvt.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
fbufsize.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fclose.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fdopen.c Fix stdio for character device regression 2024-05-25 05:58:09 -07:00
feof.c more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
feof_unlocked.c more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
ferror.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ferror_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fflush.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fflush.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
fflush_unlocked.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
fflushimpl.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fgetc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fgetc_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fgetln.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fgetpos.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fgets.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fgets_unlocked.c Let signals interrupt fgets unless SA_RESTART set (#1152) 2024-05-03 07:49:41 -07:00
fgetwc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fgetwc_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fgetws.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fgetws_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fileno.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fileno_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
flbf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fleaks.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
flockfile.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
flushlbf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fmemopen.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fmt.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fopen.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fopenflags.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fpending.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fprintf_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fpurge.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fputc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fputc_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fputs.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fputs_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fputwc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fputwc_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fputws.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fputws_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fread.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fread_unlocked.c Fix stdio for character device regression 2024-05-25 05:58:09 -07:00
freadable.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
freading.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
freestrlist.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
freopen.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fscanf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fseek.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fseek_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
fsetlocking.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fsetpos.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ftell.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
ftrylockfile.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ftw.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ftw.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
funlockfile.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fwritable.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fwrite.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fwrite_unlocked.c Fix fread() with 2gb+ sizes 2024-05-24 19:28:23 -07:00
fwriting.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
g_rando.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
gb18030.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
gcvt.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
get_current_dir_name.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getchar.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getchar_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getcwd.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getdelim.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getdelim_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getentropy.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getline.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
gets.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getwchar.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getwchar_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
hex.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
hkscs.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
iconv.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
iconv.h Reduce header complexity 2023-11-28 14:39:42 -08:00
internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
jis0208.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
joinstrlist.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
kappendf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ksc.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
kvappendf.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
lcg.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
legacychars.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
lemur64.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
mt19937.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
nftw.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
pclose.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
popen.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
printargs.c Rewrite memory manager 2024-06-22 05:45:11 -07:00
printf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
putchar.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
putchar_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
puts.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
puts_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
putwc_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
putwchar.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
putwchar_unlocked.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
rand.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
rand.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
random.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
rdseed.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
readpassphrase.c Import libbsd readpassphrase (#1182) 2024-05-20 03:37:30 -04:00
readpassphrase.h Import libbsd readpassphrase (#1182) 2024-05-20 03:37:30 -04:00
real1.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
real2.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
real3.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
revjis.inc Add more missing libc functionality 2022-08-06 10:50:51 -07:00
rewind.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
rngset.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
scandir.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
scanf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
setbuf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
setbuffer.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
setlinebuf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
setvbuf.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
snprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sortstrlist.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
sprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
srand.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sscanf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
stdbuf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
stderr.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
stdin.c Make stdin unbuffered when appropriate 2024-05-25 07:57:13 -07:00
stdio.h Put confstr() in unistd.h 2024-05-21 15:35:06 -07:00
stdio_ext.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
stdout.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
strfry.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
strlist.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
strtold.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
swprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
syscall.c Introduce getcpu() system call from glibc 2024-02-21 18:17:20 -08:00
syscall.h Introduce getcpu() system call from glibc 2024-02-21 18:17:20 -08:00
sysparam.h Rerun clang-format on the repo (#1217) 2024-06-15 16:34:48 -04:00
tmpfile.c Bring back gc() function 2024-01-08 10:26:28 -08:00
tmpnam.c Make improvements 2024-02-12 10:23:00 -08:00
tmpnam_r.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ungetc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ungetc_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
ungetwc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ungetwc_unlocked.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
vappendf.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
vasprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
vcscanf.c Run clang-format (#1197) 2024-06-01 16:30:43 -04:00
vdprintf.c Fix fread() with 2gb+ sizes 2024-05-24 19:28:23 -07:00
versionsort.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
vfprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
vfprintf_unlocked.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
vfscanf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
vigna.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
vprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
vscanf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
vsnprintf.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
vsprintf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
vsscanf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
wcstod.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
wcstof.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
wcstold.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00