mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 16:22:29 +00:00
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:
parent
ee8a861635
commit
ff250a0c10
21 changed files with 420 additions and 407 deletions
|
@ -25,7 +25,8 @@
|
|||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/zip.internal.h"
|
||||
|
||||
int __zipos_stat_impl(struct Zipos *zipos, int cf, struct stat *st) {
|
||||
int __zipos_stat_impl(struct Zipos *zipos, size_t cf, struct stat *st) {
|
||||
size_t lf;
|
||||
bzero(st, sizeof(*st));
|
||||
st->st_nlink = 1;
|
||||
st->st_dev = zipos->dev;
|
||||
|
@ -34,11 +35,12 @@ int __zipos_stat_impl(struct Zipos *zipos, int cf, struct stat *st) {
|
|||
st->st_mode = S_IFDIR | (0555 & ~atomic_load_explicit(
|
||||
&__umask, memory_order_acquire));
|
||||
} else {
|
||||
st->st_mode = GetZipCfileMode(zipos->cdir + cf);
|
||||
st->st_size = GetZipCfileUncompressedSize(zipos->cdir + cf);
|
||||
lf = GetZipCfileOffset(zipos->map + cf);
|
||||
st->st_mode = GetZipCfileMode(zipos->map + cf);
|
||||
st->st_size = GetZipLfileUncompressedSize(zipos->map + lf);
|
||||
st->st_blocks =
|
||||
roundup(GetZipCfileCompressedSize(zipos->cdir + cf), 512) / 512;
|
||||
GetZipCfileTimestamps(zipos->cdir + cf, &st->st_mtim, &st->st_atim,
|
||||
roundup(GetZipLfileCompressedSize(zipos->map + lf), 512) / 512;
|
||||
GetZipCfileTimestamps(zipos->map + cf, &st->st_mtim, &st->st_atim,
|
||||
&st->st_ctim, 0);
|
||||
st->st_birthtim = st->st_ctim;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue