mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-29 08:42:28 +00:00
Rewrite ZipOS
This reduces the virtual memory usage of Emacs for me by 30%. We now have a simpler implementation that uses read(), rather mmap()ing the whole executable.
This commit is contained in:
parent
ff77f2a6af
commit
b01282e23e
21 changed files with 408 additions and 421 deletions
|
@ -139,9 +139,9 @@ TEST(unveil, canBeUsedAgainAfterVfork) {
|
|||
TEST(unveil, rwc_createExecutableFile_isAllowedButCantBeRun) {
|
||||
SPAWN(fork);
|
||||
ASSERT_SYS(0, 0, mkdir("folder", 0755));
|
||||
testlib_extract("/zip/life.elf", "folder/life.elf", 0755);
|
||||
ASSERT_SYS(0, 0, unveil("folder", "rwc"));
|
||||
ASSERT_SYS(0, 0, unveil(0, 0));
|
||||
testlib_extract("/zip/life.elf", "folder/life.elf", 0755);
|
||||
SPAWN(fork);
|
||||
ASSERT_SYS(0, 0, stat("folder/life.elf", &st));
|
||||
ASSERT_SYS(EACCES, -1, execl("folder/life.elf", "folder/life.elf", 0));
|
||||
|
@ -152,9 +152,9 @@ TEST(unveil, rwc_createExecutableFile_isAllowedButCantBeRun) {
|
|||
TEST(unveil, rwcx_createExecutableFile_canAlsoBeRun) {
|
||||
SPAWN(fork);
|
||||
ASSERT_SYS(0, 0, mkdir("folder", 0755));
|
||||
testlib_extract("/zip/life.elf", "folder/life.elf", 0755);
|
||||
ASSERT_SYS(0, 0, unveil("folder", "rwcx"));
|
||||
ASSERT_SYS(0, 0, unveil(0, 0));
|
||||
testlib_extract("/zip/life.elf", "folder/life.elf", 0755);
|
||||
SPAWN(fork);
|
||||
ASSERT_SYS(0, 0, stat("folder/life.elf", &st));
|
||||
execl("folder/life.elf", "folder/life.elf", 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue