Custom malloc/mmap for x86_64

Sat Apr 28 19:20:00 GMT 2012

Hi Guys,

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

Thank you!

More information about the Libc-help mailing list