X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess_src%2Fsyscalls.c;h=3c691aa10eb7ca3024965ac5032bfc691d82ead0;hb=6bcb63ea0505129d32b249772b554b0848bb5612;hp=3c07ef252b4e2f602e134824949b8d8fe2157f55;hpb=b8b25ae01e13c655608fb6705574e5218b1a519f;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/syscalls.c b/AcessNative/ld-acess_src/syscalls.c index 3c07ef25..3c691aa1 100644 --- a/AcessNative/ld-acess_src/syscalls.c +++ b/AcessNative/ld-acess_src/syscalls.c @@ -8,6 +8,7 @@ #include #include #include +#include #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; +}