What does the brk() system call do?

In the diagram you posted, the “break”—the address manipulated by brk and sbrk—is the dotted line at the top of the heap. The documentation you’ve read describes this as the end of the “data segment” because in traditional (pre-shared-libraries, pre-mmap) Unix the data segment was continuous with the heap; before program start, the kernel would … Read more