mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Make fixes and improvements
- Invent iso8601us() for faster timestamps - Improve --strace descriptions of sigset_t - Rebuild the Landlock Make bootstrap binary - Introduce MODE=sysv for non-Windows builds - Permit OFD fcntl() locks under pledge(flock) - redbean can now protect your kernel from ddos - Have vfork() fallback to sys_fork() not fork() - Change kmalloc() to not die when out of memory - Improve documentation for some termios functions - Rewrite putenv() and friends to conform to POSIX - Fix linenoise + strace verbosity issue on Windows - Fix regressions in our ability to show backtraces - Change redbean SetHeader() to no-op if value is nil - Improve fcntl() so SQLite locks work in non-WAL mode - Remove some unnecessary work during fork() on Windows - Create redbean-based SSL reverse proxy for IPv4 TurfWar - Fix ape/apeinstall.sh warning when using non-bash shells - Add ProgramTrustedIp(), and IsTrustedIp() APIs to redbean - Support $PWD, $UID, $GID, and $EUID in command interpreter - Introduce experimental JTqFpD APE prefix for non-Windows builds - Invent blackhole daemon for firewalling IP addresses via UNIX named socket - Add ProgramTokenBucket(), AcquireToken(), and CountTokens() APIs to redbean
This commit is contained in:
parent
648bf6555c
commit
f7ff77d865
209 changed files with 3818 additions and 998 deletions
36
libc/nt/comms.h
Normal file
36
libc/nt/comms.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_COMMS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_COMMS_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/* ░░░░
|
||||
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
|
||||
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
|
||||
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓░
|
||||
▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▒ ▒▒▒▓▓█
|
||||
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
||||
░▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ █▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
||||
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓░ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
||||
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▒
|
||||
▒▒▒▒▓▓ ▓▒▒▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
||||
▒▓ ▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓
|
||||
░░░░░░░░░░░▒▒▒▒ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
||||
▒▒░░░░░░░░░░▒▒▒▒▒▓▓▓ ▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
||||
░▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓░ ░▓███▓
|
||||
▒▒░░░░░░░░░░▒▒▒▒▒▓▓░ ▒▓▓▓▒▒▒ ░▒▒▒▓ ████████████
|
||||
▒▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▒▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒░ ░███
|
||||
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ███
|
||||
▒▒░░░░░░░░░░▒▒▒▒▒▒▓▓ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ▓██
|
||||
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒▓ ▓██
|
||||
▒▒░░░▒▒▒░░░▒▒░▒▒▒▓▓▒ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ███
|
||||
░▒▓ ░▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ▓██
|
||||
╔────────────────────────────────────────────────────────────────▀▀▀─────────│─╗
|
||||
│ cosmopolitan § new technology » communications ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
bool32 PurgeComm(int64_t hFile, uint32_t dwFlags);
|
||||
bool32 TransmitCommChar(int64_t hFile, char cChar);
|
||||
bool32 ClearCommBreak(int64_t hFile);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_COMMS_H_ */
|
|
@ -1,2 +1,15 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_ClearCommBreak,ClearCommBreak,0
|
||||
|
||||
.text.windows
|
||||
ClearCommBreak:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_ClearCommBreak(%rip)
|
||||
leave
|
||||
ret
|
||||
.endfn ClearCommBreak,globl
|
||||
.previous
|
||||
|
|
|
@ -1,2 +1,12 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_PurgeComm,PurgeComm,0
|
||||
|
||||
.text.windows
|
||||
PurgeComm:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_PurgeComm(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
.endfn PurgeComm,globl
|
||||
.previous
|
||||
|
|
|
@ -1,2 +1,12 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_TransmitCommChar,TransmitCommChar,0
|
||||
|
||||
.text.windows
|
||||
TransmitCommChar:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_TransmitCommChar(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
.endfn TransmitCommChar,globl
|
||||
.previous
|
||||
|
|
|
@ -112,7 +112,7 @@ imp 'CheckNameLegalDOS8Dot3' CheckNameLegalDOS8Dot3W kernel32 128
|
|||
imp 'CheckRemoteDebuggerPresent' CheckRemoteDebuggerPresent kernel32 0 2
|
||||
imp 'CheckTokenCapability' CheckTokenCapability kernel32 0
|
||||
imp 'CheckTokenMembershipEx' CheckTokenMembershipEx kernel32 0
|
||||
imp 'ClearCommBreak' ClearCommBreak kernel32 0
|
||||
imp 'ClearCommBreak' ClearCommBreak kernel32 0 1
|
||||
imp 'ClearCommError' ClearCommError kernel32 0
|
||||
imp 'CloseConsoleHandle' CloseConsoleHandle kernel32 134
|
||||
imp 'ClosePackageInfo' ClosePackageInfo kernel32 0
|
||||
|
@ -764,7 +764,7 @@ imp 'PssWalkMarkerSetPosition' PssWalkMarkerSetPosition kernel32 0
|
|||
imp 'PssWalkMarkerTell' PssWalkMarkerTell kernel32 1080
|
||||
imp 'PssWalkSnapshot' PssWalkSnapshot kernel32 0
|
||||
imp 'PulseEvent' PulseEvent kernel32 0 1
|
||||
imp 'PurgeComm' PurgeComm kernel32 0
|
||||
imp 'PurgeComm' PurgeComm kernel32 0 2
|
||||
imp 'QueryActCtx' QueryActCtxW kernel32 0
|
||||
imp 'QueryActCtxSettings' QueryActCtxSettingsW kernel32 0
|
||||
imp 'QueryActCtxSettingsWWorker' QueryActCtxSettingsWWorker kernel32 1085
|
||||
|
@ -1011,7 +1011,7 @@ imp 'TlsGetValue' TlsGetValue kernel32 0 1
|
|||
imp 'TlsSetValue' TlsSetValue kernel32 0 2
|
||||
imp 'Toolhelp32ReadProcessMemory' Toolhelp32ReadProcessMemory kernel32 1449
|
||||
imp 'TransactNamedPipe' TransactNamedPipe kernel32 0 7
|
||||
imp 'TransmitCommChar' TransmitCommChar kernel32 0
|
||||
imp 'TransmitCommChar' TransmitCommChar kernel32 0 2
|
||||
imp 'TryAcquireSRWLockExclusive' TryAcquireSRWLockExclusive kernel32 0 1
|
||||
imp 'TryAcquireSRWLockShared' TryAcquireSRWLockShared kernel32 0 1
|
||||
imp 'TryEnterCriticalSection' TryEnterCriticalSection kernel32 0 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue