2120 lines
71 KiB
C
2120 lines
71 KiB
C
/* Generated by Nim Compiler v1.9.0 */
|
|
#define NIM_INTBITS 32
|
|
|
|
#include "nimbase.h"
|
|
#include <string.h>
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <spawn.h>
|
|
#include <signal.h>
|
|
#include <sys/wait.h>
|
|
#include "OS.h"
|
|
#include <errno.h>
|
|
#include <stdio.h>
|
|
#undef LANGUAGE_C
|
|
#undef MIPSEB
|
|
#undef MIPSEL
|
|
#undef PPC
|
|
#undef R3000
|
|
#undef R4000
|
|
#undef i386
|
|
#undef linux
|
|
#undef mips
|
|
#undef near
|
|
#undef far
|
|
#undef powerpc
|
|
#undef unix
|
|
#define nimfr_(x, y)
|
|
#define nimln_(x, y)
|
|
typedef struct tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg;
|
|
typedef struct NimStrPayload NimStrPayload;
|
|
typedef struct NimStringV2 NimStringV2;
|
|
typedef struct tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg;
|
|
typedef struct tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA;
|
|
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
|
|
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content;
|
|
typedef struct tyObject_RefHeader__Gi7WQzlT1ZRToh9a2ueYb4A tyObject_RefHeader__Gi7WQzlT1ZRToh9a2ueYb4A;
|
|
typedef struct TNimTypeV2 TNimTypeV2;
|
|
typedef struct RootObj RootObj;
|
|
typedef struct tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ;
|
|
typedef struct tyObject_GcEnv__g0b9ao2MXcYnUpu9b4I8eP9bQ tyObject_GcEnv__g0b9ao2MXcYnUpu9b4I8eP9bQ;
|
|
typedef struct tyObject_CellSeq__sGle0igznE2T7vk4dBh5SQ tyObject_CellSeq__sGle0igznE2T7vk4dBh5SQ;
|
|
typedef struct tyTuple__N4J9cV4JZGem3ljqqj5rT0Q tyTuple__N4J9cV4JZGem3ljqqj5rT0Q;
|
|
typedef struct tyObject_CellSeq__z4KasHYddby49cXX2MD4LxQ tyObject_CellSeq__z4KasHYddby49cXX2MD4LxQ;
|
|
typedef struct tyTuple__0F3Kz25HWtRatQmCDVHWEA tyTuple__0F3Kz25HWtRatQmCDVHWEA;
|
|
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
|
|
typedef struct tySequence__xv3aaFd3JCw8NbmALHiezQ tySequence__xv3aaFd3JCw8NbmALHiezQ;
|
|
typedef struct tySequence__xv3aaFd3JCw8NbmALHiezQ_Content tySequence__xv3aaFd3JCw8NbmALHiezQ_Content;
|
|
typedef struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA tyTuple__sPaDkVPSC0MkcoXCxPH9ccA;
|
|
typedef struct tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ;
|
|
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
|
|
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
|
|
typedef struct tySequence__PrBYolTs4TOSgE8v5oqDUQ tySequence__PrBYolTs4TOSgE8v5oqDUQ;
|
|
typedef struct tySequence__PrBYolTs4TOSgE8v5oqDUQ_Content tySequence__PrBYolTs4TOSgE8v5oqDUQ_Content;
|
|
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
|
|
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
|
|
struct NimStrPayload {
|
|
NI cap;
|
|
NIM_CHAR data[SEQ_DECL_SIZE];
|
|
};
|
|
struct NimStringV2 {
|
|
NI len;
|
|
NimStrPayload* p;
|
|
};
|
|
typedef NU8 tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA;
|
|
typedef int tyArray__bpgyACnpuq1ETodMD6DE5w[2];
|
|
struct tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA {
|
|
NimStringV2 sysCommand;
|
|
NCSTRING* sysArgs;
|
|
NCSTRING* sysEnv;
|
|
NCSTRING workingDir;
|
|
tyArray__bpgyACnpuq1ETodMD6DE5w pStdin;
|
|
tyArray__bpgyACnpuq1ETodMD6DE5w pStdout;
|
|
tyArray__bpgyACnpuq1ETodMD6DE5w pStderr;
|
|
tyArray__bpgyACnpuq1ETodMD6DE5w pErrorPipe;
|
|
tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options;
|
|
};
|
|
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
|
|
NI len; tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content* p;
|
|
};
|
|
struct tyObject_RefHeader__Gi7WQzlT1ZRToh9a2ueYb4A {
|
|
NI rc;
|
|
NI rootIdx;
|
|
};
|
|
struct TNimTypeV2 {
|
|
void* destructor;
|
|
NI size;
|
|
NI16 align;
|
|
NI16 depth;
|
|
NU32* display;
|
|
void* traceImpl;
|
|
void* typeInfoV1;
|
|
NI flags;
|
|
};
|
|
struct RootObj {
|
|
TNimTypeV2* m_type;
|
|
};
|
|
struct tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg {
|
|
RootObj Sup;
|
|
int inHandle;
|
|
int outHandle;
|
|
int errHandle;
|
|
pid_t id;
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* inStream;
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* outStream;
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* errStream;
|
|
int exitStatus;
|
|
NIM_BOOL exitFlag;
|
|
tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options;
|
|
};
|
|
struct tyObject_CellSeq__sGle0igznE2T7vk4dBh5SQ {
|
|
NI len;
|
|
NI cap;
|
|
tyTuple__N4J9cV4JZGem3ljqqj5rT0Q* d;
|
|
};
|
|
struct tyObject_CellSeq__z4KasHYddby49cXX2MD4LxQ {
|
|
NI len;
|
|
NI cap;
|
|
tyTuple__0F3Kz25HWtRatQmCDVHWEA* d;
|
|
};
|
|
struct tyObject_GcEnv__g0b9ao2MXcYnUpu9b4I8eP9bQ {
|
|
tyObject_CellSeq__sGle0igznE2T7vk4dBh5SQ traceStack;
|
|
tyObject_CellSeq__z4KasHYddby49cXX2MD4LxQ toFree;
|
|
NI freed;
|
|
NI touched;
|
|
NI edges;
|
|
NI rcSum;
|
|
NIM_BOOL keepThreshold;
|
|
};
|
|
struct tyTuple__N4J9cV4JZGem3ljqqj5rT0Q {
|
|
void** Field0;
|
|
TNimTypeV2* Field1;
|
|
};
|
|
typedef tyTuple__N4J9cV4JZGem3ljqqj5rT0Q tyUncheckedArray__72XmdLy0QAaMtx66AmNKfA[1];
|
|
typedef NU8 tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA;
|
|
typedef NCSTRING tyUncheckedArray__nvS6J9clHMUMHfoZd8Ad2zg[1];
|
|
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
|
|
NimStringV2 Field0;
|
|
NimStringV2 Field1;
|
|
};
|
|
struct tySequence__xv3aaFd3JCw8NbmALHiezQ {
|
|
NI len; tySequence__xv3aaFd3JCw8NbmALHiezQ_Content* p;
|
|
};
|
|
typedef NU8 tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ;
|
|
struct tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg {
|
|
RootObj Sup;
|
|
NI counter;
|
|
tySequence__xv3aaFd3JCw8NbmALHiezQ data;
|
|
tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ mode;
|
|
};
|
|
struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA {
|
|
NimStringV2 Field0;
|
|
NimStringV2 Field1;
|
|
NIM_BOOL Field2;
|
|
};
|
|
typedef NimStringV2 tyArray__24KAM9afIUgUaqBaEBB6r9bg[3];
|
|
typedef N_NIMCALL_PTR(void, tyProc__JQrsH08b4uPTH9cyFPlVOZg) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
|
|
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__9bmhFrLahRsL2hltfRDVtlQ) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
|
|
typedef N_NIMCALL_PTR(void, tyProc__3svSoGIUJIsHkaBL7q4DAQ) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NI pos);
|
|
typedef N_NIMCALL_PTR(NI, tyProc__xflqkf2D1uVClg70czEDHA) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
|
|
typedef N_NIMCALL_PTR(NI, tyProc__c9c0f59ak4YGQ6neEym8LPKw) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringV2* buffer, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA slice);
|
|
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__7jFfqMk9ajToCz6Hv9atCA4A) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringV2* line);
|
|
typedef N_NIMCALL_PTR(NI, tyProc__2VVzVL9bOnKhj1eZKkf9cEuA) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
|
|
typedef N_NIMCALL_PTR(void, tyProc__ki6p1QyfOkJLQJ9aw5NI0AQ) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
|
|
struct tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ {
|
|
RootObj Sup;
|
|
tyProc__JQrsH08b4uPTH9cyFPlVOZg closeImpl;
|
|
tyProc__9bmhFrLahRsL2hltfRDVtlQ atEndImpl;
|
|
tyProc__3svSoGIUJIsHkaBL7q4DAQ setPositionImpl;
|
|
tyProc__xflqkf2D1uVClg70czEDHA getPositionImpl;
|
|
tyProc__c9c0f59ak4YGQ6neEym8LPKw readDataStrImpl;
|
|
tyProc__7jFfqMk9ajToCz6Hv9atCA4A readLineImpl;
|
|
tyProc__2VVzVL9bOnKhj1eZKkf9cEuA readDataImpl;
|
|
tyProc__2VVzVL9bOnKhj1eZKkf9cEuA peekDataImpl;
|
|
tyProc__ki6p1QyfOkJLQJ9aw5NI0AQ writeDataImpl;
|
|
tyProc__JQrsH08b4uPTH9cyFPlVOZg flushImpl;
|
|
};
|
|
struct tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ {
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ Sup;
|
|
FILE* f;
|
|
};
|
|
typedef NU8 tyEnum_FileMode__4sJyy9aOSN8X63XdWXl5iDg;
|
|
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
|
|
NimStringV2 Field0;
|
|
NI Field1;
|
|
};
|
|
typedef NimStringV2 tyArray__8ZvwQIddfpj2THRVPsFzIQ[1];
|
|
typedef struct {
|
|
N_NIMCALL_PTR(void, ClP_0) (NI idx, void* ClE_0);
|
|
void* ClE_0;
|
|
} tyProc__SqRJqa5aOiKB4EuKlKh9asA;
|
|
typedef struct {
|
|
N_NIMCALL_PTR(void, ClP_0) (NI idx, tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p, void* ClE_0);
|
|
void* ClE_0;
|
|
} tyProc__oudJckli4GdxAXLVzBBlAw;
|
|
struct tySequence__PrBYolTs4TOSgE8v5oqDUQ {
|
|
NI len; tySequence__PrBYolTs4TOSgE8v5oqDUQ_Content* p;
|
|
};
|
|
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
|
|
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
|
|
};
|
|
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_41) (NI idx);
|
|
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_46) (NI idx, tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
|
|
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_47) (NI idx);
|
|
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_49) (NI idx);
|
|
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_51) (NI idx, tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
|
|
|
|
|
|
#ifndef tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content_PP
|
|
#define tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content_PP
|
|
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE];};
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content_PP
|
|
#define tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content_PP
|
|
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE];};
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content_PP
|
|
#define tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content_PP
|
|
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE];};
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content_PP
|
|
#define tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content_PP
|
|
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE];};
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef tySequence__xv3aaFd3JCw8NbmALHiezQ_Content_PP
|
|
#define tySequence__xv3aaFd3JCw8NbmALHiezQ_Content_PP
|
|
struct tySequence__xv3aaFd3JCw8NbmALHiezQ_Content { NI cap; tyTuple__sPaDkVPSC0MkcoXCxPH9ccA data[SEQ_DECL_SIZE];};
|
|
#endif
|
|
|
|
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
|
|
NI a;
|
|
NI b;
|
|
};
|
|
|
|
|
|
#ifndef tySequence__PrBYolTs4TOSgE8v5oqDUQ_Content_PP
|
|
#define tySequence__PrBYolTs4TOSgE8v5oqDUQ_Content_PP
|
|
struct tySequence__PrBYolTs4TOSgE8v5oqDUQ_Content { NI cap; tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* data[SEQ_DECL_SIZE];};
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
|
|
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
|
|
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
|
|
#endif
|
|
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size);
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
|
|
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_203)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg** dest);
|
|
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p);
|
|
static N_INLINE(NI, minuspercent___system_790)(NI x, NI y);
|
|
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_3167)(NIM_BOOL isDestroyAction, tyObject_RefHeader__Gi7WQzlT1ZRToh9a2ueYb4A* s, TNimTypeV2* desc);
|
|
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p);
|
|
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObj)(NI size, NI alignment);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_216)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* dest);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqtrace___pureZosproc_225)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* dest, void* env);
|
|
static N_INLINE(void, nimTraceRefDyn)(void* q, void* env);
|
|
static N_INLINE(void, add__system_2712)(tyObject_CellSeq__sGle0igznE2T7vk4dBh5SQ* s, void** c, TNimTypeV2* t);
|
|
N_LIB_PRIVATE N_NOCONV(void*, allocImpl__system_1735)(NI size);
|
|
static N_INLINE(void, copyMem__system_1719)(void* dest, void* source, NI size);
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
|
|
N_LIB_PRIVATE N_NOCONV(void, dealloc)(void* p);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__stdZoserrors_70)(NI32 errorCode, NimStringV2 additionalInfo);
|
|
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__stdZoserrors_73)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqsink___stdZassertions_19)(NimStringV2* dest, NimStringV2 src);
|
|
N_LIB_PRIVATE N_NIMCALL(void*, newSeqPayload)(NI cap, NI elemSize, NI elemAlign);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___stdZassertions_16)(NimStringV2* dest, NimStringV2 src);
|
|
N_LIB_PRIVATE N_NIMCALL(void, add__stdZenumutils_69)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* x, NimStringV2 value);
|
|
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, allocCStringArray__system_3574)(NimStringV2* a, NI aLen_0);
|
|
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__pureZosproc_618)(void);
|
|
static N_INLINE(NIM_BOOL, eqeq___system_7514)(NCSTRING x, NCSTRING y);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, cstrToNimstr)(NCSTRING str);
|
|
static N_INLINE(NI, find__stdZenvvars_43)(NimStringV2 a, NIM_CHAR item);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqsink___stdZprivateZospaths50_298)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest, tyTuple__UV3llMMYFckfui8YMBuUZA src);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_7548)(NimStringV2 s, NI first, NI last);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_7560)(NimStringV2 s, NI first);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZassertions_13)(NimStringV2* dest);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZprivateZospaths50_292)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest);
|
|
N_LIB_PRIVATE N_NOCONV(void*, alloc0Impl__system_1737)(NI size);
|
|
static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space);
|
|
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__pureZosproc_606)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nstlen)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t);
|
|
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetCurrentDir)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(pid_t, startProcessAuxSpawn__pureZosproc_648)(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA* data);
|
|
static N_INLINE(NI, nimCStrLen)(NCSTRING a);
|
|
static N_INLINE(void, setCurrentDir__stdZprivateZosdirs_468)(NimStringV2 newDir);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nsuJoinSep)(NimStringV2* a, NI aLen_0, NimStringV2 sep);
|
|
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0);
|
|
N_LIB_PRIVATE N_NIMCALL(void, deallocCStringArray__system_3614)(NCSTRING* a);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_3540)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* dest);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_745)(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA* dest);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZstreams_620)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ** dest, tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* src);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*, createStream__pureZosproc_920)(int* handle, tyEnum_FileMode__4sJyy9aOSN8X63XdWXl5iDg fileMode);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, open__stdZsyncio_439)(FILE** f, int filehandle, tyEnum_FileMode__4sJyy9aOSN8X63XdWXl5iDg mode);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*, newFileStream__pureZstreams_911)(FILE* f);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___pureZstreams_616)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ** dest, tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* src, NIM_BOOL cyclic);
|
|
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__pureZos_144)(int status);
|
|
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_224)(NimStringV2 msg);
|
|
N_LIB_PRIVATE N_NIMCALL(void, close__pureZstreams_58)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg*, nospstartProcess)(NimStringV2 command, NimStringV2 workingDir, NimStringV2* args, NI argsLen_0, tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* env, tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*, nospoutputStream)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
|
|
N_LIB_PRIVATE N_NIMCALL(void, write__pureZstreams_184)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringV2 x);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*, nospinputStream)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstreams_613)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ** dest);
|
|
N_NIMCALL(NimStringV2, rawNewString)(NI cap);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, readLine__pureZstreams_543)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringV2* line);
|
|
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s, NI addlen);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nosppeekExitCode)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus__pureZosproc_603)(int status);
|
|
N_LIB_PRIVATE N_NIMCALL(void, nospclose)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, ncpicountProcessors)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(tySequence__PrBYolTs4TOSgE8v5oqDUQ, newSeq__pureZosproc_264)(NI len);
|
|
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, newSeq__pureZosproc_395)(NI len);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZosproc_210)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg** dest, tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* src);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosprunning)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_403)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_272)(tySequence__PrBYolTs4TOSgE8v5oqDUQ* dest);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nospwaitForExit)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p, NI timeout);
|
|
N_LIB_PRIVATE TNimTypeV2 NTIv2__2rGNQnv9bU4hanI2g3svReg_;
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[0+1];
|
|
} TM__HZdw8BhppcTQo8DIK46LSg_3 = { 0 | NIM_STRLIT_FLAG, "" };
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_4 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[7+1];
|
|
} TM__HZdw8BhppcTQo8DIK46LSg_5 = { 7 | NIM_STRLIT_FLAG, "/bin/sh" };
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_6 = {7, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_5};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_7 = {7, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_5};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[2+1];
|
|
} TM__HZdw8BhppcTQo8DIK46LSg_8 = { 2 | NIM_STRLIT_FLAG, "-c" };
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_9 = {2, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_8};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[1+1];
|
|
} TM__HZdw8BhppcTQo8DIK46LSg_10 = { 1 | NIM_STRLIT_FLAG, "=" };
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_11 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_10};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_12 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_10};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_13 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_14 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_15 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_16 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_17 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_18 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_19 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_20 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_21 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_22 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_23 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_24 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_25 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[1+1];
|
|
} TM__HZdw8BhppcTQo8DIK46LSg_26 = { 1 | NIM_STRLIT_FLAG, " " };
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_27 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_26};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_28 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_26};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_29 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_30 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_31 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_32 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_33 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_34 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[41+1];
|
|
} TM__HZdw8BhppcTQo8DIK46LSg_35 = { 41 | NIM_STRLIT_FLAG, "osproc.nim(1359, 13) `false` unreachable!" };
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_36 = {41, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_35};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_37 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[1+1];
|
|
} TM__HZdw8BhppcTQo8DIK46LSg_38 = { 1 | NIM_STRLIT_FLAG, "\012" };
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_39 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_38};
|
|
static NIM_CONST tyProc__SqRJqa5aOiKB4EuKlKh9asA TM__HZdw8BhppcTQo8DIK46LSg_40 = {NIM_NIL,NIM_NIL};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_42 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_43 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_44 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static NIM_CONST tyProc__oudJckli4GdxAXLVzBBlAw TM__HZdw8BhppcTQo8DIK46LSg_45 = {NIM_NIL,NIM_NIL};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_48 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_50 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
|
|
extern NIM_BOOL nimInErrorMode__system_4004;
|
|
static NIM_CONST NU32 TM__HZdw8BhppcTQo8DIK46LSg_2[2] = {3701606400, 2978824704};
|
|
N_LIB_PRIVATE TNimTypeV2 NTIv2__2rGNQnv9bU4hanI2g3svReg_ = {.destructor = (void*)eqdestroy___pureZosproc_216, .size = sizeof(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg), .align = (NI16) NIM_ALIGNOF(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg), .depth = 1, .display = TM__HZdw8BhppcTQo8DIK46LSg_2, .traceImpl = (void*)eqtrace___pureZosproc_225, .flags = 0};
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
|
|
void* T1_;
|
|
T1_ = (void*)0;
|
|
T1_ = memset(a, v, ((size_t) (size)));
|
|
}
|
|
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
|
|
NIM_BOOL* result;
|
|
result = (NIM_BOOL*)0;
|
|
result = (&nimInErrorMode__system_4004);
|
|
return result;
|
|
}
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimSetMem__systemZmemory_7(p, ((int)0), size);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
static N_INLINE(NI, minuspercent___system_790)(NI x, NI y) {
|
|
NI result;
|
|
result = (NI)0;
|
|
result = ((NI) ((NU)((NU32)(((NU) (x))) - (NU32)(((NU) (y))))));
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p) {
|
|
NIM_BOOL result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NIM_BOOL)0;
|
|
{
|
|
tyObject_RefHeader__Gi7WQzlT1ZRToh9a2ueYb4A* cell;
|
|
NI T5_;
|
|
if (!!((p == NIM_NIL))) goto LA3_;
|
|
T5_ = (NI)0;
|
|
T5_ = minuspercent___system_790(((NI) (ptrdiff_t) (p)), ((NI)8));
|
|
cell = ((tyObject_RefHeader__Gi7WQzlT1ZRToh9a2ueYb4A*) (T5_));
|
|
{
|
|
if (!((NI)((*cell).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
|
|
result = NIM_TRUE;
|
|
}
|
|
goto LA6_;
|
|
LA8_: ;
|
|
{
|
|
(*cell).rc -= ((NI)16);
|
|
}
|
|
LA6_: ;
|
|
rememberCycle__system_3167(result, cell, (*((TNimTypeV2**) (p))));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_203)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg** dest) {
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = nimDecRefIsLastCyclicDyn((*dest));
|
|
if (!T3_) goto LA4_;
|
|
nimDestroyAndDispose((*dest));
|
|
}
|
|
LA4_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_216)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* dest) {
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = nimDecRefIsLastCyclicDyn((*dest).inStream);
|
|
if (!T3_) goto LA4_;
|
|
nimDestroyAndDispose((*dest).inStream);
|
|
}
|
|
LA4_: ;
|
|
{
|
|
NIM_BOOL T8_;
|
|
T8_ = (NIM_BOOL)0;
|
|
T8_ = nimDecRefIsLastCyclicDyn((*dest).outStream);
|
|
if (!T8_) goto LA9_;
|
|
nimDestroyAndDispose((*dest).outStream);
|
|
}
|
|
LA9_: ;
|
|
{
|
|
NIM_BOOL T13_;
|
|
T13_ = (NIM_BOOL)0;
|
|
T13_ = nimDecRefIsLastCyclicDyn((*dest).errStream);
|
|
if (!T13_) goto LA14_;
|
|
nimDestroyAndDispose((*dest).errStream);
|
|
}
|
|
LA14_: ;
|
|
}
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
|
|
void* T1_;
|
|
T1_ = (void*)0;
|
|
T1_ = memcpy(dest, source, ((size_t) (size)));
|
|
}
|
|
static N_INLINE(void, copyMem__system_1719)(void* dest, void* source, NI size) {
|
|
nimCopyMem(dest, source, size);
|
|
}
|
|
static N_INLINE(void, add__system_2712)(tyObject_CellSeq__sGle0igznE2T7vk4dBh5SQ* s, void** c, TNimTypeV2* t) {
|
|
void** colontmp_;
|
|
TNimTypeV2* colontmp__2;
|
|
{
|
|
tyTuple__N4J9cV4JZGem3ljqqj5rT0Q* d;
|
|
void* T5_;
|
|
if (!((*s).cap <= (*s).len)) goto LA3_;
|
|
(*s).cap = (NI)((NI)((*s).cap * ((NI)3)) / ((NI)2));
|
|
T5_ = (void*)0;
|
|
T5_ = allocImpl__system_1735(((NI) ((NI)((*s).cap * ((NI)8)))));
|
|
d = ((tyTuple__N4J9cV4JZGem3ljqqj5rT0Q*) (T5_));
|
|
copyMem__system_1719(((void*) (d)), ((void*) ((*s).d)), ((NI) ((NI)((*s).len * ((NI)8)))));
|
|
dealloc(((void*) ((*s).d)));
|
|
(*s).d = d;
|
|
}
|
|
LA3_: ;
|
|
colontmp_ = c;
|
|
colontmp__2 = t;
|
|
(*s).d[(*s).len].Field0 = colontmp_;
|
|
(*s).d[(*s).len].Field1 = colontmp__2;
|
|
(*s).len += ((NI)1);
|
|
}
|
|
static N_INLINE(void, nimTraceRefDyn)(void* q, void* env) {
|
|
void** p;
|
|
p = ((void**) (q));
|
|
{
|
|
tyObject_GcEnv__g0b9ao2MXcYnUpu9b4I8eP9bQ* j;
|
|
if (!!(((*p) == NIM_NIL))) goto LA3_;
|
|
j = ((tyObject_GcEnv__g0b9ao2MXcYnUpu9b4I8eP9bQ*) (env));
|
|
add__system_2712((&(*j).traceStack), p, (*((TNimTypeV2**) ((*p)))));
|
|
}
|
|
LA3_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqtrace___pureZosproc_225)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* dest, void* env) {
|
|
nimTraceRefDyn(&(*dest).inStream, env);
|
|
nimTraceRefDyn(&(*dest).outStream, env);
|
|
nimTraceRefDyn(&(*dest).errStream, env);
|
|
}
|
|
static N_INLINE(NIM_BOOL, eqeq___system_7514)(NCSTRING x, NCSTRING y) {
|
|
NIM_BOOL result;
|
|
result = (NIM_BOOL)0;
|
|
{
|
|
if (!(((void*) (x)) == ((void*) (y)))) goto LA3_;
|
|
result = NIM_TRUE;
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
NIM_BOOL T6_;
|
|
T6_ = (NIM_BOOL)0;
|
|
T6_ = (x == 0);
|
|
if (T6_) goto LA7_;
|
|
T6_ = (y == 0);
|
|
LA7_: ;
|
|
if (!T6_) goto LA8_;
|
|
result = NIM_FALSE;
|
|
}
|
|
goto LA1_;
|
|
LA8_: ;
|
|
{
|
|
int T11_;
|
|
T11_ = (int)0;
|
|
T11_ = strcmp(x, y);
|
|
result = (T11_ == ((NI32)0));
|
|
}
|
|
LA1_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI, find__stdZenvvars_43)(NimStringV2 a, NIM_CHAR item) {
|
|
NI result;
|
|
{ result = (NI)0;
|
|
result = ((NI)0);
|
|
{
|
|
NIM_CHAR i;
|
|
NI i_2;
|
|
NI L;
|
|
i = (NIM_CHAR)0;
|
|
i_2 = ((NI)0);
|
|
L = a.len;
|
|
{
|
|
while (1) {
|
|
if (!(i_2 < L)) goto LA3 ;
|
|
i = a.p->data[i_2];
|
|
{
|
|
if (!((NU8)(i) == (NU8)(item))) goto LA6_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA6_: ;
|
|
result += ((NI)1);
|
|
i_2 += ((NI)1);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
result = ((NI)-1);
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {
|
|
{
|
|
if (!(((NI)0) < src.len)) goto LA3_;
|
|
copyMem__system_1719(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI)0)]))), ((NI) ((NI)(src.len + ((NI)1)))));
|
|
(*dest).len += src.len;
|
|
}
|
|
LA3_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__pureZosproc_618)(void) {
|
|
NCSTRING* result;
|
|
NI counter;
|
|
void* T7_;
|
|
NI i_2;
|
|
result = (NCSTRING*)0;
|
|
counter = ((NI)0);
|
|
{
|
|
NimStringV2 key;
|
|
NimStringV2 val;
|
|
key.len = 0; key.p = NIM_NIL;
|
|
val.len = 0; val.p = NIM_NIL;
|
|
{
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA ai;
|
|
NI i;
|
|
nimZeroMem((void*)(&ai), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
i = ((NI)0);
|
|
{
|
|
while (1) {
|
|
NIM_BOOL T5_;
|
|
NimStringV2 kv;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmp_;
|
|
NI p;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA T6_;
|
|
T5_ = (NIM_BOOL)0;
|
|
T5_ = eqeq___system_7514(environ[i], ((NCSTRING) NIM_NIL));
|
|
if (!!(T5_)) goto LA4 ;
|
|
kv.len = 0; kv.p = NIM_NIL;
|
|
nimZeroMem((void*)(&colontmp_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
kv = cstrToNimstr(environ[i]);
|
|
i += ((NI)1);
|
|
p = find__stdZenvvars_43(kv, 61);
|
|
T6_.Field0 = substr__system_7548(kv, ((NI)0), (NI)(p - ((NI)1)));
|
|
T6_.Field1 = substr__system_7560(kv, (NI)(p + ((NI)1)));
|
|
eqsink___stdZprivateZospaths50_298((&ai), T6_);
|
|
nimZeroMem((void*)(&colontmp_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
colontmp_ = ai;
|
|
nimZeroMem((void*)(&ai), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
eqsink___stdZassertions_19((&key), colontmp_.Field0);
|
|
eqsink___stdZassertions_19((&val), colontmp_.Field1);
|
|
counter += ((NI)1);
|
|
eqdestroy___stdZassertions_13((&kv));
|
|
} LA4: ;
|
|
}
|
|
eqdestroy___stdZprivateZospaths50_292((&ai));
|
|
}
|
|
eqdestroy___stdZassertions_13((&val));
|
|
eqdestroy___stdZassertions_13((&key));
|
|
}
|
|
T7_ = (void*)0;
|
|
T7_ = alloc0Impl__system_1737(((NI) ((NI)((NI)(counter + ((NI)1)) * ((NI)4)))));
|
|
result = ((NCSTRING*) (T7_));
|
|
i_2 = ((NI)0);
|
|
{
|
|
NimStringV2 key_2;
|
|
NimStringV2 val_2;
|
|
key_2.len = 0; key_2.p = NIM_NIL;
|
|
val_2.len = 0; val_2.p = NIM_NIL;
|
|
{
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA ai_2;
|
|
NI i_3;
|
|
nimZeroMem((void*)(&ai_2), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
i_3 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
NIM_BOOL T12_;
|
|
NimStringV2 kv_2;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmp__2;
|
|
NimStringV2 x;
|
|
NI p_2;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA T13_;
|
|
NimStringV2 T14_;
|
|
void* T15_;
|
|
T12_ = (NIM_BOOL)0;
|
|
T12_ = eqeq___system_7514(environ[i_3], ((NCSTRING) NIM_NIL));
|
|
if (!!(T12_)) goto LA11 ;
|
|
kv_2.len = 0; kv_2.p = NIM_NIL;
|
|
nimZeroMem((void*)(&colontmp__2), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
x.len = 0; x.p = NIM_NIL;
|
|
kv_2 = cstrToNimstr(environ[i_3]);
|
|
i_3 += ((NI)1);
|
|
p_2 = find__stdZenvvars_43(kv_2, 61);
|
|
T13_.Field0 = substr__system_7548(kv_2, ((NI)0), (NI)(p_2 - ((NI)1)));
|
|
T13_.Field1 = substr__system_7560(kv_2, (NI)(p_2 + ((NI)1)));
|
|
eqsink___stdZprivateZospaths50_298((&ai_2), T13_);
|
|
nimZeroMem((void*)(&colontmp__2), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
colontmp__2 = ai_2;
|
|
nimZeroMem((void*)(&ai_2), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
eqsink___stdZassertions_19((&key_2), colontmp__2.Field0);
|
|
eqsink___stdZassertions_19((&val_2), colontmp__2.Field1);
|
|
T14_.len = 0; T14_.p = NIM_NIL;
|
|
T14_ = rawNewString(key_2.len + val_2.len + 1);
|
|
appendString((&T14_), key_2);
|
|
appendString((&T14_), TM__HZdw8BhppcTQo8DIK46LSg_11);
|
|
appendString((&T14_), val_2);
|
|
x = T14_;
|
|
T15_ = (void*)0;
|
|
T15_ = allocImpl__system_1735(((NI) ((NI)(x.len + ((NI)1)))));
|
|
result[i_2] = ((NCSTRING) (T15_));
|
|
copyMem__system_1719(((void*) (result[i_2])), ((void*) ((&x.p->data[((NI)0)]))), ((NI) ((NI)(x.len + ((NI)1)))));
|
|
i_2 += ((NI)1);
|
|
eqdestroy___stdZassertions_13((&x));
|
|
eqdestroy___stdZassertions_13((&kv_2));
|
|
} LA11: ;
|
|
}
|
|
eqdestroy___stdZprivateZospaths50_292((&ai_2));
|
|
}
|
|
eqdestroy___stdZassertions_13((&val_2));
|
|
eqdestroy___stdZassertions_13((&key_2));
|
|
}
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__pureZosproc_606)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t) {
|
|
NCSTRING* result;
|
|
NI T1_;
|
|
void* T2_;
|
|
NI i;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NCSTRING*)0;
|
|
T1_ = (NI)0;
|
|
T1_ = nstlen(t);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T2_ = (void*)0;
|
|
T2_ = alloc0Impl__system_1737(((NI) ((NI)((NI)(T1_ + ((NI)1)) * ((NI)4)))));
|
|
result = ((NCSTRING*) (T2_));
|
|
i = ((NI)0);
|
|
{
|
|
NimStringV2 key;
|
|
NimStringV2 val;
|
|
key.len = 0; key.p = NIM_NIL;
|
|
val.len = 0; val.p = NIM_NIL;
|
|
{
|
|
NI h;
|
|
NI colontmp_;
|
|
NI T5_;
|
|
NI res;
|
|
h = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
T5_ = ((*t).data.len-1);
|
|
colontmp_ = T5_;
|
|
res = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(res <= colontmp_)) goto LA7 ;
|
|
h = res;
|
|
{
|
|
NimStringV2 x;
|
|
NimStringV2 T12_;
|
|
void* T13_;
|
|
if (!(*t).data.p->data[h].Field2) goto LA10_;
|
|
x.len = 0; x.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&key), (*t).data.p->data[h].Field0);
|
|
eqcopy___stdZassertions_16((&val), (*t).data.p->data[h].Field1);
|
|
T12_.len = 0; T12_.p = NIM_NIL;
|
|
T12_ = rawNewString(key.len + val.len + 1);
|
|
appendString((&T12_), key);
|
|
appendString((&T12_), TM__HZdw8BhppcTQo8DIK46LSg_12);
|
|
appendString((&T12_), val);
|
|
x = T12_;
|
|
T13_ = (void*)0;
|
|
T13_ = allocImpl__system_1735(((NI) ((NI)(x.len + ((NI)1)))));
|
|
result[i] = ((NCSTRING) (T13_));
|
|
copyMem__system_1719(((void*) (result[i])), ((void*) ((&x.p->data[((NI)0)]))), ((NI) ((NI)(x.len + ((NI)1)))));
|
|
i += ((NI)1);
|
|
eqdestroy___stdZassertions_13((&x));
|
|
}
|
|
LA10_: ;
|
|
res += ((NI)1);
|
|
} LA7: ;
|
|
}
|
|
}
|
|
eqdestroy___stdZassertions_13((&val));
|
|
eqdestroy___stdZassertions_13((&key));
|
|
}
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s) {
|
|
NCSTRING result;
|
|
result = (NCSTRING)0;
|
|
{
|
|
if (!(s.len == ((NI)0))) goto LA3_;
|
|
result = "";
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
result = ((NCSTRING) ((*s.p).data));
|
|
}
|
|
LA1_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI, nimCStrLen)(NCSTRING a) {
|
|
NI result;
|
|
size_t T1_;
|
|
result = (NI)0;
|
|
T1_ = (size_t)0;
|
|
T1_ = strlen(a);
|
|
result = ((NI) (T1_));
|
|
return result;
|
|
}
|
|
static N_INLINE(void, setCurrentDir__stdZprivateZosdirs_468)(NimStringV2 newDir) {
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
{
|
|
int T3_;
|
|
NI32 T6_;
|
|
T3_ = (int)0;
|
|
T3_ = chdir(nimToCStringConv(newDir));
|
|
if (!!((T3_ == ((NI32)0)))) goto LA4_;
|
|
T6_ = (NI32)0;
|
|
T6_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T6_, newDir);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA4_: ;
|
|
}BeforeRet_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(pid_t, startProcessAuxSpawn__pureZosproc_648)(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA* data) {
|
|
pid_t result;
|
|
posix_spawnattr_t attr;
|
|
posix_spawn_file_actions_t fops;
|
|
sigset_t mask;
|
|
NI32 flags;
|
|
int res;
|
|
pid_t pid;
|
|
int T108_;
|
|
int T109_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (pid_t)0;
|
|
nimZeroMem((void*)(&attr), sizeof(posix_spawnattr_t));
|
|
nimZeroMem((void*)(&fops), sizeof(posix_spawn_file_actions_t));
|
|
{
|
|
int T3_;
|
|
NI32 T6_;
|
|
T3_ = (int)0;
|
|
T3_ = posix_spawn_file_actions_init((&fops));
|
|
if (!!((T3_ == ((NI32)0)))) goto LA4_;
|
|
T6_ = (NI32)0;
|
|
T6_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T6_, TM__HZdw8BhppcTQo8DIK46LSg_13);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA4_: ;
|
|
{
|
|
int T9_;
|
|
NI32 T12_;
|
|
T9_ = (int)0;
|
|
T9_ = posix_spawnattr_init((&attr));
|
|
if (!!((T9_ == ((NI32)0)))) goto LA10_;
|
|
T12_ = (NI32)0;
|
|
T12_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T12_, TM__HZdw8BhppcTQo8DIK46LSg_14);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA10_: ;
|
|
mask = (sigset_t)0;
|
|
{
|
|
int T15_;
|
|
NI32 T18_;
|
|
T15_ = (int)0;
|
|
T15_ = sigemptyset((&mask));
|
|
if (!!((T15_ == ((NI32)0)))) goto LA16_;
|
|
T18_ = (NI32)0;
|
|
T18_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T18_, TM__HZdw8BhppcTQo8DIK46LSg_15);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA16_: ;
|
|
{
|
|
int T21_;
|
|
NI32 T24_;
|
|
T21_ = (int)0;
|
|
T21_ = posix_spawnattr_setsigmask((&attr), (&mask));
|
|
if (!!((T21_ == ((NI32)0)))) goto LA22_;
|
|
T24_ = (NI32)0;
|
|
T24_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T24_, TM__HZdw8BhppcTQo8DIK46LSg_16);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA22_: ;
|
|
{
|
|
if (!(((*data).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)6)))&7U)))!=0)) goto LA27_;
|
|
{
|
|
int T31_;
|
|
NI32 T34_;
|
|
T31_ = (int)0;
|
|
T31_ = posix_spawnattr_setpgroup((&attr), ((NI32)0));
|
|
if (!!((T31_ == ((NI32)0)))) goto LA32_;
|
|
T34_ = (NI32)0;
|
|
T34_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T34_, TM__HZdw8BhppcTQo8DIK46LSg_17);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA32_: ;
|
|
}
|
|
LA27_: ;
|
|
flags = (NI32)(((int)0) | POSIX_SPAWN_SETSIGMASK);
|
|
{
|
|
if (!(((*data).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)6)))&7U)))!=0)) goto LA37_;
|
|
flags = (NI32)(flags | POSIX_SPAWN_SETPGROUP);
|
|
}
|
|
LA37_: ;
|
|
{
|
|
int T41_;
|
|
NI32 T44_;
|
|
T41_ = (int)0;
|
|
T41_ = posix_spawnattr_setflags((&attr), flags);
|
|
if (!!((T41_ == ((NI32)0)))) goto LA42_;
|
|
T44_ = (NI32)0;
|
|
T44_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T44_, TM__HZdw8BhppcTQo8DIK46LSg_18);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA42_: ;
|
|
{
|
|
if (!!((((*data).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)4)))&7U)))!=0))) goto LA47_;
|
|
{
|
|
int T51_;
|
|
NI32 T54_;
|
|
T51_ = (int)0;
|
|
T51_ = posix_spawn_file_actions_addclose((&fops), (*data).pStdin[(((NI)1))- 0]);
|
|
if (!!((T51_ == ((NI32)0)))) goto LA52_;
|
|
T54_ = (NI32)0;
|
|
T54_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T54_, TM__HZdw8BhppcTQo8DIK46LSg_19);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA52_: ;
|
|
{
|
|
int T57_;
|
|
NI32 T60_;
|
|
T57_ = (int)0;
|
|
T57_ = posix_spawn_file_actions_adddup2((&fops), (*data).pStdin[(((NI)0))- 0], ((int)0));
|
|
if (!!((T57_ == ((NI32)0)))) goto LA58_;
|
|
T60_ = (NI32)0;
|
|
T60_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T60_, TM__HZdw8BhppcTQo8DIK46LSg_20);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA58_: ;
|
|
{
|
|
int T63_;
|
|
NI32 T66_;
|
|
T63_ = (int)0;
|
|
T63_ = posix_spawn_file_actions_addclose((&fops), (*data).pStdout[(((NI)0))- 0]);
|
|
if (!!((T63_ == ((NI32)0)))) goto LA64_;
|
|
T66_ = (NI32)0;
|
|
T66_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T66_, TM__HZdw8BhppcTQo8DIK46LSg_21);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA64_: ;
|
|
{
|
|
int T69_;
|
|
NI32 T72_;
|
|
T69_ = (int)0;
|
|
T69_ = posix_spawn_file_actions_adddup2((&fops), (*data).pStdout[(((NI)1))- 0], ((int)1));
|
|
if (!!((T69_ == ((NI32)0)))) goto LA70_;
|
|
T72_ = (NI32)0;
|
|
T72_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T72_, TM__HZdw8BhppcTQo8DIK46LSg_22);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA70_: ;
|
|
{
|
|
int T75_;
|
|
NI32 T78_;
|
|
T75_ = (int)0;
|
|
T75_ = posix_spawn_file_actions_addclose((&fops), (*data).pStderr[(((NI)0))- 0]);
|
|
if (!!((T75_ == ((NI32)0)))) goto LA76_;
|
|
T78_ = (NI32)0;
|
|
T78_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T78_, TM__HZdw8BhppcTQo8DIK46LSg_23);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA76_: ;
|
|
{
|
|
if (!(((*data).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)3)))&7U)))!=0)) goto LA81_;
|
|
{
|
|
int T85_;
|
|
NI32 T88_;
|
|
T85_ = (int)0;
|
|
T85_ = posix_spawn_file_actions_adddup2((&fops), (*data).pStdout[(((NI)1))- 0], ((int)2));
|
|
if (!!((T85_ == ((NI32)0)))) goto LA86_;
|
|
T88_ = (NI32)0;
|
|
T88_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T88_, TM__HZdw8BhppcTQo8DIK46LSg_24);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA86_: ;
|
|
}
|
|
goto LA79_;
|
|
LA81_: ;
|
|
{
|
|
{
|
|
int T92_;
|
|
NI32 T95_;
|
|
T92_ = (int)0;
|
|
T92_ = posix_spawn_file_actions_adddup2((&fops), (*data).pStderr[(((NI)1))- 0], ((int)2));
|
|
if (!!((T92_ == ((NI32)0)))) goto LA93_;
|
|
T95_ = (NI32)0;
|
|
T95_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T95_, TM__HZdw8BhppcTQo8DIK46LSg_25);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA93_: ;
|
|
}
|
|
LA79_: ;
|
|
}
|
|
LA47_: ;
|
|
res = (int)0;
|
|
{
|
|
NimStringV2 colontmpD_;
|
|
if (!(((NI)0) < ((*data).workingDir ? nimCStrLen((*data).workingDir) : 0))) goto LA98_;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
colontmpD_ = cstrToNimstr((*data).workingDir);
|
|
setCurrentDir__stdZprivateZosdirs_468(colontmpD_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA100_;
|
|
{
|
|
LA100_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&colontmpD_));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA98_: ;
|
|
pid = (pid_t)0;
|
|
{
|
|
if (!(((*data).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)1)))&7U)))!=0)) goto LA105_;
|
|
res = posix_spawnp((&pid), nimToCStringConv((*data).sysCommand), (&fops), (&attr), (*data).sysArgs, (*data).sysEnv);
|
|
}
|
|
goto LA103_;
|
|
LA105_: ;
|
|
{
|
|
res = posix_spawn((&pid), nimToCStringConv((*data).sysCommand), (&fops), (&attr), (*data).sysArgs, (*data).sysEnv);
|
|
}
|
|
LA103_: ;
|
|
T108_ = (int)0;
|
|
T108_ = posix_spawn_file_actions_destroy((&fops));
|
|
(void)(T108_);
|
|
T109_ = (int)0;
|
|
T109_ = posix_spawnattr_destroy((&attr));
|
|
(void)(T109_);
|
|
{
|
|
if (!!((res == ((NI32)0)))) goto LA112_;
|
|
raiseOSError__stdZoserrors_70(res, (*data).sysCommand);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA112_: ;
|
|
result = pid;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_745)(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA* dest) {
|
|
eqdestroy___stdZassertions_13((&(*dest).sysCommand));
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg*, nospstartProcess)(NimStringV2 command, NimStringV2 workingDir, NimStringV2* args, NI argsLen_0, tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* env, tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options) {
|
|
tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* result;
|
|
tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA data;
|
|
tySequence__sM4lkSb7zS6F7OVMvW9cffQ sysArgsRaw;
|
|
tyArray__bpgyACnpuq1ETodMD6DE5w pStdin;
|
|
tyArray__bpgyACnpuq1ETodMD6DE5w pStdout;
|
|
tyArray__bpgyACnpuq1ETodMD6DE5w pStderr;
|
|
pid_t pid;
|
|
NCSTRING* sysArgs;
|
|
NCSTRING* colontmpD__4;
|
|
NCSTRING* colontmpD__5;
|
|
NCSTRING* sysEnv;
|
|
NimStringV2 currentDir;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = NIM_NIL;
|
|
nimZeroMem((void*)(&data), sizeof(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA));
|
|
sysArgsRaw.len = 0; sysArgsRaw.p = NIM_NIL;
|
|
nimZeroMem((void*)pStdin, sizeof(tyArray__bpgyACnpuq1ETodMD6DE5w));
|
|
nimZeroMem((void*)pStdout, sizeof(tyArray__bpgyACnpuq1ETodMD6DE5w));
|
|
nimZeroMem((void*)pStderr, sizeof(tyArray__bpgyACnpuq1ETodMD6DE5w));
|
|
eqdestroy___pureZosproc_203(&result);
|
|
result = (tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg*) nimNewObj(sizeof(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg), NIM_ALIGNOF(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg));
|
|
(*result).Sup.m_type = (&NTIv2__2rGNQnv9bU4hanI2g3svReg_);
|
|
(*result).options = options;
|
|
(*result).exitFlag = NIM_TRUE;
|
|
{
|
|
if (!!(((options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)4)))&7U)))!=0))) goto LA4_;
|
|
{
|
|
NIM_BOOL T8_;
|
|
NIM_BOOL T9_;
|
|
int T10_;
|
|
int T12_;
|
|
int T14_;
|
|
NI32 T17_;
|
|
T8_ = (NIM_BOOL)0;
|
|
T9_ = (NIM_BOOL)0;
|
|
T10_ = (int)0;
|
|
T10_ = pipe(pStdin);
|
|
T9_ = !((T10_ == ((NI32)0)));
|
|
if (T9_) goto LA11_;
|
|
T12_ = (int)0;
|
|
T12_ = pipe(pStdout);
|
|
T9_ = !((T12_ == ((NI32)0)));
|
|
LA11_: ;
|
|
T8_ = T9_;
|
|
if (T8_) goto LA13_;
|
|
T14_ = (int)0;
|
|
T14_ = pipe(pStderr);
|
|
T8_ = !((T14_ == ((NI32)0)));
|
|
LA13_: ;
|
|
if (!T8_) goto LA15_;
|
|
T17_ = (NI32)0;
|
|
T17_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
raiseOSError__stdZoserrors_70(T17_, TM__HZdw8BhppcTQo8DIK46LSg_4);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
}
|
|
LA15_: ;
|
|
}
|
|
LA4_: ;
|
|
{
|
|
NimStringV2 colontmpD_;
|
|
if (!((options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)2)))&7U)))!=0)) goto LA20_;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
eqsink___stdZassertions_19((&data.sysCommand), TM__HZdw8BhppcTQo8DIK46LSg_6);
|
|
sysArgsRaw.len = 3; sysArgsRaw.p = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content*) newSeqPayload(3, sizeof(NimStringV2), NIM_ALIGNOF(NimStringV2));
|
|
sysArgsRaw.p->data[0] = TM__HZdw8BhppcTQo8DIK46LSg_7;
|
|
sysArgsRaw.p->data[1] = TM__HZdw8BhppcTQo8DIK46LSg_9;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD_), command);
|
|
sysArgsRaw.p->data[2] = colontmpD_;
|
|
}
|
|
goto LA18_;
|
|
LA20_: ;
|
|
{
|
|
NimStringV2 colontmpD__2;
|
|
colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&data.sysCommand), command);
|
|
sysArgsRaw.len = 1; sysArgsRaw.p = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content*) newSeqPayload(1, sizeof(NimStringV2), NIM_ALIGNOF(NimStringV2));
|
|
colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD__2), command);
|
|
sysArgsRaw.p->data[0] = colontmpD__2;
|
|
{
|
|
NimStringV2* arg;
|
|
NI i;
|
|
arg = (NimStringV2*)0;
|
|
i = ((NI)0);
|
|
{
|
|
while (1) {
|
|
NimStringV2 colontmpD__3;
|
|
if (!(i < argsLen_0)) goto LA25 ;
|
|
colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
|
|
arg = (&args[i]);
|
|
colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD__3), (*arg));
|
|
add__stdZenumutils_69((&sysArgsRaw), colontmpD__3);
|
|
i += ((NI)1);
|
|
} LA25: ;
|
|
}
|
|
}
|
|
}
|
|
LA18_: ;
|
|
pid = (pid_t)0;
|
|
sysArgs = allocCStringArray__system_3574(((sysArgsRaw).p) ? (sysArgsRaw.p->data) : NIM_NIL, sysArgsRaw.len);
|
|
colontmpD__4 = (NCSTRING*)0;
|
|
colontmpD__5 = (NCSTRING*)0;
|
|
{
|
|
if (!(env == ((tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*) NIM_NIL))) goto LA29_;
|
|
colontmpD__4 = envToCStringArray__pureZosproc_618();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
|
|
sysEnv = colontmpD__4;
|
|
}
|
|
goto LA27_;
|
|
LA29_: ;
|
|
{
|
|
colontmpD__5 = envToCStringArray__pureZosproc_606(env);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
|
|
sysEnv = colontmpD__5;
|
|
}
|
|
LA27_: ;
|
|
currentDir.len = 0; currentDir.p = NIM_NIL;
|
|
data.sysArgs = sysArgs;
|
|
data.sysEnv = sysEnv;
|
|
nimCopyMem((void*)data.pStdin, (NIM_CONST void*)pStdin, sizeof(tyArray__bpgyACnpuq1ETodMD6DE5w));
|
|
nimCopyMem((void*)data.pStdout, (NIM_CONST void*)pStdout, sizeof(tyArray__bpgyACnpuq1ETodMD6DE5w));
|
|
nimCopyMem((void*)data.pStderr, (NIM_CONST void*)pStderr, sizeof(tyArray__bpgyACnpuq1ETodMD6DE5w));
|
|
data.workingDir = nimToCStringConv(workingDir);
|
|
data.options = options;
|
|
currentDir = nosgetCurrentDir();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA33_;
|
|
pid = startProcessAuxSpawn__pureZosproc_648((&data));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA33_;
|
|
{
|
|
if (!(((NI)0) < workingDir.len)) goto LA36_;
|
|
setCurrentDir__stdZprivateZosdirs_468(currentDir);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA33_;
|
|
}
|
|
LA36_: ;
|
|
{
|
|
NimStringV2 colontmpD__6;
|
|
tyArray__24KAM9afIUgUaqBaEBB6r9bg T43_;
|
|
if (!((options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)0)))&7U)))!=0)) goto LA40_;
|
|
colontmpD__6.len = 0; colontmpD__6.p = NIM_NIL;
|
|
T43_[0] = command;
|
|
T43_[1] = TM__HZdw8BhppcTQo8DIK46LSg_27;
|
|
colontmpD__6 = nsuJoinSep(args, argsLen_0, TM__HZdw8BhppcTQo8DIK46LSg_28);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
|
|
T43_[2] = colontmpD__6;
|
|
echoBinSafe(T43_, 3);
|
|
{
|
|
LA42_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&colontmpD__6));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA33_;
|
|
}
|
|
LA40_: ;
|
|
(*result).id = pid;
|
|
(*result).exitFlag = NIM_FALSE;
|
|
{
|
|
if (!((options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)4)))&7U)))!=0)) goto LA48_;
|
|
(*result).inHandle = ((int)0);
|
|
(*result).outHandle = ((int)1);
|
|
{
|
|
if (!((options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)3)))&7U)))!=0)) goto LA52_;
|
|
(*result).errHandle = (*result).outHandle;
|
|
}
|
|
goto LA50_;
|
|
LA52_: ;
|
|
{
|
|
(*result).errHandle = ((int)2);
|
|
}
|
|
LA50_: ;
|
|
}
|
|
goto LA46_;
|
|
LA48_: ;
|
|
{
|
|
int T62_;
|
|
int T63_;
|
|
int T64_;
|
|
(*result).inHandle = pStdin[(((NI)1))- 0];
|
|
(*result).outHandle = pStdout[(((NI)0))- 0];
|
|
{
|
|
int T60_;
|
|
if (!((options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)3)))&7U)))!=0)) goto LA58_;
|
|
(*result).errHandle = (*result).outHandle;
|
|
T60_ = (int)0;
|
|
T60_ = close(pStderr[(((NI)0))- 0]);
|
|
(void)(T60_);
|
|
}
|
|
goto LA56_;
|
|
LA58_: ;
|
|
{
|
|
(*result).errHandle = pStderr[(((NI)0))- 0];
|
|
}
|
|
LA56_: ;
|
|
T62_ = (int)0;
|
|
T62_ = close(pStderr[(((NI)1))- 0]);
|
|
(void)(T62_);
|
|
T63_ = (int)0;
|
|
T63_ = close(pStdin[(((NI)0))- 0]);
|
|
(void)(T63_);
|
|
T64_ = (int)0;
|
|
T64_ = close(pStdout[(((NI)1))- 0]);
|
|
(void)(T64_);
|
|
}
|
|
LA46_: ;
|
|
{
|
|
LA33_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((¤tDir));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA32_;
|
|
{
|
|
LA32_:;
|
|
}
|
|
{
|
|
deallocCStringArray__system_3614(sysEnv);
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
|
|
{
|
|
LA26_:;
|
|
}
|
|
{
|
|
deallocCStringArray__system_3614(sysArgs);
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
eqdestroy___system_3540((&sysArgsRaw));
|
|
eqdestroy___pureZosproc_745((&data));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*, createStream__pureZosproc_920)(int* handle, tyEnum_FileMode__4sJyy9aOSN8X63XdWXl5iDg fileMode) {
|
|
tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ* result;
|
|
FILE* f;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = NIM_NIL;
|
|
f = (FILE*)0;
|
|
{
|
|
NIM_BOOL T3_;
|
|
NI32 T6_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = open__stdZsyncio_439(&f, (*handle), fileMode);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
if (!!(T3_)) goto LA4_;
|
|
T6_ = (NI32)0;
|
|
T6_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T6_, TM__HZdw8BhppcTQo8DIK46LSg_29);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA4_: ;
|
|
result = newFileStream__pureZstreams_911(f);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*, nospinputStream)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p) {
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = NIM_NIL;
|
|
{
|
|
tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ* T5_;
|
|
if (!((*p).inStream == ((tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*) NIM_NIL))) goto LA3_;
|
|
T5_ = NIM_NIL;
|
|
T5_ = createStream__pureZosproc_920((&(*p).inHandle), ((tyEnum_FileMode__4sJyy9aOSN8X63XdWXl5iDg)1));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
eqsink___pureZstreams_620(&(*p).inStream, &T5_->Sup);
|
|
}
|
|
LA3_: ;
|
|
eqcopy___pureZstreams_616(&result, (*p).inStream, NIM_FALSE);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*, nospoutputStream)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p) {
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = NIM_NIL;
|
|
{
|
|
tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ* T5_;
|
|
if (!((*p).outStream == ((tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*) NIM_NIL))) goto LA3_;
|
|
T5_ = NIM_NIL;
|
|
T5_ = createStream__pureZosproc_920((&(*p).outHandle), ((tyEnum_FileMode__4sJyy9aOSN8X63XdWXl5iDg)0));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
eqsink___pureZstreams_620(&(*p).outStream, &T5_->Sup);
|
|
}
|
|
LA3_: ;
|
|
eqcopy___pureZstreams_616(&result, (*p).outStream, NIM_FALSE);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nospwaitForExit)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p, NI timeout) {
|
|
NI result;
|
|
int T56_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
{
|
|
int T5_;
|
|
if (!(*p).exitFlag) goto LA3_;
|
|
T5_ = (int)0;
|
|
T5_ = exitStatusLikeShell__pureZos_144((*p).exitStatus);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = ((NI) (T5_));
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
{
|
|
int status;
|
|
if (!(timeout == ((NI)-1))) goto LA8_;
|
|
status = ((int)1);
|
|
{
|
|
pid_t T12_;
|
|
NI32 T15_;
|
|
T12_ = (pid_t)0;
|
|
T12_ = waitpid((*p).id, (&status), ((int)0));
|
|
if (!(T12_ < ((NI32)0))) goto LA13_;
|
|
T15_ = (NI32)0;
|
|
T15_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T15_, TM__HZdw8BhppcTQo8DIK46LSg_30);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA13_: ;
|
|
(*p).exitFlag = NIM_TRUE;
|
|
(*p).exitStatus = status;
|
|
}
|
|
goto LA6_;
|
|
LA8_: ;
|
|
{
|
|
object_wait_info info;
|
|
nimZeroMem((void*)(&info), sizeof(object_wait_info));
|
|
info.object = (*p).id;
|
|
info.type = ((NU16)3);
|
|
info.events = ((NU16)4096);
|
|
{
|
|
while (1) {
|
|
int status_2;
|
|
long count;
|
|
status_2 = ((int)1);
|
|
count = wait_for_objects_etc((&info), ((int)1), ((NU32)8), ((NI64) (timeout)));
|
|
{
|
|
int err;
|
|
if (!(count < ((NI)0))) goto LA21_;
|
|
err = ((int) (count));
|
|
{
|
|
if (!(err == ETIMEDOUT)) goto LA25_;
|
|
{
|
|
int T29_;
|
|
NI32 T32_;
|
|
T29_ = (int)0;
|
|
T29_ = kill((*p).id, SIGKILL);
|
|
if (!(T29_ == ((NI32)-1))) goto LA30_;
|
|
T32_ = (NI32)0;
|
|
T32_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T32_, TM__HZdw8BhppcTQo8DIK46LSg_31);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA30_: ;
|
|
{
|
|
pid_t T35_;
|
|
NI32 T38_;
|
|
T35_ = (pid_t)0;
|
|
T35_ = waitpid((*p).id, (&status_2), ((int)0));
|
|
if (!(T35_ < ((NI32)0))) goto LA36_;
|
|
T38_ = (NI32)0;
|
|
T38_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T38_, TM__HZdw8BhppcTQo8DIK46LSg_32);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA36_: ;
|
|
(*p).exitFlag = NIM_TRUE;
|
|
(*p).exitStatus = status_2;
|
|
goto LA17;
|
|
}
|
|
goto LA23_;
|
|
LA25_: ;
|
|
{
|
|
if (!!((err == EINTR))) goto LA40_;
|
|
raiseOSError__stdZoserrors_70(err, TM__HZdw8BhppcTQo8DIK46LSg_33);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
goto LA23_;
|
|
LA40_: ;
|
|
LA23_: ;
|
|
}
|
|
goto LA19_;
|
|
LA21_: ;
|
|
{
|
|
if (!(((NI)0) < count)) goto LA43_;
|
|
{
|
|
pid_t T47_;
|
|
NI32 T50_;
|
|
T47_ = (pid_t)0;
|
|
T47_ = waitpid((*p).id, (&status_2), ((int)0));
|
|
if (!(T47_ < ((NI32)0))) goto LA48_;
|
|
T50_ = (NI32)0;
|
|
T50_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T50_, TM__HZdw8BhppcTQo8DIK46LSg_34);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA48_: ;
|
|
(*p).exitFlag = NIM_TRUE;
|
|
(*p).exitStatus = status_2;
|
|
goto LA17;
|
|
}
|
|
goto LA19_;
|
|
LA43_: ;
|
|
{
|
|
{
|
|
if (!NIM_TRUE) goto LA54_;
|
|
failedAssertImpl__stdZassertions_224(TM__HZdw8BhppcTQo8DIK46LSg_36);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA54_: ;
|
|
}
|
|
LA19_: ;
|
|
}
|
|
} LA17: ;
|
|
}
|
|
LA6_: ;
|
|
T56_ = (int)0;
|
|
T56_ = exitStatusLikeShell__pureZos_144((*p).exitStatus);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = ((NI) (T56_));
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, nospclose)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p) {
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
{
|
|
if (!!((((*p).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA)4)))&7U)))!=0))) goto LA3_;
|
|
{
|
|
if (!!(((*p).inStream == ((tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*) NIM_NIL)))) goto LA7_;
|
|
close__pureZstreams_58((*p).inStream);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
goto LA5_;
|
|
LA7_: ;
|
|
{
|
|
int T10_;
|
|
T10_ = (int)0;
|
|
T10_ = close((*p).inHandle);
|
|
(void)(T10_);
|
|
}
|
|
LA5_: ;
|
|
{
|
|
if (!!(((*p).outStream == ((tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*) NIM_NIL)))) goto LA13_;
|
|
close__pureZstreams_58((*p).outStream);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
goto LA11_;
|
|
LA13_: ;
|
|
{
|
|
int T16_;
|
|
T16_ = (int)0;
|
|
T16_ = close((*p).outHandle);
|
|
(void)(T16_);
|
|
}
|
|
LA11_: ;
|
|
{
|
|
if (!!(((*p).errStream == ((tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*) NIM_NIL)))) goto LA19_;
|
|
close__pureZstreams_58((*p).errStream);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
goto LA17_;
|
|
LA19_: ;
|
|
{
|
|
int T22_;
|
|
T22_ = (int)0;
|
|
T22_ = close((*p).errHandle);
|
|
(void)(T22_);
|
|
}
|
|
LA17_: ;
|
|
}
|
|
LA3_: ;
|
|
}BeforeRet_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_1640)(tyTuple__XOVT24GHXwqiEj5GCsEGCA* dest) {
|
|
eqdestroy___stdZassertions_13((&(*dest).Field0));
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus__pureZosproc_603)(int status) {
|
|
NIM_BOOL result;
|
|
NIM_BOOL T1_;
|
|
result = (NIM_BOOL)0;
|
|
T1_ = (NIM_BOOL)0;
|
|
T1_ = WIFEXITED(status);
|
|
if (T1_) goto LA2_;
|
|
T1_ = WIFSIGNALED(status);
|
|
LA2_: ;
|
|
result = T1_;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nosppeekExitCode)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p) {
|
|
NI result;
|
|
int status;
|
|
pid_t ret;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
status = ((int)0);
|
|
result = ((NI)-1);
|
|
{
|
|
int T5_;
|
|
if (!(*p).exitFlag) goto LA3_;
|
|
T5_ = (int)0;
|
|
T5_ = exitStatusLikeShell__pureZos_144((*p).exitStatus);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = ((NI) (T5_));
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
ret = waitpid((*p).id, (&status), WNOHANG);
|
|
{
|
|
if (!(((NI32)0) < ret)) goto LA8_;
|
|
{
|
|
NIM_BOOL T12_;
|
|
int T15_;
|
|
T12_ = (NIM_BOOL)0;
|
|
T12_ = isExitStatus__pureZosproc_603(status);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
if (!T12_) goto LA13_;
|
|
(*p).exitFlag = NIM_TRUE;
|
|
(*p).exitStatus = status;
|
|
T15_ = (int)0;
|
|
T15_ = exitStatusLikeShell__pureZos_144(status);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = ((NI) (T15_));
|
|
}
|
|
LA13_: ;
|
|
}
|
|
LA8_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tyTuple__XOVT24GHXwqiEj5GCsEGCA, execCmdEx__pureZosproc_1599)(NimStringV2 command, tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options, tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* env, NimStringV2 workingDir, NimStringV2 input) {
|
|
tyTuple__XOVT24GHXwqiEj5GCsEGCA result;
|
|
tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p;
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* outp;
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* colontmpD_;
|
|
NimStringV2 colontmp_;
|
|
NimStringV2 line;
|
|
tyArray__8ZvwQIddfpj2THRVPsFzIQ T2_;
|
|
NI colontmp__2;
|
|
NimStringV2 blitTmp;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimZeroMem((void*)(&result), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
|
|
p = NIM_NIL;
|
|
outp = NIM_NIL;
|
|
colontmpD_ = NIM_NIL;
|
|
colontmp_.len = 0; colontmp_.p = NIM_NIL;
|
|
line.len = 0; line.p = NIM_NIL;
|
|
p = nospstartProcess(command, workingDir, T2_, 0, env, (options | 4));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
outp = nospoutputStream(p);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
{
|
|
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* colontmpD__2;
|
|
if (!(((NI)0) < input.len)) goto LA5_;
|
|
colontmpD__2 = NIM_NIL;
|
|
colontmpD__2 = nospinputStream(p);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA7_;
|
|
write__pureZstreams_184(colontmpD__2, input);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA7_;
|
|
{
|
|
LA7_:;
|
|
}
|
|
{
|
|
eqdestroy___pureZstreams_613(&colontmpD__2);
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
}
|
|
LA5_: ;
|
|
colontmpD_ = nospinputStream(p);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
close__pureZstreams_58(colontmpD_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
colontmp_ = TM__HZdw8BhppcTQo8DIK46LSg_37;
|
|
colontmp__2 = ((NI)-1);
|
|
blitTmp = colontmp_;
|
|
colontmp_.len = 0; colontmp_.p = NIM_NIL;
|
|
result.Field0 = blitTmp;
|
|
result.Field1 = colontmp__2;
|
|
line = rawNewString(((NI)120));
|
|
{
|
|
while (1) {
|
|
{
|
|
NIM_BOOL T14_;
|
|
T14_ = (NIM_BOOL)0;
|
|
T14_ = readLine__pureZstreams_543(outp, (&line));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
if (!T14_) goto LA15_;
|
|
prepareAdd((&result.Field0), line.len + 0);
|
|
appendString((&result.Field0), line);
|
|
prepareAdd((&result.Field0), 1);
|
|
appendString((&result.Field0), TM__HZdw8BhppcTQo8DIK46LSg_39);
|
|
}
|
|
goto LA12_;
|
|
LA15_: ;
|
|
{
|
|
NI T18_;
|
|
T18_ = (NI)0;
|
|
T18_ = nosppeekExitCode(p);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
result.Field1 = T18_;
|
|
{
|
|
if (!!((result.Field1 == ((NI)-1)))) goto LA21_;
|
|
goto LA10;
|
|
}
|
|
LA21_: ;
|
|
}
|
|
LA12_: ;
|
|
}
|
|
} LA10: ;
|
|
nospclose(p);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&line));
|
|
eqdestroy___stdZassertions_13((&colontmp_));
|
|
eqdestroy___pureZstreams_613(&colontmpD_);
|
|
eqdestroy___pureZstreams_613(&outp);
|
|
eqdestroy___pureZosproc_203(&p);
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nospexecCmd)(NimStringV2 command) {
|
|
NI result;
|
|
int colontmpD_;
|
|
int colontmpD__2;
|
|
int tmp;
|
|
int T1_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
colontmpD_ = (int)0;
|
|
colontmpD__2 = (int)0;
|
|
tmp = system(nimToCStringConv(command));
|
|
T1_ = (int)0;
|
|
{
|
|
if (!(tmp == ((NI32)-1))) goto LA4_;
|
|
colontmpD_ = tmp;
|
|
T1_ = colontmpD_;
|
|
}
|
|
goto LA2_;
|
|
LA4_: ;
|
|
{
|
|
colontmpD__2 = exitStatusLikeShell__pureZos_144(tmp);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T1_ = colontmpD__2;
|
|
}
|
|
LA2_: ;
|
|
result = ((NI) (T1_));
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZosproc_1646)(tyTuple__XOVT24GHXwqiEj5GCsEGCA* dest, tyTuple__XOVT24GHXwqiEj5GCsEGCA src) {
|
|
if ((*dest).Field0.p != src.Field0.p) { eqdestroy___stdZassertions_13((&(*dest).Field0));
|
|
}
|
|
(*dest).Field0.len = src.Field0.len; (*dest).Field0.p = src.Field0.p;
|
|
(*dest).Field1 = src.Field1;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_528)(tyProc__SqRJqa5aOiKB4EuKlKh9asA* dest) {
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = nimDecRefIsLastCyclicDyn((*dest).ClE_0);
|
|
if (!T3_) goto LA4_;
|
|
nimDestroyAndDispose((*dest).ClE_0);
|
|
}
|
|
LA4_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nospcountProcessors)(void) {
|
|
NI result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
result = ncpicountProcessors();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZosproc_210)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg** dest, tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* src) {
|
|
tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* colontmp_;
|
|
colontmp_ = (*dest);
|
|
(*dest) = src;
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = nimDecRefIsLastCyclicDyn(colontmp_);
|
|
if (!T3_) goto LA4_;
|
|
nimDestroyAndDispose(colontmp_);
|
|
}
|
|
LA4_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosprunning)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p) {
|
|
NIM_BOOL result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NIM_BOOL)0;
|
|
{
|
|
if (!(*p).exitFlag) goto LA3_;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
int status;
|
|
pid_t ret;
|
|
status = ((int)1);
|
|
ret = waitpid((*p).id, (&status), WNOHANG);
|
|
{
|
|
if (!(ret == ((NI32) (((NI) ((*p).id)))))) goto LA8_;
|
|
{
|
|
NIM_BOOL T12_;
|
|
T12_ = (NIM_BOOL)0;
|
|
T12_ = isExitStatus__pureZosproc_603(status);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
if (!T12_) goto LA13_;
|
|
(*p).exitFlag = NIM_TRUE;
|
|
(*p).exitStatus = status;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA10_;
|
|
LA13_: ;
|
|
{
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA10_: ;
|
|
}
|
|
goto LA6_;
|
|
LA8_: ;
|
|
{
|
|
if (!(ret == ((NI32)0))) goto LA17_;
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA6_;
|
|
LA17_: ;
|
|
{
|
|
NI32 T20_;
|
|
T20_ = (NI32)0;
|
|
T20_ = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
raiseOSError__stdZoserrors_70(T20_, TM__HZdw8BhppcTQo8DIK46LSg_43);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA6_: ;
|
|
}
|
|
LA1_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nospexecProcesses)(NimStringV2* cmds, NI cmdsLen_0, tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options, NI n, tyProc__SqRJqa5aOiKB4EuKlKh9asA beforeRunEvent, tyProc__oudJckli4GdxAXLVzBBlAw afterRunEvent) {
|
|
NI result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
{
|
|
tySequence__PrBYolTs4TOSgE8v5oqDUQ q;
|
|
tySequence__qwqHTkRvwhrRyENtudHQ7g idxs;
|
|
NI i;
|
|
NI m;
|
|
NI ecount;
|
|
if (!(((NI)1) < n)) goto LA3_;
|
|
q.len = 0; q.p = NIM_NIL;
|
|
idxs.len = 0; idxs.p = NIM_NIL;
|
|
i = ((NI)0);
|
|
q = newSeq__pureZosproc_264(((NI) (n)));
|
|
idxs = newSeq__pureZosproc_395(((NI) (n)));
|
|
m = ((n <= cmdsLen_0) ? n : cmdsLen_0);
|
|
{
|
|
while (1) {
|
|
tyArray__8ZvwQIddfpj2THRVPsFzIQ T12_;
|
|
tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* T13_;
|
|
if (!(i < m)) goto LA7 ;
|
|
{
|
|
if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_40.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_40.ClE_0))) goto LA10_;
|
|
beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_41)(beforeRunEvent.ClP_0))(i);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
}
|
|
LA10_: ;
|
|
T13_ = NIM_NIL;
|
|
T13_ = nospstartProcess(cmds[i], TM__HZdw8BhppcTQo8DIK46LSg_42, T12_, 0, ((tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*) NIM_NIL), (options | 4));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
eqsink___pureZosproc_210(&q.p->data[i], T13_);
|
|
idxs.p->data[i] = i;
|
|
i += ((NI)1);
|
|
} LA7: ;
|
|
}
|
|
ecount = cmdsLen_0;
|
|
{
|
|
while (1) {
|
|
if (!(((NI)0) < ecount)) goto LA15 ;
|
|
{
|
|
NI rexit;
|
|
int status;
|
|
pid_t res;
|
|
rexit = ((NI)-1);
|
|
status = ((int)1);
|
|
res = waitpid(((pid_t)-1), (&status), ((int)0));
|
|
{
|
|
if (!(((NI32)0) < res)) goto LA19_;
|
|
{
|
|
NI r;
|
|
NI colontmp_;
|
|
NI res_2;
|
|
r = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
colontmp_ = (NI)(m - ((NI)1));
|
|
res_2 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(res_2 <= colontmp_)) goto LA23 ;
|
|
r = res_2;
|
|
{
|
|
NIM_BOOL T26_;
|
|
T26_ = (NIM_BOOL)0;
|
|
T26_ = !((q.p->data[r] == 0));
|
|
if (!(T26_)) goto LA27_;
|
|
T26_ = ((*q.p->data[r]).id == res);
|
|
LA27_: ;
|
|
if (!T26_) goto LA28_;
|
|
{
|
|
NIM_BOOL T32_;
|
|
T32_ = (NIM_BOOL)0;
|
|
T32_ = WIFEXITED(status);
|
|
if (T32_) goto LA33_;
|
|
T32_ = WIFSIGNALED(status);
|
|
LA33_: ;
|
|
if (!T32_) goto LA34_;
|
|
(*q.p->data[r]).exitFlag = NIM_TRUE;
|
|
(*q.p->data[r]).exitStatus = status;
|
|
rexit = r;
|
|
goto LA21;
|
|
}
|
|
LA34_: ;
|
|
}
|
|
LA28_: ;
|
|
res_2 += ((NI)1);
|
|
} LA23: ;
|
|
}
|
|
} LA21: ;
|
|
}
|
|
goto LA17_;
|
|
LA19_: ;
|
|
{
|
|
NI32 err;
|
|
err = osLastError__stdZoserrors_73();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
{
|
|
if (!(err == ECHILD)) goto LA39_;
|
|
{
|
|
NI r_2;
|
|
NI colontmp__2;
|
|
NI res_3;
|
|
r_2 = (NI)0;
|
|
colontmp__2 = (NI)0;
|
|
colontmp__2 = (NI)(m - ((NI)1));
|
|
res_3 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(res_3 <= colontmp__2)) goto LA43 ;
|
|
r_2 = res_3;
|
|
{
|
|
NIM_BOOL T46_;
|
|
NIM_BOOL T48_;
|
|
T46_ = (NIM_BOOL)0;
|
|
T46_ = !((q.p->data[r_2] == 0));
|
|
if (!(T46_)) goto LA47_;
|
|
T48_ = (NIM_BOOL)0;
|
|
T48_ = nosprunning(q.p->data[r_2]);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
T46_ = !(T48_);
|
|
LA47_: ;
|
|
if (!T46_) goto LA49_;
|
|
(*q.p->data[r_2]).exitFlag = NIM_TRUE;
|
|
(*q.p->data[r_2]).exitStatus = status;
|
|
rexit = r_2;
|
|
goto LA41;
|
|
}
|
|
LA49_: ;
|
|
res_3 += ((NI)1);
|
|
} LA43: ;
|
|
}
|
|
} LA41: ;
|
|
}
|
|
goto LA37_;
|
|
LA39_: ;
|
|
{
|
|
if (!(err == EINTR)) goto LA52_;
|
|
goto LA16;
|
|
}
|
|
goto LA37_;
|
|
LA52_: ;
|
|
{
|
|
raiseOSError__stdZoserrors_70(err, TM__HZdw8BhppcTQo8DIK46LSg_44);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
}
|
|
LA37_: ;
|
|
}
|
|
LA17_: ;
|
|
{
|
|
NI T59_;
|
|
if (!(((NI)0) <= rexit)) goto LA57_;
|
|
T59_ = (NI)0;
|
|
T59_ = nosppeekExitCode(q.p->data[rexit]);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
result = ((result >= (T59_ > 0? (T59_) : -(T59_))) ? result : (T59_ > 0? (T59_) : -(T59_)));
|
|
{
|
|
if (!!((afterRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_45.ClP_0 && afterRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_45.ClE_0))) goto LA62_;
|
|
afterRunEvent.ClE_0? afterRunEvent.ClP_0(idxs.p->data[rexit], q.p->data[rexit], afterRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_46)(afterRunEvent.ClP_0))(idxs.p->data[rexit], q.p->data[rexit]);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
}
|
|
LA62_: ;
|
|
nospclose(q.p->data[rexit]);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
{
|
|
tyArray__8ZvwQIddfpj2THRVPsFzIQ T72_;
|
|
tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* T73_;
|
|
if (!(i < cmdsLen_0)) goto LA66_;
|
|
{
|
|
if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_40.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_40.ClE_0))) goto LA70_;
|
|
beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_47)(beforeRunEvent.ClP_0))(i);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
}
|
|
LA70_: ;
|
|
T73_ = NIM_NIL;
|
|
T73_ = nospstartProcess(cmds[i], TM__HZdw8BhppcTQo8DIK46LSg_48, T72_, 0, ((tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*) NIM_NIL), (options | 4));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
|
|
eqsink___pureZosproc_210(&q.p->data[rexit], T73_);
|
|
idxs.p->data[rexit] = i;
|
|
i += ((NI)1);
|
|
}
|
|
goto LA64_;
|
|
LA66_: ;
|
|
{
|
|
eqsink___pureZosproc_210(&q.p->data[rexit], ((tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg*) NIM_NIL));
|
|
}
|
|
LA64_: ;
|
|
ecount -= ((NI)1);
|
|
}
|
|
LA57_: ;
|
|
} LA16: ;
|
|
} LA15: ;
|
|
}
|
|
{
|
|
LA5_:;
|
|
}
|
|
{
|
|
eqdestroy___pureZosproc_403((&idxs));
|
|
eqdestroy___pureZosproc_272((&q));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
{
|
|
NI i_2;
|
|
NI colontmp__3;
|
|
NI res_4;
|
|
i_2 = (NI)0;
|
|
colontmp__3 = (NI)0;
|
|
colontmp__3 = (cmdsLen_0-1);
|
|
res_4 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p;
|
|
tyArray__8ZvwQIddfpj2THRVPsFzIQ T86_;
|
|
NI T87_;
|
|
if (!(res_4 <= colontmp__3)) goto LA80 ;
|
|
p = NIM_NIL;
|
|
i_2 = res_4;
|
|
{
|
|
if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_40.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_40.ClE_0))) goto LA84_;
|
|
beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i_2, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_49)(beforeRunEvent.ClP_0))(i_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA81_;
|
|
}
|
|
LA84_: ;
|
|
p = nospstartProcess(cmds[i_2], TM__HZdw8BhppcTQo8DIK46LSg_50, T86_, 0, ((tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*) NIM_NIL), (options | 4));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA81_;
|
|
T87_ = (NI)0;
|
|
T87_ = nospwaitForExit(p, ((NI)-1));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA81_;
|
|
result = (((T87_ > 0? (T87_) : -(T87_)) >= result) ? (T87_ > 0? (T87_) : -(T87_)) : result);
|
|
{
|
|
if (!!((afterRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_45.ClP_0 && afterRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_45.ClE_0))) goto LA90_;
|
|
afterRunEvent.ClE_0? afterRunEvent.ClP_0(i_2, p, afterRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_51)(afterRunEvent.ClP_0))(i_2, p);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA81_;
|
|
}
|
|
LA90_: ;
|
|
nospclose(p);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA81_;
|
|
res_4 += ((NI)1);
|
|
{
|
|
LA81_:;
|
|
}
|
|
{
|
|
eqdestroy___pureZosproc_203(&p);
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
} LA80: ;
|
|
}
|
|
}
|
|
}
|
|
LA1_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_548)(tyProc__oudJckli4GdxAXLVzBBlAw* dest) {
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = nimDecRefIsLastCyclicDyn((*dest).ClE_0);
|
|
if (!T3_) goto LA4_;
|
|
nimDestroyAndDispose((*dest).ClE_0);
|
|
}
|
|
LA4_: ;
|
|
}
|