All - Changes for AcessNative on windows
[tpg/acess2.git] / AcessNative / ld-acess_src / syscalls.c
index 3fdbc72..d659fe5 100644 (file)
@@ -9,6 +9,9 @@
 #include <string.h>
 #include <stddef.h>
 #include <unistd.h>
+#ifndef __WIN32__
+# include <spawn.h>    // posix_spawn
+#endif
 #include "request.h"
 
 #if SYSCALL_TRACE
@@ -335,3 +338,16 @@ int native_execve(const char *filename, const char *const argv[], const char *co
        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;
+}

UCC git Repository :: git.ucc.asn.au