1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-22 11:13:21 +00:00

Added MacOS support

Added ability to spawn process with specific user, under linux
Fixed edge case memory leak caused when we were trying to QueueUserAPC to a thread we were already on, which also caused a 3 second delay.
Changed WindowsRunLoop, to detect bad HANDLEs, and event an error on them, and remove them from list
Fixed linux bug, where a spawned child called 'exit' instead of '_exit' in an error condition
This commit is contained in:
Bryan Roe
2019-01-11 12:42:16 -08:00
parent c0db749e8e
commit a3f69396f6
2 changed files with 159 additions and 28 deletions

View File

@@ -43,9 +43,6 @@ typedef enum ILibProcessPipe_SpawnTypes
ILibProcessPipe_SpawnTypes_SPECIFIED_USER = 5
}ILibProcessPipe_SpawnTypes;
extern const int ILibMemory_ILibProcessPipe_Pipe_CONTAINERSIZE;
#ifdef WIN32
typedef enum ILibProcessPipe_Pipe_ReaderHandleType
{
@@ -91,8 +88,16 @@ pid_t ILibProcessPipe_Process_GetPID(ILibProcessPipe_Process p);
#ifdef WIN32
typedef BOOL(*ILibProcessPipe_WaitHandle_Handler)(HANDLE event, void* user);
void ILibProcessPipe_WaitHandle_Add(ILibProcessPipe_Manager mgr, HANDLE event, void *user, ILibProcessPipe_WaitHandle_Handler callback);
typedef enum ILibWaitHandle_ErrorStatus
{
ILibWaitHandle_ErrorStatus_NONE = 0,
ILibWaitHandle_ErrorStatus_INVALID_HANDLE = 1,
ILibWaitHandle_ErrorStatus_TIMEOUT = 2
}ILibWaitHandle_ErrorStatus;
typedef BOOL(*ILibProcessPipe_WaitHandle_Handler)(HANDLE event, ILibWaitHandle_ErrorStatus status, void* user);
void ILibProcessPipe_WaitHandle_Add_WithNonZeroTimeout(ILibProcessPipe_Manager mgr, HANDLE event, int milliseconds, void *user, ILibProcessPipe_WaitHandle_Handler callback);
#define ILibProcessPipe_WaitHandle_Add(processPipeManager, eventHandle, user, callback) ILibProcessPipe_WaitHandle_Add_WithNonZeroTimeout(processPipeManager, eventHandle, 0, user, callback)
void ILibProcessPipe_WaitHandle_Remove(ILibProcessPipe_Manager mgr, HANDLE event);
#endif
#define ILibTransports_ProcessPipe 0x60