Shachar , you are 100%/ right !
 
Since I knew that mmap needs file descriptor I assumed ( and did not checked man page)  that munmap need file descriptor.
 
Great !!
Thanks, Thanks,  Thanks!
 
 
04.01.2019, 22:30, "Shachar Shemesh" <shac...@shemesh.biz>:
 
On 27/12/2018 15:34, Lev Olshvang wrote:
Can you elaborate why I can not write new system call to unmap this memory regions,  which I see in /proc/self/maps  by force ?

Why would you need a system call to do this?

 

Well, obviously, you'd need a system call to do this, but why can't that system call be "munmap"? Especially since you already pointed out that you know which pages you want unmapped.

 

This is especially true, and this is also something that people seem to miss, considering that it wasn't the kernel that mapped those pages in to begin with. Those pages were mapped by the dynamic linker. It typically resides in /lib/ld-linux.so.2 or something (/lib64/ld-linux-x86-64.so.2 for more modern platforms), and is 100% a user space function.

 

So I'm still not sure why you insist on unmapping, but even if you do, I don't see why you'd need a new system call to do it.

 

Shachar

,

_______________________________________________
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

_______________________________________________
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to