cosmopolitan/libc/nt
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
..
advapi32 Improve isystem includes and magic numbers 2021-08-14 23:36:36 -07:00
comdlg32 Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
enum Improve ZIP filesystem and change its prefix 2021-08-22 01:11:53 -07:00
gdi32 Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
iphlpapi Add ioctl(SIOCGIFxxx) support (#197) 2021-06-24 10:53:27 -07:00
kernel32 Improve Libc by making Python work even better 2021-08-18 22:16:23 -07:00
KernelBase Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
MsWSock Initial import 2020-06-15 07:18:57 -07:00
netapi32 Initial import 2020-06-15 07:18:57 -07:00
nt Improve documentation 2020-12-27 07:02:35 -08:00
ntdll Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
PowerProf Improve isystem includes and magic numbers 2021-08-14 23:36:36 -07:00
shell32 Initial import 2020-06-15 07:18:57 -07:00
struct Improve Libc by making Python work even better 2021-08-18 22:16:23 -07:00
thunk Auto-generate some documentation 2020-12-26 02:09:07 -08:00
typedef Add epoll and do more release readiness changes 2020-11-28 12:01:51 -08:00
url Initial import 2020-06-15 07:18:57 -07:00
user32 Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
ws2_32 Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
accounting.h Undiamond Python headers 2021-08-12 14:07:40 -07:00
automation.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
codegen.h Make improvements 2020-12-01 03:43:40 -08:00
codegen.sh Change license 2020-12-27 17:18:44 -08:00
comdlg.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
console.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
createfile.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
debug.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
dll.h Fix fork() on Windows after chdir() 2021-01-29 23:19:29 -08:00
efi.h Support malloc() on bare metal 2021-02-24 00:53:24 -08:00
errors.h Add SSL to redbean 2021-06-24 13:20:50 -07:00
events.h Implement syslog (#136) 2021-04-01 19:32:39 -07:00
files.h Improve Libc by making Python work even better 2021-08-18 22:16:23 -07:00
iocp.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
ipc.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
iphlpapi.h Add test for ioctl(SIOCGIFCONF) and polyfill on BSDs 2021-06-25 18:44:04 -07:00
master.sh Improve Libc by making Python work even better 2021-08-18 22:16:23 -07:00
memory.h Add SSL to redbean 2021-06-24 13:20:50 -07:00
messagebox.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
nt.mk Improve isystem includes and magic numbers 2021-08-14 23:36:36 -07:00
ntdll.h Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
ntdllimport.h Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
ntdllimport.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
paint.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
pedef.internal.h Add UEFI support 2021-02-21 21:33:04 -08:00
privilege.h Work towards improving signals and processes 2021-01-27 19:34:02 -08:00
process.h Work towards improving signals and processes 2021-01-27 19:34:02 -08:00
registry.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
runtime.h Add SSL to redbean 2021-06-24 13:20:50 -07:00
signals.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
startupinfo.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
synchronization.h Make Cosmopolitan ANSI C89 compatible 2021-02-03 17:48:59 -08:00
system.h Improve isystem includes and magic numbers 2021-08-14 23:36:36 -07:00
systeminfo.h Fix cosmopolitan.h for C++ 2021-02-01 04:04:44 -08:00
sysv2nt.s Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
thread.h Add chibicc 2020-12-06 16:20:21 -08:00
windows.h Add ioctl(SIOCGIFxxx) support (#197) 2021-06-24 10:53:27 -07:00
winsock.h Improve ZIP filesystem and change its prefix 2021-08-22 01:11:53 -07:00