Concerning malloc and systemcall - I would like to know what's happening when the systemcall is made. Malloc is just a library-function right? 
So - when calling malloc and there are unmapped memory left on the heap - no system call is made, I guess. But, let say the allocated heap becomes full - the heap has to grow. Here, I do not know how a trap is triggered? 
A trap is needed to make the system call, so a kernel function such as brk() or mmap() can be made - but how is it made? Is it through some kind of exception internally?
I am interested to know!!!
Edit: concerning the other question - I have looked at it and cannot se (by the moment) anything about systemcall functions, traps in the cpu - instead its much about why the program crashes
 
     
     
    