mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-01 10:12:27 +00:00
Write more tests for signal handling
There's now a much stronger level of assurance that signaling on Windows will be atomic, low-latency, low tail latency, and shall never deadlock.
This commit is contained in:
parent
0e59afb403
commit
dd8c4dbd7d
19 changed files with 407 additions and 75 deletions
|
@ -29,6 +29,7 @@
|
|||
#include "libc/nt/enum/pageflags.h"
|
||||
#include "libc/nt/files.h"
|
||||
#include "libc/nt/memory.h"
|
||||
#include "libc/nt/process.h"
|
||||
#include "libc/nt/runtime.h"
|
||||
#include "libc/nt/thunk/msabi.h"
|
||||
#ifdef __x86_64__
|
||||
|
@ -42,11 +43,16 @@ __msabi extern typeof(CreateFileMapping) *const __imp_CreateFileMappingW;
|
|||
__msabi extern typeof(MapViewOfFileEx) *const __imp_MapViewOfFileEx;
|
||||
__msabi extern typeof(SetEndOfFile) *const __imp_SetEndOfFile;
|
||||
__msabi extern typeof(SetFilePointer) *const __imp_SetFilePointer;
|
||||
__msabi extern typeof(GetEnvironmentVariable)
|
||||
*const __imp_GetEnvironmentVariableW;
|
||||
|
||||
__msabi textwindows char16_t *__sig_process_path(char16_t *path, uint32_t pid,
|
||||
int create_directories) {
|
||||
// Generates C:\ProgramData\cosmo\sig\x\y.pid like path
|
||||
__msabi textwindows dontinstrument char16_t *__sig_process_path(
|
||||
char16_t *path, uint32_t pid, int create_directories) {
|
||||
char16_t buf[3];
|
||||
char16_t *p = path;
|
||||
*p++ = 'C'; // C:\ProgramData\cosmo\sig\x\y.pid
|
||||
uint32_t vlen = __imp_GetEnvironmentVariableW(u"SYSTEMDRIVE", buf, 3);
|
||||
*p++ = vlen == 2 ? buf[0] : 'C';
|
||||
*p++ = ':';
|
||||
*p++ = '\\';
|
||||
*p++ = 'P';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue