-
-#if 0
-void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
-{
- static void* (*func) (void *, size_t, int, int, int, off_t) = NULL;
- void *ret;
-
- if (!func)
- func = (void* (*) (void *, size_t, int, int, int, off_t)) dlsym (REAL_LIBC, "mmap");
-
- ret = (*func) (start, length, prot, flags, fd, offset);
- fprintf(stderr,"MMAP: %x, %d, %d, %d, %d, %d -> %x\n", (unsigned int)start, length, prot, flags, fd, offset, (unsigned int)ret);
- mmapped = ret;
- mmapplen = length;
-
- return ret;
-}
-
-void *mmap64(void *start, size_t length, int prot, int flags, int fd, off64_t offset)
-{
- static void* (*func) (void *, size_t, int, int, int, off64_t) = NULL;
- void *ret;
-
- if (!func)
- func = (void* (*) (void *, size_t, int, int, int, off64_t)) dlsym (REAL_LIBC, "mmap64");
-
- ret = (*func) (start, length, prot, flags, fd, offset);
- fprintf(stderr,"MMAP64: %x, %d, %d, %d, %d, %lld -> %x\n", (unsigned int)start, length, prot, flags, fd, offset, (unsigned int)ret);
- mmapped = ret;
- mmapplen = length;
-
- return ret;
-}
-
-void *mmap2(void *start, size_t length, int prot, int flags, int fd, off_t pgoffset)
-{
- static void* (*func) (void *, size_t, int, int, int, off_t) = NULL;
- void *ret;
-
- if (!func)
- func = (void* (*) (void *, size_t, int, int, int, off_t)) dlsym (REAL_LIBC, "mmap2");
-
- ret = (*func) (start, length, prot, flags, fd, pgoffset);
- fprintf(stderr,"MMAP2: %x, %d, %d, %d, %d, %d -> %x\n", (unsigned int)start, length, prot, flags, fd, pgoffset, (unsigned int)ret);
- mmapped = ret;
- mmapplen = length;
-
- return ret;
-}
-
-void *malloc(size_t size)
-{
- static void* (*func) (size_t) = NULL;
- void *ret;
-
- if (!func)
- func = (void* (*) (size_t)) dlsym(REAL_LIBC, "malloc");
-
- ret = (*func) (size);
-
- //fprintf(stderr,"MALLOC: %d -> %x\n", size, (unsigned int) ret);
-
- return ret;
-}
-#endif
-
-