This is the mail archive of the
mailing list for the glibc project.
Custom malloc/mmap for x86_64
- From: Daniel <lbathen at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Sat, 28 Apr 2012 19:08:13 +0000 (UTC)
- Subject: Custom malloc/mmap for x86_64
I am writting a custom software stack for linux and adding new
system calls to allow programmers to exploit my
logic without interfering with anything else in the system.
I am adding a custom mmap, which works if I use the
system call with its NR id:
#define my_map 312
syscall(my_map, 1024*1024, 4096, 0, 0, 0, 0, 0);
This executes dummy code for now, but I have gotten
it to invoke calls at the kernel level.
I am trying to add a call to my_map in glibc, I creted a c file
just like mmap.c, same parameters (one extra), and that
method gets invoked now that I use my glibc library. The problem
howerver, is that I am afraid that is not the way
to do this. So my question is: how do I get my_map() wrapper to
be build in a similar fashion as the wrapper for
I am using glibc-2.15 and linux kernel 3.2.16