mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-25 06:42:27 +00:00
Write more tests attempting to break windows
This time I haven't succeeded in breaking anything which is a good sign.
This commit is contained in:
parent
476926790a
commit
126a44dc49
7 changed files with 331 additions and 37 deletions
|
@ -16,7 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/createfileflags.internal.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/sig.internal.h"
|
||||
|
@ -170,14 +169,11 @@ sys_readwrite_nt(int fd, void *data, size_t size, ssize_t offset,
|
|||
}
|
||||
|
||||
// the i/o operation was successfully canceled
|
||||
if (got_eagain) {
|
||||
unassert(!got_sig);
|
||||
if (got_eagain)
|
||||
return eagain();
|
||||
}
|
||||
|
||||
// it's now reasonable to report semaphore creation error
|
||||
if (other_error) {
|
||||
unassert(!got_sig);
|
||||
errno = __dos2errno(other_error);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -302,10 +302,10 @@ static textwindows int __sig_killer(struct PosixThread *pt, int sig, int sic) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// we can't preempt threads that masked sig or are blocked. we aso
|
||||
// need to ensure we don't the target thread's stack if many signals
|
||||
// need to be delivered at once. we also need to make sure two threads
|
||||
// can't deadlock by killing each other at the same time.
|
||||
// we can't preempt threads that masked sigs or are blocked. we also
|
||||
// need to ensure we don't overflow the target thread's stack if many
|
||||
// signals need to be delivered at once. we also need to make sure two
|
||||
// threads can't deadlock by killing each other at the same time.
|
||||
if ((atomic_load_explicit(&pt->tib->tib_sigmask, memory_order_acquire) &
|
||||
(1ull << (sig - 1))) ||
|
||||
atomic_exchange_explicit(&pt->pt_intoff, 1, memory_order_acquire)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue