Revert "Rewrite ZipOS"

This reverts commit b01282e23e. Some tests
are broken. It's not clear how it'll impact metal yet. Let's revisit the
memory optimization benefits of this change again sometime soon.
This commit is contained in:
Justine Tunney 2023-10-03 14:40:03 -07:00
parent ee8a861635
commit ff250a0c10
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
21 changed files with 420 additions and 407 deletions

View file

@ -52,7 +52,7 @@ void *Worker(void *arg) {
}
TEST(zipos, test) {
int i, n = 20;
int i, n = 16;
pthread_t *t = gc(malloc(sizeof(pthread_t) * n));
for (i = 0; i < n; ++i) {
ASSERT_SYS(0, 0, pthread_create(t + i, 0, Worker, 0));
@ -86,14 +86,6 @@ TEST(zipos, readPastEof) {
EXPECT_SYS(0, 0, close(3));
}
TEST(zipos, simple) {
char buf[31] = {0};
ASSERT_SYS(0, 3, open("/zip/libc/testlib/hyperion.txt", O_RDONLY));
ASSERT_SYS(0, 30, read(3, buf, 30));
ASSERT_STREQ("The fall of Hyperion - a Dream", buf);
ASSERT_SYS(0, 0, close(3));
}
TEST(zipos_O_DIRECTORY, blocksOpeningOfNormalFiles) {
ASSERT_SYS(ENOTDIR, -1,
open("/zip/libc/testlib/hyperion.txt", O_RDONLY | O_DIRECTORY));