#include <stdarg.h>
#include <string.h>
#include <stddef.h>
+#include <unistd.h>
#include "request.h"
#define DEBUG(str, x...) Debug(str, x)
break;
// Data (special handling)
case 'd':
- len = va_arg(*Args, int);
+ len = va_arg(*Args, size_t);
str = va_arg(*Args, char*);
// Save the pointer for later
// Create parameter block
Dest->Type = ARG_TYPE_DATA;
- Dest->Length = len;
+ Dest->Length = str ? len : 0;
Dest->Flags = 0;
if( direction & 2 )
Dest->Flags |= ARG_FLAG_RETURN;
// Has data?
if( direction & 1 )
{
- if( DataDest )
+ if( DataDest && str )
memcpy(DataDest, str, len);
}
else
free( req );
free( retPtrs );
- DEBUG(": %llx", retValue);
+ DEBUG(": %i 0x%llx", SyscallID, retValue);
return retValue;
}
{
return ftell( gaSyscall_LocalFPs[FD] );
}
+
+int native_execve(const char *filename, const char *const argv[], const char *const envp[])
+{
+ int ret;
+ ret = execve(filename, argv, envp);
+ perror("native_execve");
+ return ret;
+}