const char *gsAcessDir = "../Usermode/Output/x86_64";
// === CODE ===
+#ifndef __WIN32__
+#define P_NOWAIT 0
+int spawnv(int flags, const char *execuable, char * const argv[])
+{
+ int pid = fork();
+ if( pid != 0 ) return pid;
+
+ execv(execuable, argv);
+ perror("spawnv - execve");
+ for(;;);
+}
+#endif
+
int main(int argc, char *argv[])
{
char **rootapp = NULL;
# include <unistd.h>
# include <sys/socket.h>
# include <netinet/in.h>
-# include <arpa/inet.h> // inet_ntop
+# include <netdb.h> // getaddrinfo
#endif
#define DONT_INCLUDE_SYSCALL_NAMES
#include "../syscalls.h"
+++ /dev/null
-#include "common.h"
-#define _COMMON_H // stops real ld-acess.so common.h being included
-#include "../../Usermode/Libraries/ld-acess.so_src/elf.c"
--- /dev/null
+#include "common.h"
+#define _COMMON_H
+// stops real ld-acess.so common.h being included
+#include "../../Usermode/Libraries/ld-acess.so_src/elf.c"
+++ /dev/null
-#include "../../Usermode/Libraries/ld-acess.so_src/elf32.h"
--- /dev/null
+#include "../../Usermode/Libraries/ld-acess.so_src/elf32.h"
+++ /dev/null
-#include "../../Usermode/Libraries/ld-acess.so_src/elf64.h"
--- /dev/null
+#include "../../Usermode/Libraries/ld-acess.so_src/elf64.h"
int native_execve(const char *filename, const char *const argv[], const char *const envp[])
{
int ret;
- ret = execve(filename, argv, envp);
+ ret = execve(filename, (void*)argv, (void*)envp);
perror("native_execve");
return ret;
}