mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 01:38:30 +00:00
Add torture test for zipos file descriptors
This change hardens the code for opening /zip/ files using the system call interface. Thread safety and signal safety has been improved for file descriptors in general. We now document fixed addresses that are needed for low level allocations.
This commit is contained in:
parent
579080cd4c
commit
e466dd0553
44 changed files with 2981 additions and 307 deletions
|
@ -20,7 +20,6 @@
|
|||
#include "libc/bits/atomic.h"
|
||||
#include "libc/bits/weaken.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/spinlock.h"
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/macros.internal.h"
|
||||
|
@ -71,14 +70,14 @@ static struct Memlog {
|
|||
long usage;
|
||||
} __memlog;
|
||||
|
||||
_Alignas(64) static int __memlog_lock_obj;
|
||||
static pthread_mutex_t __memlog_lock_obj;
|
||||
|
||||
static void __memlog_lock(void) {
|
||||
_spinlock(&__memlog_lock_obj);
|
||||
pthread_mutex_lock(&__memlog_lock_obj);
|
||||
}
|
||||
|
||||
static void __memlog_unlock(void) {
|
||||
_spunlock(&__memlog_lock_obj);
|
||||
pthread_mutex_unlock(&__memlog_lock_obj);
|
||||
}
|
||||
|
||||
static long __memlog_size(void *p) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue