// === Types ===
// === IMPORTS ===
+extern int gbSyscallDebugEnabled;
// === GLOBALS ===
FILE *gaSyscall_LocalFPs[MAX_FPS];
tRequestHeader *req;
void *dataPtr;
uint64_t retValue;
- int i;
// DEBUG!
// printf("&tRequestHeader->Params = %i\n", offsetof(tRequestHeader, Params));
exit(127);
}
+ if( !(req->NParams >= 2) ) {
+ fprintf(stderr, "syscalls.c: Too few return params (%i)", req->NParams);
+ exit(127);
+ }
dataPtr = (void*)&req->Params[req->NParams];
- assert(req->NParams >= 2);
// return
assert(req->Params[0].Type == ARG_TYPE_INT64);
assert(req->Params[0].Length == sizeof(uint64_t));
exit(127);
}
retCount = 0;
- for( i = 2; i < req->NParams; i ++ )
+ for( unsigned int i = 2; i < req->NParams; i ++ )
{
#if 0
int j;
free( req );
free( retPtrs );
- SYSTRACE(": %i 0x%llx", SyscallID, retValue);
+ if( gbSyscallDebugEnabled ) {
+ SYSTRACE(": %i 0x%llx", SyscallID, retValue);
+ }
return retValue;
}
int native_spawn(const char *filename, const char *const argv[], const char *const envp[])
{
int rv;
-
+
+ fprintf(stderr, "native_spawn('%s')\n", filename);
+
#if __WIN32__
rv = _spawnve(_P_NOWAIT, filename, argv, envp);
#else
rv = posix_spawn(NULL, filename, NULL, NULL, (void*)argv, (void*)envp);
#endif
+ if( rv == 0 ) {
+ perror("native_spawn");
+ }
+
return rv;
}