mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Make ZipOS and Qemu work better
This change improves the dirstream library in a lot of respects, especially for /zip/... files. Also turn off MAP_STACK on Aarch64 because Qemu seems to implement it differently than Linux and it's probably responsible for a lot of mysterious crashes.
This commit is contained in:
parent
4658ae539f
commit
110559ce6a
48 changed files with 748 additions and 500 deletions
|
@ -16,9 +16,8 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
/**
|
||||
* Reads file metadata from αcτµαlly pδrταblε εxεcµταblε object store.
|
||||
|
@ -26,22 +25,10 @@
|
|||
* @param uri is obtained via __zipos_parseuri()
|
||||
* @asyncsignalsafe
|
||||
*/
|
||||
int __zipos_stat(const struct ZiposUri *name, struct stat *st) {
|
||||
int rc;
|
||||
int __zipos_stat(struct ZiposUri *name, struct stat *st) {
|
||||
ssize_t cf;
|
||||
struct Zipos *zipos;
|
||||
if (st) {
|
||||
if ((zipos = __zipos_get())) {
|
||||
if ((cf = __zipos_find(zipos, name)) != -1) {
|
||||
rc = __zipos_stat_impl(zipos, cf, st);
|
||||
} else {
|
||||
rc = enoent();
|
||||
}
|
||||
} else {
|
||||
rc = enoexec();
|
||||
}
|
||||
} else {
|
||||
rc = efault();
|
||||
}
|
||||
return rc;
|
||||
if (!(zipos = __zipos_get())) return enoexec();
|
||||
if ((cf = __zipos_find(zipos, name)) == -1) return enoent();
|
||||
return __zipos_stat_impl(zipos, cf, st);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue