Re: Memory allocations in linux for processes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 19 Mar 2013 20:41:55 +0530, Niroj Pokhrel said:

> #include<stdio.h>
> int main()
> {
>     while(1)
>     {
>     }
>     return 0;
> }
>
> I don't understand where does mmap or malloc come in to play in this code.

Unless you linked it statically, a lot of stuff happens before you ever
get to main() - namely, any shared library linking and mapping.  Run
strace on your binary and see how many system calls happen before you hit
the infinite loop.

Attachment: pgp7n_Aoy3nfE.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux