cosmopolitan/libc/x
Justine Tunney 00611e9b06 Improve ZIP filesystem and change its prefix
The ZIP filesystem has a breaking change. You now need to use /zip/ to
open() / opendir() / etc. assets within the ZIP structure of your APE
binary, instead of the previous convention of using zip: or zip! URIs.
This is needed because Python likes to use absolute paths, and having
ZIP paths encoded like URIs simply broke too many things.

Many more system calls have been updated to be able to operate on ZIP
files and file descriptors. In particular fcntl() and ioctl() since
Python would do things like ask if a ZIP file is a terminal and get
confused when the old implementation mistakenly said yes, because the
fastest way to guarantee native file descriptors is to dup(2). This
change also improves the async signal safety of zipos and ensures it
doesn't maintain any open file descriptors beyond that which the user
has opened.

This change makes a lot of progress towards adding magic numbers that
are specific to platforms other than Linux. The philosophy here is that,
if you use an operating system like FreeBSD, then you should be able to
take advantage of FreeBSD exclusive features, even if we don't polyfill
them on other platforms. For example, you can now open() a file with the
O_VERIFY flag. If your program runs on other platforms, then Cosmo will
automatically set O_VERIFY to zero. This lets you safely use it without
the need for #ifdef or ifstatements which detract from readability.

One of the blindspots of the ASAN memory hardening we use to offer Rust
like assurances has always been that memory passed to the kernel via
system calls (e.g. writev) can't be checked automatically since the
kernel wasn't built with MODE=asan. This change makes more progress
ensuring that each system call will verify the soundness of memory
before it's passed to the kernel. The code for doing these checks is
fast, particularly for buffers, where it can verify 64 bytes a cycle.

- Correct O_LOOP definition on NT
- Introduce program_executable_name
- Add ASAN guards to more system calls
- Improve termios compatibility with BSDs
- Fix bug in Windows auxiliary value encoding
- Add BSD and XNU specific errnos and open flags
- Add check to ensure build doesn't talk to internet
2021-08-22 01:11:53 -07:00
..
bingblit.c Change license 2020-12-27 17:18:44 -08:00
filecmp.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
makedirs.c Normalize mkdir() error codes 2021-01-29 21:21:06 -08:00
replaceuser.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
rmrf.c Add exponential backoff to rmdir() on Windows 2021-01-29 21:48:40 -08:00
tunbing.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
unbingbuf.c Change license 2020-12-27 17:18:44 -08:00
unbingstr.c Change license 2020-12-27 17:18:44 -08:00
utf8toutf16.c Improve backwards compatibility with GNU Make 2021-05-02 07:48:59 -07:00
utf8toutf32.c Experiment with making Python go faster 2021-08-18 21:57:11 -07:00
utf16toutf8.c Improve backwards compatibility with GNU Make 2021-05-02 07:48:59 -07:00
x.h Improve ZIP filesystem and change its prefix 2021-08-22 01:11:53 -07:00
x.mk Delete LIBC_CALLS_HEFTY 2021-02-02 22:17:53 -08:00
xasprintf.c Change license 2020-12-27 17:18:44 -08:00
xbarf.c Improve Libc by making Python work even better 2021-08-18 22:16:23 -07:00
xcalloc.c Change license 2020-12-27 17:18:44 -08:00
xdie.c Change license 2020-12-27 17:18:44 -08:00
xdirname.c Change license 2020-12-27 17:18:44 -08:00
xdtoa.c Improve signal handling and math 2021-02-25 18:33:33 -08:00
xdtoaf.c Improve signal handling and math 2021-02-25 18:33:33 -08:00
xdtoal.c Make pow() conform to standard definition 2021-03-03 09:21:27 -08:00
xgetline.c Improve backwards compatibility with GNU Make 2021-05-02 07:48:59 -07:00
xhomedir.c Improve linenoise and get it working on Windows 2021-08-15 14:34:05 -07:00
xjoinpaths.c Improve ZIP filesystem and change its prefix 2021-08-22 01:11:53 -07:00
xmalloc.c Change license 2020-12-27 17:18:44 -08:00
xmemalign.c Change license 2020-12-27 17:18:44 -08:00
xmemalignzero.c Change license 2020-12-27 17:18:44 -08:00
xrealloc.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
xsigaction.c Add cpu / mem / fsz limits to build system 2021-08-13 23:40:53 -07:00
xslurp.c Update curl example to support ssl / https 2021-07-06 13:39:18 -07:00
xspawn.c Improve ZIP filesystem and change its prefix 2021-08-22 01:11:53 -07:00
xstrcat.c Add help dialog to Blinkenlights emulator 2021-02-19 17:16:17 -08:00
xstrdup.c Change license 2020-12-27 17:18:44 -08:00
xstripexts.c Experiment with making Python go faster 2021-08-18 21:57:11 -07:00
xstrmul.c Change license 2020-12-27 17:18:44 -08:00
xstrndup.c Change license 2020-12-27 17:18:44 -08:00
xvalloc.c Change license 2020-12-27 17:18:44 -08:00
xvasprintf.c Make Cosmopolitan ANSI C89 compatible 2021-02-03 17:48:59 -08:00
xvspawn.c Improve ZIP filesystem and change its prefix 2021-08-22 01:11:53 -07:00
xwrite.c Change license 2020-12-27 17:18:44 -08:00