mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 19:22:27 +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
|
@ -6,23 +6,29 @@
|
|||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define ZIPOS_PATH_MAX 1024
|
||||
|
||||
#define ZIPOS_SYNTHETIC_DIRECTORY 0
|
||||
|
||||
struct stat;
|
||||
struct iovec;
|
||||
struct Zipos;
|
||||
|
||||
struct ZiposUri {
|
||||
const char *path;
|
||||
size_t len;
|
||||
uint32_t len;
|
||||
char path[ZIPOS_PATH_MAX];
|
||||
};
|
||||
|
||||
struct ZiposHandle {
|
||||
struct ZiposHandle *next;
|
||||
pthread_mutex_t lock;
|
||||
size_t size; /* byte length of `mem` */
|
||||
size_t mapsize; /* total size of this struct */
|
||||
size_t pos; /* read/write byte offset state */
|
||||
uint32_t cfile; /* central directory entry rva */
|
||||
uint8_t *mem; /* points to inflated data or uncompressed image */
|
||||
uint8_t data[]; /* uncompressed file memory */
|
||||
struct Zipos *zipos;
|
||||
size_t size;
|
||||
size_t mapsize;
|
||||
size_t pos;
|
||||
size_t cfile;
|
||||
uint8_t *mem;
|
||||
uint8_t data[];
|
||||
};
|
||||
|
||||
struct Zipos {
|
||||
|
@ -31,17 +37,18 @@ struct Zipos {
|
|||
struct ZiposHandle *freelist;
|
||||
};
|
||||
|
||||
int __zipos_close(int);
|
||||
void __zipos_lock(void);
|
||||
void __zipos_unlock(void);
|
||||
int __zipos_close(int);
|
||||
size_t __zipos_normpath(char *);
|
||||
struct Zipos *__zipos_get(void) pureconst;
|
||||
void __zipos_free(struct Zipos *, struct ZiposHandle *);
|
||||
void __zipos_free(struct ZiposHandle *);
|
||||
ssize_t __zipos_parseuri(const char *, struct ZiposUri *);
|
||||
ssize_t __zipos_find(struct Zipos *, const struct ZiposUri *);
|
||||
int __zipos_open(const struct ZiposUri *, unsigned, int);
|
||||
int __zipos_access(const struct ZiposUri *, int);
|
||||
int __zipos_stat(const struct ZiposUri *, struct stat *);
|
||||
int __zipos_fstat(const struct ZiposHandle *, struct stat *);
|
||||
ssize_t __zipos_find(struct Zipos *, struct ZiposUri *);
|
||||
int __zipos_open(struct ZiposUri *, int);
|
||||
int __zipos_access(struct ZiposUri *, int);
|
||||
int __zipos_stat(struct ZiposUri *, struct stat *);
|
||||
int __zipos_fstat(struct ZiposHandle *, struct stat *);
|
||||
int __zipos_stat_impl(struct Zipos *, size_t, struct stat *);
|
||||
ssize_t __zipos_read(struct ZiposHandle *, const struct iovec *, size_t,
|
||||
ssize_t);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue