Improve synchronization

- Fix bugs in kDos2Errno definition
- malloc() should now be thread safe
- Fix bug in rollup.com header generator
- Fix open(O_APPEND) on the New Technology
- Fix select() on the New Technology and test it
- Work towards refactoring i/o for thread safety
- Socket reads and writes on NT now poll for signals
- Work towards i/o completion ports on the New Technology
- Make read() and write() intermittently check for signals
- Blinkenlights keyboard i/o so much better on NT w/ poll()
- You can now poll() files and sockets at the same time on NT
- Fix bug in appendr() that manifests with dlmalloc footers off
This commit is contained in:
Justine Tunney 2022-04-14 23:39:48 -07:00
parent 233144b19d
commit 933411ba99
266 changed files with 8761 additions and 4344 deletions

View file

@ -1,7 +1,68 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SIO_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_SIO_H_
#define kNtSioBspHandlePoll 0x4800001D
#define kNtSioBaseHandle 0x48000022
#define kNtSioAbsorbRtralert 0x98000005u
#define kNtSioAcquirePortReservation 0x98000064u
#define kNtSioAddressListChange 0x28000017u
#define kNtSioAddressListQuery 0x48000016u
#define kNtSioAddressListSort 0xc8000019u
#define kNtSioApplyTransportSetting 0x98000013u
#define kNtSioAssociateHandle 0x88000001u
#define kNtSioAssociatePortReservation 0x98000066u
#define kNtSioBaseHandle 0x48000022u
#define kNtSioBspHandlePoll 0x4800001Du
#define kNtSioDeletePeerTargetName 0x980000cbu
#define kNtSioEnableCircularQueueing 0x28000002u
#define kNtSioFindRoute 0x48000003u
#define kNtSioFlush 0x28000004u
#define kNtSioGetBroadcastAddress 0x48000005u
#define kNtSioGetExtensionFunctionPointer 0xc8000006u
#define kNtSioGetGroupQos 0xc8000008u
#define kNtSioGetInterfaceList 0x4008747fu
#define kNtSioGetMultipleExtensionFunctionPointer 0xc8000024u
#define kNtSioGetQos 0xc8000007u
#define kNtSioIndexAddMcast 0x9800000au
#define kNtSioIndexBind 0x98000008u
#define kNtSioIndexDelMcast 0x9800000bu
#define kNtSioIndexMcastif 0x98000009u
#define kNtSioKeepaliveVals 0x98000004u
#define kNtSioLimitBroadcasts 0x98000007u
#define kNtSioLoopbackFastPath 0x98000010u
#define kNtSioMulticastScope 0x8800000au
#define kNtSioMultipointLoopback 0x88000009u
#define kNtSioQueryRssProcessorInfo 0x48000025u
#define kNtSioQueryRssScalabilityInfo 0x580000d2u
#define kNtSioQuerySecurity 0xd80000c9u
#define kNtSioQueryTargetPnpHandle 0x48000018u
#define kNtSioQueryTransportSetting 0x98000014u
#define kNtSioQueryWfpAleEndpointHandle 0x580000cdu
#define kNtSioQueryWfpConnectionRedirectContext 0x980000ddu
#define kNtSioQueryWfpConnectionRedirectRecords 0x980000dcu
#define kNtSioRcvall 0x98000001u
#define kNtSioRcvallIf 0x9800000eu
#define kNtSioRcvallIgmpmcast 0x98000003u
#define kNtSioRcvallMcast 0x98000002u
#define kNtSioRcvallMcastIf 0x9800000du
#define kNtSioReleasePortReservation 0x98000065u
#define kNtSioReserved1 0x8800001au
#define kNtSioReserved2 0x88000021u
#define kNtSioRoutingInterfaceChange 0x88000015u
#define kNtSioRoutingInterfaceQuery 0xc8000014u
#define kNtSioSetGroupQos 0x8800000cu
#define kNtSioSetPeerTargetName 0x980000cau
#define kNtSioSetPriorityHint 0x98000018u
#define kNtSioSetQos 0x8800000bu
#define kNtSioSetSecurity 0x980000c8u
#define kNtSioSetWfpConnectionRedirectRecords 0x980000deu
#define kNtSioSocketCloseNotify 0x9800000du
#define kNtSioSocketUsageNotification 0x980000ccu
#define kNtSioTcpInfo 0xd8000027u
#define kNtSioTcpInitialRto 0x98000011u
#define kNtSioTcpSetAckFrequency 0x98000017u
#define kNtSioTcpSetIcw 0x98000016u
#define kNtSioTranslateHandle 0xc800000du
#define kNtSioUcastIf 0x98000006u
#define kNtSioUdpConnreset 0x9800000cu
#define kNtSioUdpNetreset 0x9800000fu
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SIO_H_ */

12
libc/nt/enum/wsa.h Normal file
View file

@ -0,0 +1,12 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_WSA_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_WSA_H_
#include "libc/nt/errors.h"
#define kNtWsaInvalidHandle kNtErrorInvalidHandle
#define kNtWsaNotEnoughMemory kNtErrorNotEnoughMemory
#define kNtWsaInvalidParameter kNtErrorInvalidParameter
#define kNtWsaIoPending kNtErrorIoPending
#define kNtWsaIoIncomplete kNtErrorIoIncomplete
#define kNtWsaOperationAborted kNtErrorOperationAborted
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_WSA_H_ */

71
libc/nt/enum/wsaid.h Normal file
View file

@ -0,0 +1,71 @@
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_WSAID_H_
#define COSMOPOLITAN_LIBC_NT_ENUM_WSAID_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#define WSAID_WSAPOLL \
{ \
0x18C76F85, 0xDC66, 0x4964, { \
0x97, 0x2E, 0x23, 0xC2, 0x72, 0x38, 0x31, 0x2B \
} \
}
#define WSAID_WSARECVMSG \
{ \
0xf689d7c8, 0x6f1f, 0x436b, { \
0x8a, 0x53, 0xe5, 0x4f, 0xe3, 0x51, 0xc3, 0x22 \
} \
}
#define WSAID_WSASENDMSG \
{ \
0xa441e712, 0x754f, 0x43ca, { \
0x84, 0xa7, 0x0d, 0xee, 0x44, 0xcf, 0x60, 0x6d \
} \
}
#define WSAID_CONNECTEX \
{ \
0x25a207b9, 0xddf3, 0x4660, { \
0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e \
} \
}
#define WSAID_ACCEPTEX \
{ \
0xb5367df1, 0xcbac, 0x11cf, { \
0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92 \
} \
}
#define WSAID_GETACCEPTEXSOCKADDRS \
{ \
0xb5367df2, 0xcbac, 0x11cf, { \
0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92 \
} \
}
#define WSAID_TRANSMITFILE \
{ \
0xb5367df0, 0xcbac, 0x11cf, { \
0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92 \
} \
}
#define WSAID_TRANSMITPACKETS \
{ \
0xd9689da0, 0x1f90, 0x11d3, { \
0x99, 0x71, 0x00, 0xc0, 0x4f, 0x68, 0xc8, 0x76 \
} \
}
#define WSAID_DISCONNECTEX \
{ \
0x7fda2e11, 0x8630, 0x436f, { \
0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57 \
} \
}
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_WSAID_H_ */