AcessNative - Fixing for recent kernel changes
[tpg/acess2.git] / AcessNative / ld-acess_src / syscalls.c
index 3c07ef2..3c691aa 100644 (file)
@@ -8,6 +8,7 @@
 #include <stdarg.h>
 #include <string.h>
 #include <stddef.h>
+#include <unistd.h>
 #include "request.h"
 
 #define DEBUG(str, x...)       Debug(str, x)
@@ -29,11 +30,13 @@ const char *ReadEntry(tRequestValue *Dest, void *DataDest, void **PtrDest, const
         int    direction = 0;  // 0: Invalid, 1: Out, 2: In, 3: Out
        char    *str;
         int    len;
-       
+
        // Eat whitespace
        while(*ArgTypes && *ArgTypes == ' ')    ArgTypes ++;
        if( *ArgTypes == '\0' ) return ArgTypes;
        
+//     DEBUG("ArgTypes = '%s'", ArgTypes);
+       
        // Get direction
        switch(*ArgTypes)
        {
@@ -290,12 +293,12 @@ void native_close(int FD)
        gaSyscall_LocalFPs[FD] = NULL;
 }
 
-size_t native_read(int FD, size_t Bytes, void *Dest)
+size_t native_read(int FD, void *Dest, size_t Bytes)
 {
        return fread( Dest, Bytes, 1, gaSyscall_LocalFPs[FD] );
 }
 
-size_t native_write(int FD, size_t Bytes, const void *Src)
+size_t native_write(int FD, const void *Src, size_t Bytes)
 {
        return fwrite( Src, Bytes, 1, gaSyscall_LocalFPs[FD] );
 }
@@ -314,3 +317,11 @@ uint64_t native_tell(int FD)
 {
        return ftell( gaSyscall_LocalFPs[FD] );
 }
+
+int native_execve(const char *filename, char *const argv[], char *const envp[])
+{
+       int ret;
+       ret = execve(filename, argv, envp);
+       perror("native_execve");
+       return ret;
+}

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