AcessNative - Added heap shim to libacess-native, disabled spawn
authorJohn Hodge <[email protected]>
Mon, 22 Jul 2013 12:05:12 +0000 (20:05 +0800)
committerJohn Hodge <[email protected]>
Mon, 22 Jul 2013 12:05:12 +0000 (20:05 +0800)
AcessNative/libacess-native.so_src/Makefile
AcessNative/libacess-native.so_src/exports.c
AcessNative/libacess-native.so_src/heap.c [new file with mode: 0644]

index 0a074a6..d67f319 100644 (file)
@@ -5,7 +5,7 @@ ifeq ($(PLATFORM),)
        PLATFORM := lin
 endif
 
-OBJ := main.o syscalls.o request.o memory.o exports.o
+OBJ := main.o syscalls.o request.o memory.o exports.o heap.o
 OBJ := $(addprefix obj-$(PLATFORM)/,$(OBJ))
 
 ifeq ($(PLATFORM),win)
index f22fe46..17ee997 100644 (file)
@@ -26,11 +26,12 @@ int acess__SysSpawn(const char *binary, const char **argv, const char **envp, in
                info ? sizeof(*info) : 0, info);
        
 
+       Warning("TODO: Spawn '%s'", binary);
        // TODO: Translate internal path to actual path 
 
        // TODO: set environment variables for libacess-native
        // > ACESSNATIVE_KEY=`newID`
-       native_spawn(binary, argv, envp);
+       //native_spawn(binary, argv, envp);
 
        return 0;
 }
diff --git a/AcessNative/libacess-native.so_src/heap.c b/AcessNative/libacess-native.so_src/heap.c
new file mode 100644 (file)
index 0000000..7e340f5
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * AcessNative libacess-native
+ * - By John Hodge (thePowersGang)
+ *
+ * heap.c
+ * - Proxies for the C standard heap
+ */
+#include <stdlib.h>
+
+void *acess_malloc(size_t bytes)
+{
+       return malloc(bytes);
+}
+
+void acess_free(void *ptr)
+{
+       free(ptr);
+}
+
+void *acess_calloc(size_t __nmemb, size_t __size)
+{
+       return calloc(__nmemb, __size);
+}
+
+void *acess_realloc(void *__ptr, size_t __size)
+{
+       return realloc(__ptr, __size);
+}
+

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