#include <string.h>
#include <stddef.h>
#include <unistd.h>
+#ifndef __WIN32__
+# include <spawn.h> // posix_spawn
+#endif
#include "request.h"
+#if SYSCALL_TRACE
#define DEBUG(str, x...) Debug(str, x)
+#else
+#define DEBUG(...) do{}while(0)
+#endif
#define MAX_FPS 16
perror("native_execve");
return ret;
}
+
+int native_spawn(const char *filename, const char *const argv[], const char *const envp[])
+{
+ int rv;
+
+ #if __WIN32__
+ rv = _spawnve(_P_NOWAIT, filename, argv, envp);
+ #else
+ rv = posix_spawn(NULL, filename, NULL, NULL, (void*)argv, (void*)envp);
+ #endif
+
+ return rv;
+}